memory

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FromMemory

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

session来自内存 实现

func NewFromMemory added in v0.1.1

func NewFromMemory() *FromMemory

新建内存容器

func (*FromMemory) LoadFile added in v0.1.1

func (fm *FromMemory) LoadFile(file string) error

从文件中加载缓存数据项

func (*FromMemory) SaveToFile added in v0.1.1

func (fm *FromMemory) SaveToFile(file string) error

保存数据项到文件中

func (*FromMemory) SessionDestroy

func (frommemory *FromMemory) SessionDestroy(sid string) error

func (*FromMemory) SessionGC

func (frommemory *FromMemory) SessionGC(maxLifeTime int64)

func (*FromMemory) SessionInit

func (frommemory *FromMemory) SessionInit(sid string) (SessionStore, error)

func (*FromMemory) SessionRead

func (frommemory *FromMemory) SessionRead(sid string) (SessionStore, error)

func (*FromMemory) SessionUpdate

func (frommemory *FromMemory) SessionUpdate(sid string) error

type SessionStore

type SessionStore struct {
	LastAccessedTime time.Time //最后访问时间
	// contains filtered or unexported fields
}

session实现

func (*SessionStore) Clear

func (st *SessionStore) Clear() error

清空Session

func (*SessionStore) Delete

func (st *SessionStore) Delete(key interface{}) error

删除

func (*SessionStore) Get

func (st *SessionStore) Get(key interface{}) interface{}

获取session

func (*SessionStore) GetAll

func (st *SessionStore) GetAll() interface{}

获取全部数据

func (*SessionStore) SessionID

func (st *SessionStore) SessionID() string

获取session'Id

func (*SessionStore) Set

func (st *SessionStore) Set(key, value interface{}) error

设置

Jump to

Keyboard shortcuts

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