redis

package
v0.0.0-...-e3ae77d Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxPoolSize = 100

MaxPoolSize redis max pool size

Functions

This section is empty.

Types

type Provider

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

Provider redis session provider

func (*Provider) Count

func (rp *Provider) Count() int

SessionAll return all activeSession

func (*Provider) Destory

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

Destory delete redis session by id

func (*Provider) Exist

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

Exist check redis session exist by sid

func (*Provider) GC

func (rp *Provider) GC()

GC Impelment method, no used.

func (*Provider) Init

func (rp *Provider) Init(maxLifetime int64, savePath string) error

Init init redis session savepath like redis server addr,pool size,password,dbnum e.g. 127.0.0.1:6379,100,astaxie,0

func (*Provider) Read

func (rp *Provider) Read(sid string) (macross.RawStore, error)

Read read redis session by sid

func (*Provider) Regenerate

func (rp *Provider) Regenerate(oldsid, sid string) (macross.RawStore, error)

Regenerate generate new sid for redis session

type SessionStore

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

SessionStore redis session store

func (*SessionStore) Delete

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

Delete value in redis session

func (*SessionStore) Flush

func (rs *SessionStore) Flush() error

Flush clear all values in redis session

func (*SessionStore) Get

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

Get value in redis session

func (*SessionStore) ID

func (rs *SessionStore) ID() string

SessionID get redis session id

func (*SessionStore) Release

func (rs *SessionStore) Release(ctx *macross.Context) (err error)

SessionRelease save session values to redis

func (*SessionStore) Set

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

Set value in redis session

Jump to

Keyboard shortcuts

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