Version: v0.0.0-...-1492626 Latest Latest

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

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



package memcache for session provider

depend on

go install

Usage: import(

_ ""


func init() {
	globalSessions, _ = session.NewManager("memcache", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":""}“)
	go globalSessions.GC()

more docs:



This section is empty.


This section is empty.


This section is empty.


type MemProvider

type MemProvider struct {
	// contains filtered or unexported fields

memcahe session provider

func (*MemProvider) SessionAll

func (rp *MemProvider) SessionAll() int


func (*MemProvider) SessionDestroy

func (rp *MemProvider) SessionDestroy(sid string) error

delete memcache session by id

func (*MemProvider) SessionExist

func (rp *MemProvider) SessionExist(sid string) bool

check memcache session exist by sid

func (*MemProvider) SessionGC

func (rp *MemProvider) SessionGC()

Impelment method, no used.

func (*MemProvider) SessionInit

func (rp *MemProvider) SessionInit(maxlifetime int64, savePath string) error

init memcache session savepath like e.g.

func (*MemProvider) SessionRead

func (rp *MemProvider) SessionRead(sid string) (session.SessionStore, error)

read memcache session by sid

func (*MemProvider) SessionRegenerate

func (rp *MemProvider) SessionRegenerate(oldsid, sid string) (session.SessionStore, error)

generate new sid for memcache session

type MemcacheSessionStore

type MemcacheSessionStore struct {
	// contains filtered or unexported fields

memcache session store

func (*MemcacheSessionStore) Delete

func (rs *MemcacheSessionStore) Delete(key interface{}) error

delete value in memcache session

func (*MemcacheSessionStore) Flush

func (rs *MemcacheSessionStore) Flush() error

clear all values in memcache session

func (*MemcacheSessionStore) Get

func (rs *MemcacheSessionStore) Get(key interface{}) interface{}

get value in memcache session

func (*MemcacheSessionStore) SessionID

func (rs *MemcacheSessionStore) SessionID() string

get memcache session id

func (*MemcacheSessionStore) SessionRelease

func (rs *MemcacheSessionStore) SessionRelease(w http.ResponseWriter)

save session values to memcache

func (*MemcacheSessionStore) Set

func (rs *MemcacheSessionStore) Set(key, value interface{}) error

set value in memcache session

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL