memory

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package memory provides an in-memory Storage adapter for Chronos. Suitable for testing and development. No external dependencies.

Index

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 New

func New() *Store

New creates a new in-memory storage.

func (*Store) AppendAuditLog

func (s *Store) AppendAuditLog(_ context.Context, log *storage.AuditLog) error

func (*Store) AppendEvent

func (s *Store) AppendEvent(_ context.Context, e *storage.Event) error

func (*Store) Close

func (s *Store) Close() error

func (*Store) CreateSession

func (s *Store) CreateSession(_ context.Context, sess *storage.Session) error

func (*Store) DeleteMemory

func (s *Store) DeleteMemory(_ context.Context, id string) error

func (*Store) GetCheckpoint

func (s *Store) GetCheckpoint(_ context.Context, id string) (*storage.Checkpoint, error)

func (*Store) GetLatestCheckpoint

func (s *Store) GetLatestCheckpoint(_ context.Context, sessionID string) (*storage.Checkpoint, error)

func (*Store) GetMemory

func (s *Store) GetMemory(_ context.Context, agentID, key string) (*storage.MemoryRecord, error)

func (*Store) GetSession

func (s *Store) GetSession(_ context.Context, id string) (*storage.Session, error)

func (*Store) GetTrace

func (s *Store) GetTrace(_ context.Context, id string) (*storage.Trace, error)

func (*Store) InsertTrace

func (s *Store) InsertTrace(_ context.Context, t *storage.Trace) error

func (*Store) ListAuditLogs

func (s *Store) ListAuditLogs(_ context.Context, sessionID string, limit, offset int) ([]*storage.AuditLog, error)

func (*Store) ListCheckpoints

func (s *Store) ListCheckpoints(_ context.Context, sessionID string) ([]*storage.Checkpoint, error)

func (*Store) ListEvents

func (s *Store) ListEvents(_ context.Context, sessionID string, afterSeq int64) ([]*storage.Event, error)

func (*Store) ListMemory

func (s *Store) ListMemory(_ context.Context, agentID, kind string) ([]*storage.MemoryRecord, error)

func (*Store) ListSessions

func (s *Store) ListSessions(_ context.Context, agentID string, limit, offset int) ([]*storage.Session, error)

func (*Store) ListTraces

func (s *Store) ListTraces(_ context.Context, sessionID string) ([]*storage.Trace, error)

func (*Store) Migrate

func (s *Store) Migrate(_ context.Context) error

func (*Store) PutMemory

func (s *Store) PutMemory(_ context.Context, m *storage.MemoryRecord) error

func (*Store) SaveCheckpoint

func (s *Store) SaveCheckpoint(_ context.Context, cp *storage.Checkpoint) error

func (*Store) UpdateSession

func (s *Store) UpdateSession(_ context.Context, sess *storage.Session) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL