Versions in this module Expand all Collapse all v1 v1.5.0 Mar 19, 2026 v1.4.0 Jan 14, 2026 Changes in this version + func NewContext[S any](ctx context.Context, s *Session[S]) context.Context + func StateFromContext(ctx context.Context) any + type Data struct + ID string + State S + type InMemoryStore struct + func NewInMemoryStore[S any]() *InMemoryStore[S] + func (s *InMemoryStore[S]) Get(_ context.Context, sessionID string) (*Data[S], error) + func (s *InMemoryStore[S]) Save(_ context.Context, sessionID string, data *Data[S]) error + type NotFoundError struct + SessionID string + func (e *NotFoundError) Error() string + type Option interface + func WithID[S any](id string) Option[S] + func WithInitialState[S any](state S) Option[S] + func WithStore[S any](store Store[S]) Option[S] + type Session struct + func FromContext[S any](ctx context.Context) *Session[S] + func Load[S any](ctx context.Context, store Store[S], sessionID string) (*Session[S], error) + func New[S any](ctx context.Context, opts ...Option[S]) (*Session[S], error) + func (s *Session[S]) ID() string + func (s *Session[S]) State() S + func (s *Session[S]) UpdateState(ctx context.Context, state S) error + type Store interface + Get func(ctx context.Context, sessionID string) (*Data[S], error) + Save func(ctx context.Context, sessionID string, data *Data[S]) error