meta

package
v4.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MetaKeyCid Metadata 中 cid 的 key
	MetaKeyCid = "x-cid"

	// MetaKeyJwt Metadata 中 jwt 的 key
	MetaKeyJwt = "x-jwt"

	// MetaKeyAppId Metadata 中 APP ID 的 key
	MetaKeyAppId = "x-app-id"
)

Variables

This section is empty.

Functions

func AppIdFromContext

func AppIdFromContext(ctx context.Context) string

AppIdFromContext 从 Context 中获取 APP ID 的值

func CidFromContext

func CidFromContext(ctx context.Context) string

CidFromContext 从 Context 中获取 cid 的值

func ContextWithAppId

func ContextWithAppId(ctx context.Context, appId string) context.Context

ContextWithAppId 向 Context (Metadata) 中存入 APP ID 的值

func ContextWithCid

func ContextWithCid(ctx context.Context, cid string) context.Context

func ContextWithJwt

func ContextWithJwt(ctx context.Context, jwt string) context.Context

ContextWithJwt 向 Context (Metadata) 中存入 jwt 的值

func Delete

func Delete(ctx context.Context, key string) context.Context

func Get

func Get(ctx context.Context, key string) (string, bool)

func JwtFromContext

func JwtFromContext(ctx context.Context) string

JwtFromContext 从 Context 中获取 jwt 的值

func MustGet

func MustGet(ctx context.Context, key string) string

func Set

func Set(ctx context.Context, key, value string) context.Context

func StandardizeKey

func StandardizeKey(key string) string

StandardizeKey 标准化 metadata 中使用的 key

Types

This section is empty.

Jump to

Keyboard shortcuts

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