Documentation
¶
Index ¶
- Variables
- type Manager
- func (m *Manager) AcquireSession() *Session
- func (m *Manager) BuildSession(name string, driver ...string) (*Session, error)
- func (m *Manager) Extend(driver string, handler driver.Driver) error
- func (m *Manager) GetSession(r *http.Request, key ...any) (*Session, error)
- func (m *Manager) HasSession(r *http.Request, key ...any) bool
- func (m *Manager) ReleaseSession(session *Session)
- type ManagerOptions
- type Session
- func (s *Session) All() map[string]any
- func (s *Session) Exists(key string) bool
- func (s *Session) Flash(key string, value any) *Session
- func (s *Session) Flush() *Session
- func (s *Session) Forget(keys ...string) *Session
- func (s *Session) Get(key string, defaultValue ...any) any
- func (s *Session) GetID() string
- func (s *Session) GetName() string
- func (s *Session) Has(key string) bool
- func (s *Session) Invalidate() error
- func (s *Session) IsStarted() bool
- func (s *Session) Keep(keys ...string) *Session
- func (s *Session) Missing(key string) bool
- func (s *Session) Now(key string, value any) *Session
- func (s *Session) Only(keys []string) map[string]any
- func (s *Session) Pull(key string, def ...any) any
- func (s *Session) Put(key string, value any) *Session
- func (s *Session) Reflash() *Session
- func (s *Session) Regenerate(destroy ...bool) error
- func (s *Session) Remove(key string) any
- func (s *Session) Save() error
- func (s *Session) SetID(id string) *Session
- func (s *Session) SetName(name string) *Session
- func (s *Session) Start() bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CtxKey = "session" // session default context key CookieName = "session" // session default cookie name )
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
Codec securecookie.Codec
Lifetime int
GcInterval int
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(option *ManagerOptions) (*Manager, error)
NewManager creates a new session manager.
func (*Manager) AcquireSession ¶
func (*Manager) BuildSession ¶
func (*Manager) GetSession ¶
func (*Manager) ReleaseSession ¶
type ManagerOptions ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) Invalidate ¶
func (*Session) Regenerate ¶
Click to show internal directories.
Click to hide internal directories.