beego: Index | Files

package ledis

import ""

Package ledis provide session Provider


Package Files


type Provider Uses

type Provider struct {
    SavePath string `json:"save_path"`
    Db       int    `json:"db"`
    // contains filtered or unexported fields

Provider ledis session provider

func (*Provider) SessionAll Uses

func (lp *Provider) SessionAll(context.Context) int

SessionAll return all active session

func (*Provider) SessionDestroy Uses

func (lp *Provider) SessionDestroy(ctx context.Context, sid string) error

SessionDestroy delete ledis session by id

func (*Provider) SessionExist Uses

func (lp *Provider) SessionExist(ctx context.Context, sid string) (bool, error)

SessionExist check ledis session exist by sid

func (*Provider) SessionGC Uses

func (lp *Provider) SessionGC(context.Context)

SessionGC Impelment method, no used.

func (*Provider) SessionInit Uses

func (lp *Provider) SessionInit(ctx context.Context, maxlifetime int64, cfgStr string) error

SessionInit init ledis session savepath like ledis server saveDataPath,pool size v1.x e.g.,100 v2.x you should pass a json string e.g. { "save_path": "my save path", "db": 100}

func (*Provider) SessionRead Uses

func (lp *Provider) SessionRead(ctx context.Context, sid string) (session.Store, error)

SessionRead read ledis session by sid

func (*Provider) SessionRegenerate Uses

func (lp *Provider) SessionRegenerate(ctx context.Context, oldsid, sid string) (session.Store, error)

SessionRegenerate generate new sid for ledis session

type SessionStore Uses

type SessionStore struct {
    // contains filtered or unexported fields

SessionStore ledis session store

func (*SessionStore) Delete Uses

func (ls *SessionStore) Delete(ctx context.Context, key interface{}) error

Delete value in ledis session

func (*SessionStore) Flush Uses

func (ls *SessionStore) Flush(context.Context) error

Flush clear all values in ledis session

func (*SessionStore) Get Uses

func (ls *SessionStore) Get(ctx context.Context, key interface{}) interface{}

Get value in ledis session

func (*SessionStore) SessionID Uses

func (ls *SessionStore) SessionID(context.Context) string

SessionID get ledis session id

func (*SessionStore) SessionRelease Uses

func (ls *SessionStore) SessionRelease(ctx context.Context, w http.ResponseWriter)

SessionRelease save session values to ledis

func (*SessionStore) Set Uses

func (ls *SessionStore) Set(ctx context.Context, key, value interface{}) error

Set value in ledis session

Package ledis imports 9 packages (graph) and is imported by 1 packages. Updated 2020-11-07. Refresh now. Tools for package owners.