Something went wrong. Try again.
Monorepo for Tangled
Something went wrong. Try again.
333 B · 22 lines
Go
1234567891011121314151617181920212223package cursor
import ( "sync")
type MemoryStore struct { store sync.Map}
func (m *MemoryStore) Set(key string, cursor int64) { m.store.Store(key, cursor)}
func (m *MemoryStore) Get(key string) (cursor int64) { if result, ok := m.store.Load(key); ok { if val, ok := result.(int64); ok { return val } } return 0}