Documentation ¶
Index ¶
- type CouchbaseProvider
- func (p *CouchbaseProvider) Count() int
- func (p *CouchbaseProvider) Destory(sid string) error
- func (p *CouchbaseProvider) Exist(sid string) bool
- func (p *CouchbaseProvider) GC()
- func (p *CouchbaseProvider) Init(maxlifetime int64, connStr string) error
- func (p *CouchbaseProvider) Read(sid string) (session.RawStore, error)
- func (p *CouchbaseProvider) Regenerate(oldsid, sid string) (session.RawStore, error)
- type CouchbaseSessionStore
- func (s *CouchbaseSessionStore) Delete(key interface{}) error
- func (s *CouchbaseSessionStore) Flush() error
- func (s *CouchbaseSessionStore) Get(key interface{}) interface{}
- func (s *CouchbaseSessionStore) ID() string
- func (s *CouchbaseSessionStore) Release() error
- func (s *CouchbaseSessionStore) Set(key, val interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CouchbaseProvider ¶
type CouchbaseProvider struct {
// contains filtered or unexported fields
}
CouchbaseProvider represents a couchbase session provider implementation.
func (*CouchbaseProvider) Count ¶
func (p *CouchbaseProvider) Count() int
Count counts and returns number of sessions.
func (*CouchbaseProvider) Destory ¶
func (p *CouchbaseProvider) Destory(sid string) error
Destory deletes a session by session ID.
func (*CouchbaseProvider) Exist ¶
func (p *CouchbaseProvider) Exist(sid string) bool
Exist returns true if session with given ID exists.
func (*CouchbaseProvider) GC ¶
func (p *CouchbaseProvider) GC()
GC calls GC to clean expired sessions.
func (*CouchbaseProvider) Init ¶
func (p *CouchbaseProvider) Init(maxlifetime int64, connStr string) error
Init initializes memory session provider. connStr is couchbase server REST/JSON URL e.g. http://host:port/, Pool, Bucket
func (*CouchbaseProvider) Read ¶
func (p *CouchbaseProvider) Read(sid string) (session.RawStore, error)
Read returns raw session store by session ID.
func (*CouchbaseProvider) Regenerate ¶
func (p *CouchbaseProvider) Regenerate(oldsid, sid string) (session.RawStore, error)
Regenerate regenerates a session store from old session ID to new one.
type CouchbaseSessionStore ¶
type CouchbaseSessionStore struct {
// contains filtered or unexported fields
}
CouchbaseSessionStore represents a couchbase session store implementation.
func (*CouchbaseSessionStore) Delete ¶
func (s *CouchbaseSessionStore) Delete(key interface{}) error
Delete delete a key from session.
func (*CouchbaseSessionStore) Flush ¶
func (s *CouchbaseSessionStore) Flush() error
Flush deletes all session data.
func (*CouchbaseSessionStore) Get ¶
func (s *CouchbaseSessionStore) Get(key interface{}) interface{}
Get gets value by given key in session.
func (*CouchbaseSessionStore) ID ¶
func (s *CouchbaseSessionStore) ID() string
ID returns current session ID.
func (*CouchbaseSessionStore) Release ¶
func (s *CouchbaseSessionStore) Release() error
Release releases resource and save data to provider.
func (*CouchbaseSessionStore) Set ¶
func (s *CouchbaseSessionStore) Set(key, val interface{}) error
Set sets value to given key in session.