ledis

package
v0.0.0-...-5c9d632 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: Apache-2.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package ledis provide session Provider

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider ledis session provider

func (*Provider) SessionAll

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

SessionAll return all active session

func (*Provider) SessionDestroy

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

SessionDestroy delete ledis session by id

func (*Provider) SessionExist

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

SessionExist check ledis session exist by sid

func (*Provider) SessionGC

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

SessionGC Impelment method, no used.

func (*Provider) SessionInit

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. 127.0.0.1:6379,100 v2.x you should pass a json string e.g. { "save_path": "my save path", "db": 100}

func (*Provider) SessionRead

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

SessionRead read ledis session by sid

func (*Provider) SessionRegenerate

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

SessionRegenerate generate new sid for ledis session

type SessionStore

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

SessionStore ledis session store

func (*SessionStore) Delete

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

Delete value in ledis session

func (*SessionStore) Flush

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

Flush clear all values in ledis session

func (*SessionStore) Get

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

Get value in ledis session

func (*SessionStore) SessionID

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

SessionID get ledis session id

func (*SessionStore) SessionRelease

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

SessionRelease save session values to ledis

func (*SessionStore) Set

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

Set value in ledis session

Jump to

Keyboard shortcuts

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