Documentation
¶
Index ¶
- type Config
- type Store
- func (s *Store) Close()
- func (s *Store) DeleteSession(ctx context.Context, sessionID string, sessionType dto.SessionType) error
- func (s *Store) GetSession(ctx context.Context, sessionID string, sessionType dto.SessionType) (*dto.SessionRecord, error)
- func (s *Store) ListSessions(ctx context.Context, opts store.ListSessionsOptions) ([]*dto.SessionRecord, int, error)
- func (s *Store) RenameSession(ctx context.Context, sessionID string, sessionType dto.SessionType, ...) (*dto.SessionRecord, error)
- func (s *Store) UpsertSession(ctx context.Context, record *dto.SessionRecord, preserveCreated bool) (*dto.SessionRecord, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// DSN is the full Postgres connection string.
DSN string
// TableName allows overriding the default table used to store sessions.
TableName string
// MaxConnLifeTime configures the connection lifetime on the pool. Optional.
MaxConnLifeTime time.Duration
// MaxConns optionally caps the total connections in the pool.
MaxConns int32
}
Config captures the configuration required to instantiate a Postgres backed session store.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements the session Store interface backed by Postgres.
func (*Store) DeleteSession ¶
func (s *Store) DeleteSession(ctx context.Context, sessionID string, sessionType dto.SessionType) error
DeleteSession removes a session by identifier and type.
func (*Store) GetSession ¶
func (s *Store) GetSession(ctx context.Context, sessionID string, sessionType dto.SessionType) (*dto.SessionRecord, error)
GetSession retrieves a session by identifier and type.
func (*Store) ListSessions ¶
func (s *Store) ListSessions(ctx context.Context, opts store.ListSessionsOptions) ([]*dto.SessionRecord, int, error)
ListSessions returns paginated sessions filtered according to the provided options.
func (*Store) RenameSession ¶
func (s *Store) RenameSession(ctx context.Context, sessionID string, sessionType dto.SessionType, sessionName string) (*dto.SessionRecord, error)
RenameSession updates the session name stored within the session_data JSON payload.
func (*Store) UpsertSession ¶
func (s *Store) UpsertSession(ctx context.Context, record *dto.SessionRecord, preserveCreated bool) (*dto.SessionRecord, error)
UpsertSession inserts or updates a session record in the database.
Click to show internal directories.
Click to hide internal directories.