mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-30 18:16:39 +08:00
初步实验使用KV数据库(pebble)存储缓存索引
This commit is contained in:
18
internal/utils/kvstore/errors.go
Normal file
18
internal/utils/kvstore/errors.go
Normal file
@@ -0,0 +1,18 @@
|
||||
// Copyright 2024 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||
|
||||
package kvstore
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/cockroachdb/pebble"
|
||||
)
|
||||
|
||||
var ErrTableNotFound = errors.New("table not found")
|
||||
var ErrKeyTooLong = errors.New("too long key")
|
||||
|
||||
func IsKeyNotFound(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
return errors.Is(err, pebble.ErrNotFound)
|
||||
}
|
||||
Reference in New Issue
Block a user