session

package
v0.0.0-...-dddd691 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Key      string        = "zwrwebid"
	Expires  time.Duration = time.Second * 3600 * 24 // 默认一天
	ValueLen int           = 8
)

Functions

func Get

func Get(handler web.IHandler, persistence interface{}) (cache interface{}, exists bool, isFromMemory bool)

1. 当session没有持久化的时候,直接返回内存的对象 2. 当session持久化时,因为不知道目标pointer,需要转换

func Persistence

func Persistence(filePath string)

func Set

func Set(handler web.IHandler, session interface{})

Types

type Session

type Session struct {
	Value   interface{}
	Expires time.Time
	// contains filtered or unexported fields
}

func (*Session) Set

func (this *Session) Set(handler web.IHandler)

Jump to

Keyboard shortcuts

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