mirror of
https://github.com/taigrr/bitcask
synced 2025-01-18 04:03:17 -08:00
Add Keys() to exported API (extended API)
This commit is contained in:
@@ -55,8 +55,10 @@ func (k *Keydir) Delete(key string) {
|
||||
func (k *Keydir) Keys() chan string {
|
||||
ch := make(chan string)
|
||||
go func() {
|
||||
for k := range k.kv {
|
||||
ch <- k
|
||||
k.RLock()
|
||||
defer k.RUnlock()
|
||||
for key := range k.kv {
|
||||
ch <- key
|
||||
}
|
||||
close(ch)
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user