Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemcachedProvider ¶
MemcachedProvider stores the session in a memcached server
func (*MemcachedProvider) Delete ¶
func (provider *MemcachedProvider) Delete(id string) error
Delete the session with that id
type Session ¶
type Session struct { // public Data map[string]interface{} ID string // contains filtered or unexported fields }
Session contain the session data
func (*Session) Destroy ¶
func (s *Session) Destroy(w http.ResponseWriter) error
Destroy the session
func (*Session) RenewID ¶
func (s *Session) RenewID(w http.ResponseWriter)
RenewID creates a new session id and saves the session
type SessionProvider ¶
type SessionProvider interface { Save(id string, data map[string]interface{}) error Delete(id string) error Get(id string, data *map[string]interface{}) (bool, error) }
SessionProvider is the one that stores the session somewhere
type SessionStore ¶
type SessionStore struct {
// contains filtered or unexported fields
}
The SessionStore manages the retrieval of a session
func NewCookieBasedSessionStore ¶
func NewCookieBasedSessionStore( provider SessionProvider, cookie string, createWhenMissing bool) *SessionStore
NewCookieBasedSessionStore creates a Cookie based sesion store
func NewHeaderBasedSessionStore ¶
func NewHeaderBasedSessionStore( provider SessionProvider, header string, createWhenMissing bool) *SessionStore
NewHeaderBasedSessionStore create a new SessionStore based with id passed as header values
func (*SessionStore) Get ¶
func (s *SessionStore) Get(r *http.Request, w http.ResponseWriter) (*Session, error)
Get the session for this request
func (*SessionStore) GetByID ¶
func (s *SessionStore) GetByID(id string) (*Session, error)
GetByID returnes the session that corresponds the the ID
func (*SessionStore) New ¶
func (s *SessionStore) New(w http.ResponseWriter) (*Session, error)
New ... creates a session
Click to show internal directories.
Click to hide internal directories.