store

package
v0.1.44 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DataDirEnv = "WHALE_HOME"
)

Variables

This section is empty.

Functions

func DefaultDataDir

func DefaultDataDir() string

func DefaultSessionsDir

func DefaultSessionsDir(dataDir string) string

func MostRecentSessionID

func MostRecentSessionID(sessionsDir string) (string, error)

Types

type ApprovalStore

type ApprovalStore interface {
	GetApprovals(ctx context.Context, sessionID string) (map[string]bool, error)
	GrantApproval(ctx context.Context, sessionID, key string) error
}

type InMemoryStore

type InMemoryStore struct {
	// contains filtered or unexported fields
}

func NewInMemoryStore

func NewInMemoryStore() *InMemoryStore

func (*InMemoryStore) Create

func (s *InMemoryStore) Create(_ context.Context, msg core.Message) (core.Message, error)

func (*InMemoryStore) GetApprovals

func (s *InMemoryStore) GetApprovals(_ context.Context, sessionID string) (map[string]bool, error)

func (*InMemoryStore) GrantApproval

func (s *InMemoryStore) GrantApproval(_ context.Context, sessionID, key string) error

func (*InMemoryStore) List

func (s *InMemoryStore) List(_ context.Context, sessionID string) ([]core.Message, error)

func (*InMemoryStore) RewriteSession

func (s *InMemoryStore) RewriteSession(_ context.Context, sessionID string, msgs []core.Message) error

func (*InMemoryStore) Update

func (s *InMemoryStore) Update(_ context.Context, msg core.Message) error

type JSONLStore

type JSONLStore struct {
	// contains filtered or unexported fields
}

func NewJSONLStore

func NewJSONLStore(sessionsDir string) (*JSONLStore, error)

func (*JSONLStore) Create

func (s *JSONLStore) Create(_ context.Context, msg core.Message) (core.Message, error)

func (*JSONLStore) GetApprovals

func (s *JSONLStore) GetApprovals(_ context.Context, sessionID string) (map[string]bool, error)

func (*JSONLStore) GrantApproval

func (s *JSONLStore) GrantApproval(_ context.Context, sessionID, key string) error

func (*JSONLStore) List

func (s *JSONLStore) List(_ context.Context, sessionID string) ([]core.Message, error)

func (*JSONLStore) RewriteSession

func (s *JSONLStore) RewriteSession(_ context.Context, sessionID string, msgs []core.Message) error

func (*JSONLStore) Update

func (s *JSONLStore) Update(_ context.Context, msg core.Message) error

type MessageStore

type MessageStore interface {
	List(ctx context.Context, sessionID string) ([]core.Message, error)
	Create(ctx context.Context, msg core.Message) (core.Message, error)
	Update(ctx context.Context, msg core.Message) error
}

type SessionRewriteStore

type SessionRewriteStore interface {
	RewriteSession(ctx context.Context, sessionID string, msgs []core.Message) error
}

Jump to

Keyboard shortcuts

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