Documentation ¶
Index ¶
- Constants
- func AppIdFromContext(ctx context.Context) string
- func CidFromContext(ctx context.Context) string
- func ContextWithAppId(ctx context.Context, appId string) context.Context
- func ContextWithCid(ctx context.Context, cid string) context.Context
- func ContextWithJwt(ctx context.Context, jwt string) context.Context
- func Delete(ctx context.Context, key string) context.Context
- func Get(ctx context.Context, key string) (string, bool)
- func JwtFromContext(ctx context.Context) string
- func MustGet(ctx context.Context, key string) string
- func Set(ctx context.Context, key, value string) context.Context
- func StandardizeKey(key string) string
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 ¶
AppIdFromContext 从 Context 中获取 APP ID 的值
func CidFromContext ¶
CidFromContext 从 Context 中获取 cid 的值
func ContextWithAppId ¶
ContextWithAppId 向 Context (Metadata) 中存入 APP ID 的值
func ContextWithJwt ¶
ContextWithJwt 向 Context (Metadata) 中存入 jwt 的值
func JwtFromContext ¶
JwtFromContext 从 Context 中获取 jwt 的值
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.