|
|
@ -3,6 +3,8 @@ package leveldb |
|
|
|
import ( |
|
|
|
"context" |
|
|
|
"fmt" |
|
|
|
"github.com/chrislusf/seaweedfs/weed/filer" |
|
|
|
"github.com/syndtr/goleveldb/leveldb" |
|
|
|
) |
|
|
|
|
|
|
|
func (store *LevelDBStore) KvPut(ctx context.Context, key []byte, value []byte) (err error) { |
|
|
@ -20,6 +22,10 @@ func (store *LevelDBStore) KvGet(ctx context.Context, key []byte) (value []byte, |
|
|
|
|
|
|
|
value, err = store.db.Get(key, nil) |
|
|
|
|
|
|
|
if err == leveldb.ErrNotFound { |
|
|
|
return nil, filer.ErrKvNotFound |
|
|
|
} |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
return nil, fmt.Errorf("kv get: %v", err) |
|
|
|
} |
|
|
|