Documentation ¶
Index ¶
- type Config
- type CookieConfig
- type CookieUtil
- type Data
- func (d *Data) CSRFToken() string
- func (d *Data) Clear()
- func (d *Data) Data() map[string]interface{}
- func (d *Data) Delete(key string)
- func (d *Data) ExpiredAt() time.Time
- func (d *Data) Get(key string) (interface{}, bool)
- func (d *Data) Id() string
- func (d *Data) Invalidate()
- func (d *Data) RegenerateCSRFToken()
- func (d *Data) RegenerateId()
- func (d *Data) Set(key string, value interface{})
- type Service
- func (s *Service) Clear(ctx *web.Context) error
- func (s *Service) Delete(ctx *web.Context, key string) error
- func (s *Service) Get(ctx *web.Context, key string) (interface{}, error)
- func (s *Service) Invalidate(ctx *web.Context) error
- func (s *Service) IsTokenMatch(ctx *web.Context, token string) (bool, error)
- func (s *Service) Put(ctx *web.Context, key string, value interface{}) error
- func (s *Service) Regenerate(ctx *web.Context) error
- func (s *Service) RegenerateToken(ctx *web.Context) error
- func (s *Service) Start(ctx *web.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Default Session Storage // Supported: "database" Storage string // Database connection Connection string // Database table Table string AutoMigrate bool Cookie CookieConfig }
type CookieConfig ¶
type CookieConfig struct { Name string CsrfCookieName string Path string Domain string Secure bool /* Here you may specify the number of minutes that you wish the session to be allowed to remain idle before it expires. If you want them to immediately expire on the browser closing, set that option. */ Lifetime int }
type CookieUtil ¶
type CookieUtil struct {
// contains filtered or unexported fields
}
func NewCookieUtil ¶
func NewCookieUtil(cfg CookieConfig) *CookieUtil
func (*CookieUtil) Write ¶
func (c *CookieUtil) Write(ctx *web.Context, data contracts.SessionData)
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
func NewEmptyData ¶
func (*Data) Invalidate ¶
func (d *Data) Invalidate()
func (*Data) RegenerateCSRFToken ¶
func (d *Data) RegenerateCSRFToken()
func (*Data) RegenerateId ¶
func (d *Data) RegenerateId()
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(storage contracts.SessionStorage, writer contracts.SessionCookieWriter, cfg Config) (*Service, error)
func (*Service) IsTokenMatch ¶
Click to show internal directories.
Click to hide internal directories.