context

package
v0.39.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// 时间
	TimestampKey TimestampType = "Timestamp"

	// 地点
	RemoteAddrKey RemoteAddrType = "RemoteAddr"

	// 用户
	UserKey UserKeyType = "UserID"

	// 请求
	RequestKey RequestKeyType = "RequestID"
)

Variables

This section is empty.

Functions

func GetAllValue

func GetAllValue(ctx context.Context) ([]any, error)

GetAllValue 获取ctx里的所有value

func GetRemoteAddrValue

func GetRemoteAddrValue(ctx context.Context) (string, error)

func GetRequestValue

func GetRequestValue(ctx context.Context) (string, error)

func GetTimestampValue

func GetTimestampValue(ctx context.Context) (int64, error)

func GetUserValue

func GetUserValue(ctx context.Context) (int, error)

func GetValue

func GetValue(ctx context.Context, key any) any

GetValue 从标准库ctx读取key对应value

func MustGetRemoteAddrValue

func MustGetRemoteAddrValue(ctx context.Context) string

func MustGetRequestValue

func MustGetRequestValue(ctx context.Context) string

func MustGetTimestampValue

func MustGetTimestampValue(ctx context.Context) int64

func MustGetUserValue

func MustGetUserValue(ctx context.Context) int

Types

type RemoteAddrType

type RemoteAddrType string

时间、地点、人物、事情

type RequestKeyType

type RequestKeyType string

时间、地点、人物、事情

type TimestampType

type TimestampType string

时间、地点、人物、事情

type UserKeyType

type UserKeyType string

时间、地点、人物、事情

Jump to

Keyboard shortcuts

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