Documentation
¶
Overview ¶
Package memory provides an in-memory Storage adapter for Chronos. Suitable for testing and development. No external dependencies.
Index ¶
- type Store
- func (s *Store) AppendAuditLog(ctx context.Context, log *storage.AuditLog) error
- func (s *Store) AppendEvent(ctx context.Context, e *storage.Event) error
- func (s *Store) Close() error
- func (s *Store) CreateSession(ctx context.Context, sess *storage.Session) error
- func (s *Store) DeleteMemory(ctx context.Context, id string) error
- func (s *Store) GetCheckpoint(ctx context.Context, id string) (*storage.Checkpoint, error)
- func (s *Store) GetLatestCheckpoint(ctx context.Context, sessionID string) (*storage.Checkpoint, error)
- func (s *Store) GetMemory(ctx context.Context, agentID, key string) (*storage.MemoryRecord, error)
- func (s *Store) GetSession(ctx context.Context, id string) (*storage.Session, error)
- func (s *Store) GetTrace(ctx context.Context, id string) (*storage.Trace, error)
- func (s *Store) InsertTrace(ctx context.Context, t *storage.Trace) error
- func (s *Store) ListAuditLogs(ctx context.Context, sessionID string, limit, offset int) ([]*storage.AuditLog, error)
- func (s *Store) ListCheckpoints(ctx context.Context, sessionID string) ([]*storage.Checkpoint, error)
- func (s *Store) ListEvents(ctx context.Context, sessionID string, afterSeq int64) ([]*storage.Event, error)
- func (s *Store) ListMemory(ctx context.Context, agentID, kind string) ([]*storage.MemoryRecord, error)
- func (s *Store) ListSessions(ctx context.Context, agentID string, limit, offset int) ([]*storage.Session, error)
- func (s *Store) ListTraces(ctx context.Context, sessionID string) ([]*storage.Trace, error)
- func (s *Store) Migrate(_ context.Context) error
- func (s *Store) PutMemory(ctx context.Context, m *storage.MemoryRecord) error
- func (s *Store) SaveCheckpoint(ctx context.Context, cp *storage.Checkpoint) error
- func (s *Store) UpdateSession(ctx context.Context, sess *storage.Session) error
- func (s *Store) UpdateSessionStatus(ctx context.Context, sessionID, status string, updatedAt time.Time) 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 implements storage.Storage using Go maps with sync.RWMutex.
func (*Store) AppendAuditLog ¶
func (*Store) AppendEvent ¶
func (*Store) CreateSession ¶
func (*Store) GetCheckpoint ¶
func (*Store) GetLatestCheckpoint ¶
func (s *Store) GetLatestCheckpoint(ctx context.Context, sessionID string) (*storage.Checkpoint, error)
GetLatestCheckpoint returns the checkpoint with the highest seq_num for the session, not the one with the latest wall-clock CreatedAt: same-tick checkpoints (or a clock step) would otherwise make the "latest" checkpoint non-deterministic, the bug PLAN.md P0-003 fixed for the SQL adapters — this applies the same fix here.
func (*Store) GetSession ¶
func (*Store) InsertTrace ¶
func (*Store) ListAuditLogs ¶
func (*Store) ListCheckpoints ¶
func (*Store) ListEvents ¶
func (*Store) ListMemory ¶
func (*Store) ListSessions ¶
func (*Store) ListTraces ¶
func (*Store) SaveCheckpoint ¶
func (*Store) UpdateSession ¶
func (*Store) UpdateSessionStatus ¶ added in v0.13.0
func (s *Store) UpdateSessionStatus(ctx context.Context, sessionID, status string, updatedAt time.Time) error
UpdateSessionStatus implements storage.SessionStatusUpdater: a narrow write that only touches Status/UpdatedAt, so it can never race with (and clobber) a concurrent Metadata writer the way a GetSession->mutate->UpdateSession read-modify-write could.