Documentation
¶
Index ¶
- type UserSessionStore
- func (store *UserSessionStore) Get(r *http.Request, name string) (*sessions.Session, error)
- func (store *UserSessionStore) GetName() string
- func (store *UserSessionStore) MaxAge(age int)
- func (store *UserSessionStore) MaxLength(l int)
- func (store *UserSessionStore) New(r *http.Request, name string) (*sessions.Session, error)
- func (store *UserSessionStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
- type UserSessionStoreOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserSessionStore ¶
type UserSessionStore struct {
// contains filtered or unexported fields
}
func NewUserSessionStore ¶
func NewUserSessionStore(opts *UserSessionStoreOpts) (*UserSessionStore, error)
func (*UserSessionStore) Get ¶
Get Fetches a session for a given name after it has been added to the registry.
func (*UserSessionStore) GetName ¶
func (store *UserSessionStore) GetName() string
func (*UserSessionStore) MaxAge ¶
func (store *UserSessionStore) MaxAge(age int)
MaxAge sets the maximum age for the store and the underlying cookie implementation. Individual sessions can be deleted by setting Options.MaxAge = -1 for that session.
func (*UserSessionStore) MaxLength ¶
func (store *UserSessionStore) MaxLength(l int)
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 PGStore is 4096. PostgreSQL allows for max value sizes of up to 1GB (http://www.postgresql.org/docs/current/interactive/datatype-character.html)
func (*UserSessionStore) Save ¶
func (store *UserSessionStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
Save saves the given session into the database and deletes cookies if needed
type UserSessionStoreOpts ¶
type UserSessionStoreOpts struct {
SessionRepository repository.UserSessionRepository
CookieSecrets []string
CookieAllowInsecure bool
CookieDomain string
CookieName string
}
Click to show internal directories.
Click to hide internal directories.