Documentation
¶
Index ¶
- Constants
- type SessionStore
- func (s *SessionStore) Get(r *http.Request, name string) (*sessions.Session, error)
- func (s *SessionStore) MaxAge(age int)
- func (s *SessionStore) New(r *http.Request, name string) (*sessions.Session, error)
- func (s *SessionStore) Options(options ginsessions.Options)
- func (s *SessionStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
Constants ¶
View Source
const COOKIE_NAME = "happydomain_session"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SessionStore ¶
type SessionStore struct {
Codecs []securecookie.Codec
// contains filtered or unexported fields
}
SessionStore is an implementation of Gorilla Sessions, using happyDomain storage.
func NewSessionStore ¶
func NewSessionStore(opts *happydns.Options, storage sessionUC.SessionStorage, keyPairs ...[]byte) *SessionStore
func (*SessionStore) Get ¶
Get Fetches a session for a given name after it has been added to the registry.
func (*SessionStore) MaxAge ¶
func (s *SessionStore) 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 (*SessionStore) New ¶
New returns a new session for the given name without adding it to the registry.
func (*SessionStore) Options ¶
func (s *SessionStore) Options(options ginsessions.Options)
func (*SessionStore) Save ¶
func (s *SessionStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
Save saves the given session into the database and deletes cookies if needed.
Source Files
¶
- sessions.go
Click to show internal directories.
Click to hide internal directories.