Versions in this module Expand all Collapse all v4 v4.0.0 Jun 23, 2022 Changes in this version + const Version + var ErrInvalidSessionID = errors.New("invalid session id") + func Destroy(ctx context.Context, w http.ResponseWriter, r *http.Request) error + func FromReqContext(ctx context.Context) (*http.Request, bool) + func FromResContext(ctx context.Context) (http.ResponseWriter, bool) + func InitManager(opt ...Option) + type IDHandlerFunc func(context.Context) string + type Manager struct + func NewManager(opt ...Option) *Manager + func (m *Manager) Destroy(ctx context.Context, w http.ResponseWriter, r *http.Request) error + func (m *Manager) Refresh(ctx context.Context, w http.ResponseWriter, r *http.Request) (Store, error) + func (m *Manager) Start(ctx context.Context, w http.ResponseWriter, r *http.Request) (Store, error) + type ManagerStore interface + Check func(ctx context.Context, sid string) (bool, error) + Close func() error + Create func(ctx context.Context, sid string, expired int64) (Store, error) + Delete func(ctx context.Context, sid string) error + Refresh func(ctx context.Context, oldsid, sid string, expired int64) (Store, error) + Update func(ctx context.Context, sid string, expired int64) (Store, error) + func NewMemoryStore() ManagerStore + type Option func(*options) + func SetCookieLifeTime(cookieLifeTime int) Option + func SetCookieName(cookieName string) Option + func SetDomain(domain string) Option + func SetEnableSIDInHTTPHeader(enableSIDInHTTPHeader bool) Option + func SetEnableSIDInURLQuery(enableSIDInURLQuery bool) Option + func SetEnableSetCookie(enableSetCookie bool) Option + func SetExpired(expired int64) Option + func SetSameSite(sameSite http.SameSite) Option + func SetSecure(secure bool) Option + func SetSessionID(handler IDHandlerFunc) Option + func SetSessionNameInHTTPHeader(sessionNameInHTTPHeader string) Option + func SetSign(sign []byte) Option + func SetStore(store ManagerStore) Option + type Store interface + Context func() context.Context + Delete func(key string) interface{} + Flush func() error + Get func(key string) (interface{}, bool) + Save func() error + SessionID func() string + Set func(key string, value interface{}) + SetUID func(key string) + UserID func() string + func Refresh(ctx context.Context, w http.ResponseWriter, r *http.Request) (Store, error) + func Start(ctx context.Context, w http.ResponseWriter, r *http.Request) (Store, error) Other modules containing this package github.com/Chetok3/session