Documentation
¶
Index ¶
- Variables
- type Options
- type SQLStore
- func (m *SQLStore) Cleanup(interval time.Duration) (chan<- struct{}, <-chan struct{})
- func (m *SQLStore) Close() (err error)
- func (m *SQLStore) Delete(ctx echo.Context, session *sessions.Session) error
- func (m *SQLStore) Get(ctx echo.Context, name string) (*sessions.Session, error)
- func (m *SQLStore) Init()
- func (m *SQLStore) MaxAge(ctx echo.Context, session *sessions.Session) int
- func (m *SQLStore) MaxLength(l int)
- func (m *SQLStore) New(ctx echo.Context, name string) (*sessions.Session, error)
- func (m *SQLStore) Reload(ctx echo.Context, session *sessions.Session) error
- func (m *SQLStore) Remove(sessionID string) error
- func (m *SQLStore) Save(ctx echo.Context, session *sessions.Session) error
- func (m *SQLStore) StopCleanup(quit chan<- struct{}, done <-chan struct{})
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultInterval = time.Minute * 5
View Source
var ErrSessionExpired = errors.New("Session expired")
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { Table string `json:"table"` KeyPrefix string `json:"keyPrefix"` KeyPairs [][]byte `json:"-"` MaxAge int `json:"maxAge"` EmptyDataAge int `json:"emptyDataAge"` MaxLength int `json:"maxLength"` CheckInterval time.Duration `json:"checkInterval"` MaxReconnect int `json:"maxReconnect"` // contains filtered or unexported fields }
type SQLStore ¶
type SQLStore struct { Codecs []securecookie.Codec // contains filtered or unexported fields }
func (*SQLStore) Cleanup ¶
Cleanup runs a background goroutine every interval that deletes expired sessions from the database.
The design is based on https://github.com/yosssi/boltstore
func (*SQLStore) MaxLength ¶
MaxLength restricts the maximum length of new sessions to l. If l is 0 there is no limit to the size of a session, use with caution. The default for a new FilesystemStore is 4096.
func (*SQLStore) StopCleanup ¶
func (m *SQLStore) StopCleanup(quit chan<- struct{}, done <-chan struct{})
StopCleanup stops the background cleanup from running.
Click to show internal directories.
Click to hide internal directories.