Documentation
¶
Overview ¶
Package postgres provides PostgreSQL storage for sessions.
Index ¶
- type Config
- type Store
- func (s *Store) Cleanup(ctx context.Context) error
- func (s *Store) Close() error
- func (s *Store) Create(ctx context.Context, sess *session.Session) error
- func (s *Store) Delete(ctx context.Context, id string) error
- func (s *Store) Get(ctx context.Context, id string) (*session.Session, error)
- func (s *Store) List(ctx context.Context) ([]*session.Session, error)
- func (s *Store) StartCleanupRoutine(interval time.Duration)
- func (s *Store) Touch(ctx context.Context, id string) error
- func (s *Store) UpdateState(ctx context.Context, id string, state map[string]any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements session.Store using PostgreSQL.
func (*Store) Close ¶
Close stops the cleanup goroutine and waits for it to exit. It is safe to call Close even if StartCleanupRoutine was never called.
func (*Store) StartCleanupRoutine ¶
StartCleanupRoutine starts a background goroutine that periodically removes expired sessions. The goroutine is stopped when Close is called.
Click to show internal directories.
Click to hide internal directories.