Documentation
¶
Overview ¶
Package sqlite provides a SQLite-based implementation of the session.Service interface. This is ideal for desktop applications and single-user scenarios where a lightweight, file-based database is preferred over PostgreSQL or MySQL.
Index ¶
- type Service
- func (s *Service) AppendEvent(ctx context.Context, sessionID string, event *session.Event) error
- func (s *Service) Close() error
- func (s *Service) Create(ctx context.Context, req *session.CreateRequest) (session.Session, error)
- func (s *Service) Delete(ctx context.Context, sessionID string) error
- func (s *Service) Get(ctx context.Context, req *session.GetRequest) (session.Session, error)
- func (s *Service) GetEvents(ctx context.Context, sessionID string, filter *session.EventFilter) ([]session.Event, error)
- func (s *Service) List(ctx context.Context, req *session.ListRequest) ([]*session.Session, error)
- func (s *Service) Update(ctx context.Context, req *session.UpdateRequest) error
- func (s *Service) UpdateState(ctx context.Context, sessionID string, delta map[string]any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements session.Service using SQLite.
func New ¶
New creates a new SQLite session service. dbPath is the path to the SQLite database file. If the file doesn't exist, it will be created.
func (*Service) AppendEvent ¶
AppendEvent adds an event to a session.
func (*Service) GetEvents ¶
func (s *Service) GetEvents(ctx context.Context, sessionID string, filter *session.EventFilter) ([]session.Event, error)
GetEvents retrieves events for a session.
Click to show internal directories.
Click to hide internal directories.