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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MysqlProvider

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

MysqlProvider represents a mysql session provider implementation.

func (*MysqlProvider) Count

func (p *MysqlProvider) Count() int

Count counts and returns number of sessions.

func (*MysqlProvider) Destory

func (p *MysqlProvider) Destory(sid string) (err error)

Destory deletes a session by session ID.

func (*MysqlProvider) Exist

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

Exist returns true if session with given ID exists.

func (*MysqlProvider) GC

func (mp *MysqlProvider) GC()

GC calls GC to clean expired sessions.

func (*MysqlProvider) Init

func (p *MysqlProvider) Init(maxlifetime int64, connStr string) error

Init initializes memory session provider.

func (*MysqlProvider) Read

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

Read returns raw session store by session ID.

func (*MysqlProvider) Regenerate

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

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

type MysqlSessionStore

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

MysqlSessionStore represents a mysql session store implementation.

func (*MysqlSessionStore) Delete

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

Delete delete a key from session.

func (*MysqlSessionStore) Flush

func (s *MysqlSessionStore) Flush() error

Flush deletes all session data.

func (*MysqlSessionStore) Get

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

Get gets value by given key in session.

func (*MysqlSessionStore) ID

func (s *MysqlSessionStore) ID() string

ID returns current session ID.

func (*MysqlSessionStore) Release

func (s *MysqlSessionStore) Release() error

Release releases resource and save data to provider.

func (*MysqlSessionStore) Set

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