session

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSessionWithStore

func NewSessionWithStore(store store.ISessionStore) context.ISessionManager

NewSessionWithStore ctor for session manager , must be used to session.UseSession ,that add dependents to IOC.

func UseSession

func UseSession(sc *dependencyinjection.ServiceCollection, opFunc func(options *Options))

Types

type Manager

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

ISessionManager session manager

func (*Manager) Clear

func (mgr *Manager) Clear(provider interface{})

Clear clear session

func (*Manager) GC

func (mgr *Manager) GC()

GC clear the session list

func (*Manager) GetIDList

func (mgr *Manager) GetIDList() []string

GetIDList get all session id to array

func (*Manager) GetValue

func (mgr *Manager) GetValue(sessionID string, key string) (interface{}, bool)

GetValue get session value for the key

func (*Manager) Load

func (mgr *Manager) Load(provider interface{}) string

Load init and restore session information to the session store

func (*Manager) NewSession

func (mgr *Manager) NewSession(sessionId string) string

func (*Manager) Remove

func (mgr *Manager) Remove(sessionId string)

Remove remove session store by id

func (*Manager) SetValue

func (mgr *Manager) SetValue(sessionID string, key string, value interface{})

SetValue set session value for the key/value

type Options

type Options struct {
	MaxLifeTime int64
	// contains filtered or unexported fields
}

func (*Options) AddSessionIdentity

func (op *Options) AddSessionIdentity(provider identity.IProvider)

func (*Options) AddSessionIdentityFactory

func (op *Options) AddSessionIdentityFactory(identityFactoryCtor interface{})

func (*Options) AddSessionMemoryStore

func (op *Options) AddSessionMemoryStore(storer store.ISessionStore)

func (*Options) AddSessionStoreFactory

func (op *Options) AddSessionStoreFactory(storeFactoryCtor interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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