collection of golang services under the Red Dwarf umbrella server.reddwarf.app
bluesky reddwarf microcosm appview
16
fork

Configure Feed

Select the types of activity you want to include in your feed.

at a6db7a8b42cfa34fa7efd7a86b1c9160cc51725d 27 lines 378 B view raw
1package store 2 3import "sync" 4 5type KV struct { 6 mu sync.RWMutex 7 m map[string][]byte 8} 9 10func NewKV() *KV { 11 return &KV{ 12 m: make(map[string][]byte), 13 } 14} 15 16func (kv *KV) Get(key string) ([]byte, bool) { 17 kv.mu.RLock() 18 defer kv.mu.RUnlock() 19 v, ok := kv.m[key] 20 return v, ok 21} 22 23func (kv *KV) Set(key string, val []byte) { 24 kv.mu.Lock() 25 defer kv.mu.Unlock() 26 kv.m[key] = val 27}