session

package
v2.0.0-beta1+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 30, 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 LedisProvider

type LedisProvider struct {
	// contains filtered or unexported fields
}

LedisProvider represents a ledis session provider implementation.

func (*LedisProvider) Count

func (p *LedisProvider) Count() int

Count counts and returns number of sessions.

func (*LedisProvider) Destory

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

Destory deletes a session by session ID.

func (*LedisProvider) Exist

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

Exist returns true if session with given ID exists.

func (*LedisProvider) GC

func (p *LedisProvider) GC()

GC calls GC to clean expired sessions.

func (*LedisProvider) Init

func (p *LedisProvider) Init(maxlifetime int64, savePath string) error

Init initializes memory session provider.

func (*LedisProvider) Read

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

Read returns raw session store by session ID.

func (*LedisProvider) Regenerate

func (p *LedisProvider) Regenerate(oldsid, sid string) (session.RawStore, error)

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

type LedisSessionStore

type LedisSessionStore struct {
	// contains filtered or unexported fields
}

LedisSessionStore represents a ledis session store implementation.

func (*LedisSessionStore) Delete

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

Delete delete a key from session.

func (*LedisSessionStore) Flush

func (s *LedisSessionStore) Flush() error

Flush deletes all session data.

func (*LedisSessionStore) Get

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

Get gets value by given key in session.

func (*LedisSessionStore) ID

func (s *LedisSessionStore) ID() string

ID returns current session ID.

func (*LedisSessionStore) Release

func (s *LedisSessionStore) Release() error

Release releases resource and save data to provider.

func (*LedisSessionStore) Set

func (s *LedisSessionStore) 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