session

package
v3.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2016 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL