store

package
Version: v1.7.9 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSessionInfo

func NewSessionInfo(sessionId string) *session

Types

type ISessionStore

type ISessionStore interface {
	NewID(id string) string
	GC()
	SetValue(sessionID string, key string, value interface{})
	GetValue(sessionID string, key string) (interface{}, bool)
	GetAllSessionId() []string
	Clear()
	Remove(sessionId string)
	UpdateLastTimeAccessed(sessionId string)
	SetMaxLifeTime(lifetime int64)
}

func NewMemory

func NewMemory() ISessionStore

func NewRedis added in v1.6.3

func NewRedis(client *redisdb.RedisDataSource) ISessionStore

type Memory

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

Memory In-memory session store

func (*Memory) Clear

func (mem *Memory) Clear()

Clear clear session

func (*Memory) GC

func (mem *Memory) GC()

GC session at time

func (*Memory) GetAllSessionId

func (mem *Memory) GetAllSessionId() []string

GetAllSessionId get all session id list

func (*Memory) GetValue

func (mem *Memory) GetValue(sessionID string, key string) (interface{}, bool)

GetValue get session value with client

func (*Memory) NewID

func (mem *Memory) NewID(sessionId string) string

NewID new session id

func (*Memory) Remove

func (mem *Memory) Remove(sessionId string)

Remove remove session by id

func (*Memory) SetMaxLifeTime

func (mem *Memory) SetMaxLifeTime(lifetime int64)

func (*Memory) SetValue

func (mem *Memory) SetValue(sessionID string, key string, value interface{})

SetValue set session value with client

func (*Memory) UpdateLastTimeAccessed

func (mem *Memory) UpdateLastTimeAccessed(sessionId string)

type Redis added in v1.6.3

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

func (*Redis) Clear added in v1.6.3

func (r *Redis) Clear()

func (*Redis) GC added in v1.6.3

func (r *Redis) GC()

func (*Redis) GetAllSessionId added in v1.6.3

func (r *Redis) GetAllSessionId() []string

func (*Redis) GetValue added in v1.6.3

func (r *Redis) GetValue(sessionID string, key string) (interface{}, bool)

func (*Redis) NewID added in v1.6.3

func (r *Redis) NewID(id string) string

func (*Redis) Remove added in v1.6.3

func (r *Redis) Remove(sessionId string)

func (*Redis) SetMaxLifeTime added in v1.6.3

func (r *Redis) SetMaxLifeTime(lifetime int64)

func (*Redis) SetValue added in v1.6.3

func (r *Redis) SetValue(sessionID string, key string, value interface{})

func (*Redis) UpdateLastTimeAccessed added in v1.6.3

func (r *Redis) UpdateLastTimeAccessed(sessionId string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL