Documentation ¶
Overview ¶
Package session provide an interface to handle web application session.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface { SetCookieName(name string) CookieName() string SetExpiration(time.Duration) Expiration() time.Duration SetMatchRemoteAddr(match bool) MatchRemoteAddr() bool SetMatchUserAgent(match bool) MatchUserAgent() bool Set(name string, val interface{}) error Get(name string) interface{} GetInt(name string) int GetBool(name string) bool GetString(name string) string Delete(name ...string) error DeleteAll(flash bool) error SetFlash(name string, val interface{}) error GetFlash(name string) interface{} GetFlashInt(name string) int GetFlashBool(name string) bool GetFlashString(name string) string Destroy() error }
Provider is the interface for the session management system
type SessionEntry ¶
type SessionEntry struct { Id string `bson:"_id" datastore:"-"` RemoteAddr string UserAgent string LastActivity time.Time Data map[string]interface{} FlashData map[string]interface{} }
SessionEntry is a piece of infomation you save in database (or mem-cache) to handle sessions n general.
func NewSessionEntry ¶
func NewSessionEntry(addr, agent string) *SessionEntry
NewSessionEntry return a new SessionEntry
Click to show internal directories.
Click to hide internal directories.