session

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2014 License: Apache-2.0 Imports: 6 Imported by: 42

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
}

mysql session provider

func (*MysqlProvider) SessionAll

func (mp *MysqlProvider) SessionAll() int

count values in mysql session

func (*MysqlProvider) SessionDestroy

func (mp *MysqlProvider) SessionDestroy(sid string) error

delete mysql session by sid

func (*MysqlProvider) SessionExist

func (mp *MysqlProvider) SessionExist(sid string) bool

check mysql session exist

func (*MysqlProvider) SessionGC

func (mp *MysqlProvider) SessionGC()

delete expired values in mysql session

func (*MysqlProvider) SessionInit

func (mp *MysqlProvider) SessionInit(maxlifetime int64, savePath string) error

init mysql session. savepath is the connection string of mysql.

func (*MysqlProvider) SessionRead

func (mp *MysqlProvider) SessionRead(sid string) (session.SessionStore, error)

get mysql session by sid

func (*MysqlProvider) SessionRegenerate

func (mp *MysqlProvider) SessionRegenerate(oldsid, sid string) (session.SessionStore, error)

generate new sid for mysql session

type MysqlSessionStore

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

mysql session store

func (*MysqlSessionStore) Delete

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

delete value in mysql session

func (*MysqlSessionStore) Flush

func (st *MysqlSessionStore) Flush() error

clear all values in mysql session

func (*MysqlSessionStore) Get

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

get value from mysql session

func (*MysqlSessionStore) SessionID

func (st *MysqlSessionStore) SessionID() string

get session id of this mysql session store

func (*MysqlSessionStore) SessionRelease

func (st *MysqlSessionStore) SessionRelease(w http.ResponseWriter)

save mysql session values to database. must call this method to save values to database.

func (*MysqlSessionStore) Set

func (st *MysqlSessionStore) Set(key, value interface{}) error

set value in mysql session. it is temp value in map.

Jump to

Keyboard shortcuts

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