github.com/pyroscope-io/pyroscope@v0.37.3-0.20230725203016-5f6947968bd0/pkg/history/memstore.go (about) 1 package history 2 3 import "context" 4 5 type MemStoreManager struct { 6 store map[QueryID]*Entry 7 } 8 9 func NewMemStoreManager() *MemStoreManager { 10 return &MemStoreManager{ 11 store: make(map[QueryID]*Entry), 12 } 13 } 14 15 func (m *MemStoreManager) Add(_ context.Context, e *Entry) (QueryID, error) { 16 qid := GenerateQueryID() 17 m.store[qid] = e 18 return qid, nil 19 } 20 21 func (m *MemStoreManager) Get(_ context.Context, qid QueryID) (*Entry, error) { 22 return m.store[qid], nil 23 } 24 25 func (*MemStoreManager) List(_ context.Context, _ string) ([]*Entry, string, error) { 26 return []*Entry{}, "", nil 27 }