beego: github.com/astaxie/beego/session/redis_cluster Index | Files

package redis_cluster

import "github.com/astaxie/beego/session/redis_cluster"

Package redis for session provider

depend on github.com/go-redis/redis

go install github.com/go-redis/redis

Usage: import(

_ "github.com/astaxie/beego/session/redis_cluster"
"github.com/astaxie/beego/session"

)

func init() {
	globalSessions, _ = session.NewManager("redis_cluster", ``{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:7070;127.0.0.1:7071"}``)
	go globalSessions.GC()
}

more docs: http://beego.me/docs/module/session.md

Index

Package Files

redis_cluster.go

Variables

var MaxPoolSize = 1000

MaxPoolSize redis_cluster max pool size

type Provider Uses

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

Provider redis_cluster session provider

func (*Provider) SessionAll Uses

func (rp *Provider) SessionAll() int

SessionAll return all activeSession

func (*Provider) SessionDestroy Uses

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

SessionDestroy delete redis session by id

func (*Provider) SessionExist Uses

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

SessionExist check redis_cluster session exist by sid

func (*Provider) SessionGC Uses

func (rp *Provider) SessionGC()

SessionGC Impelment method, no used.

func (*Provider) SessionInit Uses

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

SessionInit init redis_cluster session savepath like redis server addr,pool size,password,dbnum e.g. 127.0.0.1:6379;127.0.0.1:6380,100,test,0

func (*Provider) SessionRead Uses

func (rp *Provider) SessionRead(sid string) (session.Store, error)

SessionRead read redis_cluster session by sid

func (*Provider) SessionRegenerate Uses

func (rp *Provider) SessionRegenerate(oldsid, sid string) (session.Store, error)

SessionRegenerate generate new sid for redis_cluster session

type SessionStore Uses

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

SessionStore redis_cluster session store

func (*SessionStore) Delete Uses

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

Delete value in redis_cluster session

func (*SessionStore) Flush Uses

func (rs *SessionStore) Flush() error

Flush clear all values in redis_cluster session

func (*SessionStore) Get Uses

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

Get value in redis_cluster session

func (*SessionStore) SessionID Uses

func (rs *SessionStore) SessionID() string

SessionID get redis_cluster session id

func (*SessionStore) SessionRelease Uses

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

SessionRelease save session values to redis_cluster

func (*SessionStore) Set Uses

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

Set value in redis_cluster session

Package redis_cluster imports 7 packages (graph) and is imported by 1 packages. Updated 2018-07-21. Refresh now. Tools for package owners.