Documentation ¶
Index ¶
- type MemProvider
- func (p *MemProvider) Count() int
- func (p *MemProvider) Destory(sid string) error
- func (p *MemProvider) Exist(sid string) bool
- func (p *MemProvider) GC()
- func (p *MemProvider) Init(maxlifetime int64, connStrs string) error
- func (p *MemProvider) Read(sid string) (session.RawStore, error)
- func (p *MemProvider) Regenerate(oldsid, sid string) (session.RawStore, error)
- type MemcacheSessionStore
- func (s *MemcacheSessionStore) Delete(key interface{}) error
- func (s *MemcacheSessionStore) Flush() error
- func (s *MemcacheSessionStore) Get(key interface{}) interface{}
- func (s *MemcacheSessionStore) ID() string
- func (s *MemcacheSessionStore) Release() error
- func (s *MemcacheSessionStore) Set(key, val interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemProvider ¶
type MemProvider struct {
// contains filtered or unexported fields
}
MemProvider represents a memcache session provider implementation.
func (*MemProvider) Count ¶
func (p *MemProvider) Count() int
Count counts and returns number of sessions.
func (*MemProvider) Destory ¶
func (p *MemProvider) Destory(sid string) error
Destory deletes a session by session ID.
func (*MemProvider) Exist ¶
func (p *MemProvider) Exist(sid string) bool
Exist returns true if session with given ID exists.
func (*MemProvider) Init ¶
func (p *MemProvider) Init(maxlifetime int64, connStrs string) error
Init initializes memory session provider. connStrs can be multiple connection strings separate by ; e.g. 127.0.0.1:9090
func (*MemProvider) Read ¶
func (p *MemProvider) Read(sid string) (session.RawStore, error)
Read returns raw session store by session ID.
func (*MemProvider) Regenerate ¶
func (p *MemProvider) Regenerate(oldsid, sid string) (session.RawStore, error)
Regenerate regenerates a session store from old session ID to new one.
type MemcacheSessionStore ¶
type MemcacheSessionStore struct {
// contains filtered or unexported fields
}
MemcacheSessionStore represents a memcache session store implementation.
func (*MemcacheSessionStore) Delete ¶
func (s *MemcacheSessionStore) Delete(key interface{}) error
Delete delete a key from session.
func (*MemcacheSessionStore) Flush ¶
func (s *MemcacheSessionStore) Flush() error
Flush deletes all session data.
func (*MemcacheSessionStore) Get ¶
func (s *MemcacheSessionStore) Get(key interface{}) interface{}
Get gets value by given key in session.
func (*MemcacheSessionStore) ID ¶
func (s *MemcacheSessionStore) ID() string
ID returns current session ID.
func (*MemcacheSessionStore) Release ¶
func (s *MemcacheSessionStore) Release() error
Release releases resource and save data to provider.
func (*MemcacheSessionStore) Set ¶
func (s *MemcacheSessionStore) Set(key, val interface{}) error
Set sets value to given key in session.