Versions in this module Expand all Collapse all v1 v1.0.0 Dec 28, 2015 Changes in this version + const DefaultMaxAge + var RegNodeToGob bool + func GenRandKey(strength int) []byte + type AfterCreatedListener interface + OnAfterCreated func(*Session) + type BeforeReleaseListener interface + OnBeforeRelease func(*Session) + type CookieTransfer struct + Domain string + Lock sync.Mutex + MaxAge time.Duration + Name string + RootPath string + Secure bool + func NewCookieTransfer(name string, maxAge time.Duration, secure bool, rootPath string) *CookieTransfer + func (transfer *CookieTransfer) Clear(rw http.ResponseWriter) + func (transfer *CookieTransfer) Get(req *http.Request) (Id, error) + func (transfer *CookieTransfer) Set(req *http.Request, rw http.ResponseWriter, id Id) + func (transfer *CookieTransfer) SetMaxAge(maxAge time.Duration) + type CookieUrlTransfer struct + func NewCookieUrlTransfer(name string, maxAge time.Duration, secure bool, rootPath string) *CookieUrlTransfer + func (transfer *CookieUrlTransfer) Get(req *http.Request) (Id, error) + type Id string + type IdGenerator interface + Gen func(req *http.Request) Id + IsValid func(id Id) bool + type Manager struct + Path string + func Default() *Manager + func NewManager(store Store, gen IdGenerator, transfer Transfer) *Manager + func (manager *Manager) AddListener(listener interface{}) error + func (manager *Manager) Invalidate(rw http.ResponseWriter, session *Session) + func (manager *Manager) RemoveListener(listener interface{}) error + func (manager *Manager) Run() error + func (manager *Manager) Session(req *http.Request, rw http.ResponseWriter) *Session + func (manager *Manager) SetMaxAge(maxAge time.Duration) + type MemcacheStore struct + Debug bool + func NewMemcacheStore(maxAge time.Duration, conn []string) *MemcacheStore + func (store *MemcacheStore) Add(id Id) + func (store *MemcacheStore) Clear(id Id) bool + func (store *MemcacheStore) Del(id Id, key string) bool + func (store *MemcacheStore) Exist(id Id) bool + func (store *MemcacheStore) Get(id Id, key string) interface{} + func (store *MemcacheStore) Run() error + func (store *MemcacheStore) Set(id Id, key string, value interface{}) + func (store *MemcacheStore) SetMaxAge(maxAge time.Duration) + type MemoryStore struct + GcInterval time.Duration + func NewMemoryStore(maxAge time.Duration) *MemoryStore + func (store *MemoryStore) Add(id Id) + func (store *MemoryStore) Clear(id Id) bool + func (store *MemoryStore) Del(id Id, key string) bool + func (store *MemoryStore) Exist(id Id) bool + func (store *MemoryStore) GC() + func (store *MemoryStore) Get(id Id, key string) interface{} + func (store *MemoryStore) Run() error + func (store *MemoryStore) Set(id Id, key string, value interface{}) + func (store *MemoryStore) SetMaxAge(maxAge time.Duration) + type Session struct + func NewSession(id Id, maxAge time.Duration, manager *Manager) *Session + func (session *Session) Del(key string) bool + func (session *Session) Get(key string) interface{} + func (session *Session) Id() Id + func (session *Session) Invalidate(rw http.ResponseWriter) + func (session *Session) IsValid() bool + func (session *Session) Set(key string, value interface{}) + func (session *Session) SetId(id Id) + func (session *Session) SetMaxAge(maxAge time.Duration) + type Sha1Generator struct + func NewSha1Generator(hashKey string) *Sha1Generator + func (gen *Sha1Generator) Gen(req *http.Request) Id + func (gen *Sha1Generator) IsValid(id Id) bool + type Store interface + Add func(id Id) + Clear func(id Id) bool + Del func(id Id, key string) bool + Exist func(id Id) bool + Get func(id Id, key string) interface{} + Run func() error + Set func(id Id, key string, value interface{}) + SetMaxAge func(maxAge time.Duration) + type Transfer interface + Clear func(rw http.ResponseWriter) + Get func(req *http.Request) (Id, error) + Set func(req *http.Request, rw http.ResponseWriter, id Id) + SetMaxAge func(maxAge time.Duration)