Documentation ¶
Index ¶
- func AddTraceID(ctx context.Context, traceId string) context.Context
- func AddUserID(ctx context.Context, userId string) context.Context
- func GenTraceID() string
- func GetContextWithTraceId() context.Context
- func GetIpFromCtx(ctx context.Context) string
- func GetRequestUrlFromCtx(ctx context.Context) string
- func GetTraceIdFromContext(ctx context.Context) string
- func GetUserIdFromContext(ctx context.Context) string
- func InsertAllInfo(ctx context.Context) context.Context
- func InsertRemoteIp(ctx context.Context) context.Context
- func InsertTraceID(ctx context.Context) context.Context
- type TrContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenTraceID ¶
func GenTraceID() string
func GetContextWithTraceId ¶
func GetIpFromCtx ¶ added in v1.17.0
func GetRequestUrlFromCtx ¶ added in v1.20.0
func GetTraceIdFromContext ¶
func GetUserIdFromContext ¶
Types ¶
type TrContext ¶
type TrContext struct { //context.Context TraceId string `json:"traceId,omitempty"` UserId int64 `json:"userId,omitempty"` OpId int64 `json:"opId,omitempty"` RunAs int64 `json:"runAs,omitempty"` Roles string `json:"roles,omitempty"` BizTypes int `json:"bizTypes,omitempty"` GroupId int64 `json:"groupId,omitempty"` Platform string `json:"platform,omitempty"` UserAgent string `json:"userAgent,omitempty"` Lang string `json:"lang,omitempty"` GoId uint64 `json:"goId,omitempty"` Token string `json:"token,omitempty"` RemoteIp string `json:"remoteIp,omitempty"` CompanyId int64 `json:"companyId,omitempty"` Product int `json:"product,omitempty"` Extra map[string]any `json:"extra,omitempty"` }
func (*TrContext) GetExtraValue ¶
func (*TrContext) SetExtraKeyValue ¶
Click to show internal directories.
Click to hide internal directories.