Version: v0.0.0-...-cf3502d Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2016 License: Apache-2.0, MIT Imports: 5 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type NodbProvider

type NodbProvider struct {
	// contains filtered or unexported fields

NodbProvider represents a ledis session provider implementation.

func (*NodbProvider) Count

func (p *NodbProvider) Count() int

Count counts and returns number of sessions.

func (*NodbProvider) Destory

func (p *NodbProvider) Destory(sid string) error

Destory deletes a session by session ID.

func (*NodbProvider) Exist

func (p *NodbProvider) Exist(sid string) bool

Exist returns true if session with given ID exists.

func (*NodbProvider) GC

func (p *NodbProvider) GC()

GC calls GC to clean expired sessions.

func (*NodbProvider) Init

func (p *NodbProvider) Init(expire int64, configs string) error

Init initializes nodb session provider.

func (*NodbProvider) Read

func (p *NodbProvider) Read(sid string) (session.RawStore, error)

Read returns raw session store by session ID.

func (*NodbProvider) Regenerate

func (p *NodbProvider) Regenerate(oldsid, sid string) (_ session.RawStore, err error)

Regenerate regenerates a session store from old session ID to new one.

type NodbStore

type NodbStore struct {
	// contains filtered or unexported fields

NodbStore represents a nodb session store implementation.

func NewNodbStore

func NewNodbStore(c *nodb.DB, sid string, expire int64, kv map[interface{}]interface{}) *NodbStore

NewNodbStore creates and returns a ledis session store.

func (*NodbStore) Delete

func (s *NodbStore) Delete(key interface{}) error

Delete delete a key from session.

func (*NodbStore) Flush

func (s *NodbStore) Flush() error

Flush deletes all session data.

func (*NodbStore) Get

func (s *NodbStore) Get(key interface{}) interface{}

Get gets value by given key in session.

func (*NodbStore) ID

func (s *NodbStore) ID() string

ID returns current session ID.

func (*NodbStore) Release

func (s *NodbStore) Release() error

Release releases resource and save data to provider.

func (*NodbStore) Set

func (s *NodbStore) Set(key, val interface{}) error

Set sets value to given key in session.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL