From f00ee2a3b178d3ca72383003ec33f1b55d9d59d5 Mon Sep 17 00:00:00 2001 From: shaoyue Date: Tue, 30 Nov 2021 16:08:59 +0800 Subject: [PATCH] [skip ci] Add comment for mem_kv.go (#12448) Signed-off-by: shaoyue.chen --- internal/kv/mem/mem_kv.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/kv/mem/mem_kv.go b/internal/kv/mem/mem_kv.go index 291fabe99a..a45065367a 100644 --- a/internal/kv/mem/mem_kv.go +++ b/internal/kv/mem/mem_kv.go @@ -172,9 +172,12 @@ func (kv *MemoryKV) LoadWithPrefix(key string) ([]string, []string, error) { func (kv *MemoryKV) Close() { } +// MultiRemoveWithPrefix not implemented func (kv *MemoryKV) MultiRemoveWithPrefix(keys []string) error { panic("not implement") } + +// MultiSaveAndRemoveWithPrefix saves key-value pairs in @saves, & remove key with prefix in @removals in MemoryKV atomicly. func (kv *MemoryKV) MultiSaveAndRemoveWithPrefix(saves map[string]string, removals []string) error { kv.Lock() defer kv.Unlock() @@ -198,6 +201,7 @@ func (kv *MemoryKV) MultiSaveAndRemoveWithPrefix(saves map[string]string, remova return nil } +// RemoveWithPrefix remove key of given prefix in MemoryKV atomicly. func (kv *MemoryKV) RemoveWithPrefix(key string) error { kv.Lock() defer kv.Unlock()