session

package
v2.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2015 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

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