sessionstore

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package sessionstore persists native Google ADK sessions as JSONL files.

Package sessionstore provides a durable native Google ADK session service.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSessionNotFound reports an absent session log.
	ErrSessionNotFound = errors.New("sessionstore: session not found")
	// ErrSessionExists reports an attempt to create an existing session.
	ErrSessionExists = errors.New("sessionstore: session exists")
	// ErrCorruptLog reports a complete invalid JSONL record.
	ErrCorruptLog = errors.New("sessionstore: corrupt log")
	// ErrInvalidID reports an invalid app, user, or session identifier.
	ErrInvalidID = errors.New("sessionstore: invalid identifier")
	// ErrInvalidEvent reports an event that cannot be persisted.
	ErrInvalidEvent = errors.New("sessionstore: invalid event")
	// ErrClosed reports an operation on a closed store.
	ErrClosed = errors.New("sessionstore: closed")
)

Functions

This section is empty.

Types

type Options

type Options struct {
	Dir         string
	Fsync       *bool
	NewID       func() string
	Logger      *slog.Logger
	WarningSink warning.Warner
}

type Store

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

func Open

func Open(dir string) (*Store, error)

func OpenWith

func OpenWith(o Options) (*Store, error)

func (*Store) AppendEvent

func (s *Store) AppendEvent(ctx context.Context, current session.Session, event *session.Event) error

func (*Store) AppendSidecar

func (s *Store) AppendSidecar(ctx context.Context, app, user, id, kind string, value any) error

func (*Store) Close

func (s *Store) Close() error

func (*Store) Create

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, req *session.DeleteRequest) error

func (*Store) Get

func (*Store) List

func (*Store) LoadSidecar

func (s *Store) LoadSidecar(ctx context.Context, app, user, id, kind string, destination any) (bool, error)

Jump to

Keyboard shortcuts

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