session

package
v0.0.0-...-183ed1b Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Request *http.Request

Request 用以获取会话

Response 用以写入会话

Session 当前会话

Store gorilla sessions 的存储库

Functions

func Flush

func Flush()

Flush 删除当前会话

func Forget

func Forget(key string)

Forget 删除某个会话项

func Get

func Get(key string) interface{}

Get 获取会话数据,获取数据时请做类型检测

func Put

func Put(key string, value interface{})

Put 写入键值对应的会话数据

func Save

func Save()

Save 保持会话

func StartSession

func StartSession(w http.ResponseWriter, r *http.Request)

StartSession 初始化会话,在中间件中调用

Types

This section is empty.

Jump to

Keyboard shortcuts

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