Documentation ¶
Index ¶
- Constants
- func GetDt(ctx context.Context) (dt int32, ok bool)
- func GetGroup(ctx context.Context) string
- func GetGroupWithDefault(ctx context.Context, dv string) string
- func GetIp(ctx context.Context) (ip string, ok bool)
- func GetRegion(ctx context.Context) (region string, ok bool)
- func GetSource(ctx context.Context) (source int32, ok bool)
- func GetUid(ctx context.Context) (uid int64, ok bool)
- func GetUnionId(ctx context.Context) (unionId string, ok bool)
- type ContextController
- type ContextHeader
Constants ¶
View Source
const ( ContextKeyTraceID = "traceID" ContextKeyControl = "Control" ContextKeyHead = "Head" ContextKeyHeadUid = "uid" ContextKeyHeadSource = "source" ContextKeyHeadIp = "ip" ContextKeyHeadRegion = "region" ContextKeyHeadDt = "dt" ContextKeyHeadUnionId = "unionid" )
由于请求的上下文信息的 thrift 定义在 util 项目中,本模块主要为了避免循环依赖
Variables ¶
This section is empty.
Functions ¶
func GetGroupWithDefault ¶ added in v1.3.0
Types ¶
type ContextController ¶ added in v1.2.0
type ContextController interface {
GetGroup() string
}
type ContextHeader ¶
type ContextHeader interface {
ToKV() map[string]interface{}
}
Click to show internal directories.
Click to hide internal directories.