Versions in this module Expand all Collapse all v2 v2.6.1 May 13, 2023 Changes in this version + type Codec interface + Decode func([]byte) (deadline time.Time, values map[string]interface{}, err error) + Encode func(deadline time.Time, values map[string]interface{}) ([]byte, error) + type CtxStore interface + CommitCtx func(ctx context.Context, token string, b []byte, expiry time.Time) (err error) + DeleteCtx func(ctx context.Context, token string) (err error) + FindCtx func(ctx context.Context, token string) (b []byte, found bool, err error) + type GobCodec struct + func (GobCodec) Decode(b []byte) (time.Time, map[string]interface{}, error) + func (GobCodec) Encode(deadline time.Time, values map[string]interface{}) ([]byte, error) + type IterableCtxStore interface + AllCtx func(ctx context.Context) (map[string][]byte, error) + type IterableStore interface + All func() (map[string][]byte, error) + type Session = SessionManager + type SessionCookie struct + Domain string + HttpOnly bool + Name string + Path string + Persist bool + SameSite http.SameSite + Secure bool + type SessionManager struct + Codec Codec + Cookie SessionCookie + CtxStore CtxStore + ErrorFunc func(http.ResponseWriter, *http.Request, error) + IdleTimeout time.Duration + Lifetime time.Duration + Store Store + func New() *SessionManager + func NewSession() *SessionManager + func (s *SessionManager) Clear(ctx context.Context) error + func (s *SessionManager) Commit(ctx context.Context) (string, time.Time, error) + func (s *SessionManager) Deadline(ctx context.Context) time.Time + func (s *SessionManager) Destroy(ctx context.Context) error + func (s *SessionManager) Exists(ctx context.Context, key string) bool + func (s *SessionManager) Get(ctx context.Context, key string) interface{} + func (s *SessionManager) GetBool(ctx context.Context, key string) bool + func (s *SessionManager) GetBytes(ctx context.Context, key string) []byte + func (s *SessionManager) GetFloat(ctx context.Context, key string) float64 + func (s *SessionManager) GetInt(ctx context.Context, key string) int + func (s *SessionManager) GetInt32(ctx context.Context, key string) int32 + func (s *SessionManager) GetInt64(ctx context.Context, key string) int64 + func (s *SessionManager) GetString(ctx context.Context, key string) string + func (s *SessionManager) GetTime(ctx context.Context, key string) time.Time + func (s *SessionManager) Iterate(ctx context.Context, fn func(context.Context) error) error + func (s *SessionManager) Keys(ctx context.Context) []string + func (s *SessionManager) Load(ctx context.Context, token string) (context.Context, error) + func (s *SessionManager) LoadAndSave(next http.Handler) http.Handler + func (s *SessionManager) MergeSession(ctx context.Context, token string) error + func (s *SessionManager) Pop(ctx context.Context, key string) interface{} + func (s *SessionManager) PopBool(ctx context.Context, key string) bool + func (s *SessionManager) PopBytes(ctx context.Context, key string) []byte + func (s *SessionManager) PopFloat(ctx context.Context, key string) float64 + func (s *SessionManager) PopInt(ctx context.Context, key string) int + func (s *SessionManager) PopString(ctx context.Context, key string) string + func (s *SessionManager) PopTime(ctx context.Context, key string) time.Time + func (s *SessionManager) Put(ctx context.Context, key string, val interface{}) + func (s *SessionManager) RememberMe(ctx context.Context, val bool) + func (s *SessionManager) Remove(ctx context.Context, key string) + func (s *SessionManager) RenewToken(ctx context.Context) error + func (s *SessionManager) Status(ctx context.Context) Status + func (s *SessionManager) Token(ctx context.Context) string + func (s *SessionManager) WriteSessionCookie(ctx context.Context, w http.ResponseWriter, token string, expiry time.Time) + type Status int + const Destroyed + const Modified + const Unmodified + type Store interface + Commit func(token string, b []byte, expiry time.Time) (err error) + Delete func(token string) (err error) + Find func(token string) (b []byte, found bool, err error)