package cursor

import (
	"sync"
)

type MemoryStore struct {
	store sync.Map
}

func (m *MemoryStore) Set(key string, cursor string) {
	m.store.Store(key, cursor)
}

func (m *MemoryStore) Get(key string) (cursor string) {
	if result, ok := m.store.Load(key); ok {
		if val, ok := result.(string); ok {
			return val
		}
	}
	return ""
}
