sqlite

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Table            string
	OperationTimeout time.Duration
}

Config configures the SQLite storage behaviour.

type Storage

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

Storage persists sessions in SQLite.

func NewStorage

func NewStorage(db *sql.DB, cfg Config) (*Storage, error)

NewStorage constructs a new SQLite-backed session storage.

func (*Storage) Close

func (s *Storage) Close() error

Close closes the underlying database connection.

func (*Storage) Create

func (s *Storage) Create(ctx context.Context, sess *session.Session) error

Create inserts or upserts a session record.

func (*Storage) Delete

func (s *Storage) Delete(ctx context.Context, sessionID string) error

Delete removes a session by ID.

func (*Storage) Get

func (s *Storage) Get(ctx context.Context, sessionID string) (*session.Session, error)

Get retrieves a session by ID.

func (*Storage) List

func (s *Storage) List(ctx context.Context, filters map[string]interface{}) ([]*session.Session, error)

List returns sessions that match optional filters.

func (*Storage) ListByAgent

func (s *Storage) ListByAgent(ctx context.Context, agentID string) ([]*session.Session, error)

ListByAgent returns sessions for the given agent ID.

func (*Storage) ListByUser

func (s *Storage) ListByUser(ctx context.Context, userID string) ([]*session.Session, error)

ListByUser returns sessions for the given user ID.

func (*Storage) Update

func (s *Storage) Update(ctx context.Context, sess *session.Session) error

Update updates an existing session.

Jump to

Keyboard shortcuts

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