Documentation
¶
Index ¶
- func NewInMemoryCheckPointStore() compose.CheckPointStore
- func NewInMemoryStore() compose.CheckPointStore
- type InMemoryCheckPointStore
- type PersistenceStore
- func (s *PersistenceStore) Clear() error
- func (s *PersistenceStore) Close() error
- func (s *PersistenceStore) Get(ctx context.Context, key string) ([]byte, bool, error)
- func (s *PersistenceStore) LoadMessages() ([]*schema.Message, error)
- func (s *PersistenceStore) SaveMessage(msg *schema.Message) error
- func (s *PersistenceStore) SaveMessages(messages []*schema.Message) error
- func (s *PersistenceStore) SaveMessagesOverwrite(messages []*schema.Message) error
- func (s *PersistenceStore) Set(ctx context.Context, key string, value []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInMemoryCheckPointStore ¶
func NewInMemoryCheckPointStore() compose.CheckPointStore
NewInMemoryCheckPointStore creates a new in-memory checkpoint store
func NewInMemoryStore ¶
func NewInMemoryStore() compose.CheckPointStore
Types ¶
type InMemoryCheckPointStore ¶
type InMemoryCheckPointStore struct {
// contains filtered or unexported fields
}
InMemoryCheckPointStore wraps a compose.CheckPointStore with additional functionality
func NewHybridCheckPointStore ¶
func NewHybridCheckPointStore(persistence *PersistenceStore) *InMemoryCheckPointStore
NewHybridCheckPointStore creates a hybrid store that uses both memory and persistence
type PersistenceStore ¶
type PersistenceStore struct {
// contains filtered or unexported fields
}
PersistenceStore implements CheckPointStore with simple JSON file persistence Each session uses two files: - .json file: stores checkpoint data (key-value pairs) - .jsonl file: stores messages in append-only mode (one JSON object per line)
func NewPersistenceStore ¶
func NewPersistenceStore(sessionID string) (*PersistenceStore, error)
NewPersistenceStore creates a new persistence store for the given session ID
func (*PersistenceStore) Clear ¶
func (s *PersistenceStore) Clear() error
Clear removes all persisted data for this session
func (*PersistenceStore) Close ¶
func (s *PersistenceStore) Close() error
Close releases resources (no-op for file-based storage)
func (*PersistenceStore) LoadMessages ¶
func (s *PersistenceStore) LoadMessages() ([]*schema.Message, error)
LoadMessages loads all messages from the JSONL file Each line in the JSONL file is a separate schema.Message object
func (*PersistenceStore) SaveMessage ¶
func (s *PersistenceStore) SaveMessage(msg *schema.Message) error
SaveMessage appends a single message to the JSONL file in append-only mode Each message is written as a separate JSON object on its own line This method should be called with one message at a time for incremental storage
func (*PersistenceStore) SaveMessages ¶
func (s *PersistenceStore) SaveMessages(messages []*schema.Message) error
SaveMessages appends multiple messages to the JSONL file For normal operation, prefer calling SaveMessage once per new message
func (*PersistenceStore) SaveMessagesOverwrite ¶
func (s *PersistenceStore) SaveMessagesOverwrite(messages []*schema.Message) error
SaveMessagesOverwrite overwrites the entire JSONL file with the provided messages This is used when historical messages are modified (e.g., after compression) It completely rewrites the file instead of appending