[#70] cmd/neofs-node: Implement Del method on in-memory bucket

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-10-03 12:58:18 +03:00 committed by Alex Vanin
parent 9a604a50b9
commit 276ed6c04b

View file

@ -69,6 +69,14 @@ func newBucket() bucket.Bucket {
} }
} }
func (b *inMemBucket) Del(key []byte) error {
b.Lock()
delete(b.items, base58.Encode(key))
b.Unlock()
return nil
}
func (b *inMemBucket) Get(key []byte) ([]byte, error) { func (b *inMemBucket) Get(key []byte) ([]byte, error) {
b.RLock() b.RLock()
v, ok := b.items[base58.Encode(key)] v, ok := b.items[base58.Encode(key)]