context

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(key string) any

获取协程上下文数据

func GetAll added in v0.1.10

func GetAll() map[string]any

获取全部协程上下文数据

func Remove

func Remove(key string)

移除协程上下文数据

func Set

func Set(key string, value any)

设置协程上下文数据

func SetBatch added in v0.1.10

func SetBatch(values map[string]any)

批量设置协程上下文数据

Types

type Context added in v0.1.15

type Context struct {
	Local routine.ThreadLocal
}

func NewInstance added in v0.1.15

func NewInstance() *Context

func (*Context) Get added in v0.1.15

func (ctx *Context) Get(key string) any

获取协程上下文数据

func (*Context) GetAll added in v0.1.15

func (ctx *Context) GetAll() map[string]any

获取全部协程上下文数据

func (*Context) Remove added in v0.1.15

func (ctx *Context) Remove(key string)

移除协程上下文数据

func (*Context) Set added in v0.1.15

func (ctx *Context) Set(key string, value any)

设置协程上下文数据

func (*Context) SetBatch added in v0.1.15

func (ctx *Context) SetBatch(values map[string]any)

批量设置协程上下文数据

Jump to

Keyboard shortcuts

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