Documentation
¶
Index ¶
- type MemorySessionStore
- func (s *MemorySessionStore) ClearExpired() error
- func (s *MemorySessionStore) Destruct() error
- func (s *MemorySessionStore) GetSession(sessionID string) (*pkgsession.Session, error)
- func (s *MemorySessionStore) RedeemToken(signingKey []byte, token string) (*pkgsession.Session, error)
- func (s *MemorySessionStore) StoreSession(session *pkgsession.Session) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemorySessionStore ¶
type MemorySessionStore struct {
// contains filtered or unexported fields
}
MemorySessionStore is an in-memory SessionStore implementation. It survives Caddy config hot-reloads when kept in the usagePool.
func NewMemorySessionStore ¶
func NewMemorySessionStore() *MemorySessionStore
NewMemorySessionStore returns a new in-memory session store and starts a background goroutine that periodically evicts expired sessions.
func (*MemorySessionStore) ClearExpired ¶
func (s *MemorySessionStore) ClearExpired() error
ClearExpired removes all sessions that have passed their expiry time.
func (*MemorySessionStore) Destruct ¶
func (s *MemorySessionStore) Destruct() error
Destruct implements caddy.Destructor — stops the background cleanup goroutine.
func (*MemorySessionStore) GetSession ¶
func (s *MemorySessionStore) GetSession(sessionID string) (*pkgsession.Session, error)
GetSession returns an active session by ID, pruning expired sessions lazily.
func (*MemorySessionStore) RedeemToken ¶
func (s *MemorySessionStore) RedeemToken(signingKey []byte, token string) (*pkgsession.Session, error)
RedeemToken validates the HMAC-signed token and returns the stored session (one-time use).
func (*MemorySessionStore) StoreSession ¶
func (s *MemorySessionStore) StoreSession(session *pkgsession.Session) error
StoreSession persists a newly created session.