ssdb

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: LGPL-3.0, LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	Host string `json:"host"`
	Port int    `json:"port"`
	// contains filtered or unexported fields
}

Provider holds ssdb client and configs

func (*Provider) SessionAll

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

SessionAll not implemented

func (*Provider) SessionDestroy

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

SessionDestroy destroy the sid

func (*Provider) SessionExist

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

SessionExist judged whether sid is exist in session

func (*Provider) SessionGC

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

SessionGC not implemented

func (*Provider) SessionInit

func (p *Provider) SessionInit(ctx context.Context, maxLifetime int64, cfg string) error

SessionInit init the ssdb with the config

func (*Provider) SessionRead

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

SessionRead return a ssdb client session Store

func (*Provider) SessionRegenerate

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

SessionRegenerate regenerate session with new sid and delete oldsid

type SessionStore

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

SessionStore holds the session information which stored in ssdb

func (*SessionStore) Delete

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

Delete the key in session store

func (*SessionStore) Flush

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

Flush delete all keys and values

func (*SessionStore) Get

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

Get return the value by the key

func (*SessionStore) SessionID

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

SessionID return the sessionID

func (*SessionStore) SessionRelease

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

SessionRelease Store the keyvalues into ssdb

func (*SessionStore) Set

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

Set the key and value

Jump to

Keyboard shortcuts

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