Documentation
¶
Overview ¶
internal/session/manager.go
internal/session/store.go
Index ¶
- type PostgresStore
- func (p *PostgresStore) All(ctx context.Context) (map[string][]byte, error)
- func (p *PostgresStore) Cleanup(ctx context.Context) error
- func (p *PostgresStore) Commit(ctx context.Context, token string, b []byte, expiry time.Time) error
- func (p *PostgresStore) Delete(ctx context.Context, token string) error
- func (p *PostgresStore) Find(ctx context.Context, token string) (b []byte, exists bool, err error)
- type SessionManager
- func (s *SessionManager) Cleanup(ctx context.Context) error
- func (s *SessionManager) Destroy(ctx context.Context, c *echo.Context) error
- func (s *SessionManager) Load(ctx context.Context, c *echo.Context) (map[string]any, error)
- func (s *SessionManager) RenewToken(ctx context.Context, c *echo.Context) error
- func (s *SessionManager) Save(ctx context.Context, c *echo.Context, values map[string]any) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostgresStore ¶
type PostgresStore struct {
// contains filtered or unexported fields
}
func NewPostgresStore ¶
func (*PostgresStore) All ¶
All returns a map containing the token and data for all active (i.e. not expired) sessions.
func (*PostgresStore) Cleanup ¶
func (p *PostgresStore) Cleanup(ctx context.Context) error
Cleanup deletes expired session data from the PostgresStore instance.
func (*PostgresStore) Commit ¶
Commit adds a session token and data to the PostgresStore instance with the given expiry time. If the session token already exists, then the data and expiry time are updated.
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*SessionManager) Cleanup ¶
func (s *SessionManager) Cleanup(ctx context.Context) error
Cleanup is exposed to allow the session store to cleanup expired sessions
func (*SessionManager) RenewToken ¶
RenewToken updates the session token while preserving the session data.
Click to show internal directories.
Click to hide internal directories.