Documentation
¶
Overview ¶
Package memmemory provides a concurrent in-memory reference implementation of tool.MemoryStore.
Index ¶
- type Store
- func (s *Store) Forget(ctx context.Context, key string, expected tool.MemoryVersion) (tool.MemoryRecord, error)
- func (s *Store) Index(ctx context.Context) ([]tool.MemoryEntry, error)
- func (s *Store) Inspect(ctx context.Context, key string) (tool.MemoryRecord, bool, error)
- func (s *Store) List(ctx context.Context, prefix string) ([]tool.MemoryEntry, error)
- func (s *Store) Recall(ctx context.Context, key string) (tool.MemoryEntry, bool, error)
- func (s *Store) Remember(ctx context.Context, entry tool.MemoryEntry, expected tool.MemoryCurrent) (tool.MemoryRecord, error)
- func (s *Store) Search(ctx context.Context, query string, k int) ([]tool.MemoryEntry, error)
- func (s *Store) Undo(ctx context.Context, key string, expected tool.MemoryVersion) (tool.MemoryRecord, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a process-local memory store. It is safe for concurrent use.
func (*Store) Forget ¶
func (s *Store) Forget(ctx context.Context, key string, expected tool.MemoryVersion) (tool.MemoryRecord, error)
Forget atomically appends a deletion when expected is current.
func (*Store) Remember ¶ added in v0.15.0
func (s *Store) Remember(ctx context.Context, entry tool.MemoryEntry, expected tool.MemoryCurrent) (tool.MemoryRecord, error)
Remember atomically compares the complete current state before appending.
Click to show internal directories.
Click to hide internal directories.