Documentation
¶
Overview ¶
Package memmemory provides a concurrent in-memory reference implementation of tool.MemoryStore and its optional tool.MemoryLifecycleStore capability.
Index ¶
- type Store
- func (s *Store) Forget(ctx context.Context, key string) error
- func (s *Store) ForgetVersioned(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) RememberEntry(ctx context.Context, entry tool.MemoryEntry) error
- func (s *Store) RememberIfCurrent(ctx context.Context, entry tool.MemoryEntry, expected tool.MemoryCurrent) (tool.MemoryRecord, error)
- func (s *Store) RememberVersioned(ctx context.Context, entry tool.MemoryEntry, expected tool.MemoryVersion) (tool.MemoryRecord, error)
- func (s *Store) Search(ctx context.Context, query string, k int) ([]tool.MemoryEntry, error)
- func (s *Store) UndoLatest(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 ¶
Forget unconditionally deletes an active legacy entry. The tombstone remains available through Inspect; deleting a missing key is a no-op.
func (*Store) ForgetVersioned ¶
func (s *Store) ForgetVersioned(ctx context.Context, key string, expected tool.MemoryVersion) (tool.MemoryRecord, error)
ForgetVersioned atomically appends a deletion when expected is current.
func (*Store) RememberEntry ¶
RememberEntry preserves the legacy MemoryStore behavior: only blank keys are rejected and writes overwrite unconditionally.
func (*Store) RememberIfCurrent ¶
func (s *Store) RememberIfCurrent(ctx context.Context, entry tool.MemoryEntry, expected tool.MemoryCurrent) (tool.MemoryRecord, error)
RememberIfCurrent atomically compares presence and version before appending.
func (*Store) RememberVersioned ¶
func (s *Store) RememberVersioned(ctx context.Context, entry tool.MemoryEntry, expected tool.MemoryVersion) (tool.MemoryRecord, error)
RememberVersioned atomically creates or replaces an active record when its current version equals expected.
func (*Store) Search ¶
Search performs deterministic case-insensitive lexical matching over active keys, descriptions, and values.
func (*Store) UndoLatest ¶
func (s *Store) UndoLatest(ctx context.Context, key string, expected tool.MemoryVersion) (tool.MemoryRecord, error)
UndoLatest atomically appends a compensating revision restoring the state immediately before the current revision.