Documentation ¶
Index ¶
- Constants
- Variables
- func AppContextCurrentPath(ctx context.Context) []string
- func AppContextCurrentRoot(ctx context.Context) []string
- func AppContextHostId(ctx context.Context) string
- func AppContextLang(ctx context.Context) string
- func AppContextMetadata(ctx context.Context) map[string]interface{}
- func AppContextObjectID(ctx context.Context) string
- func AppContextObjectType(ctx context.Context) string
- func AppContextParams(ctx context.Context) map[string]string
- func AppContextRequestId(ctx context.Context) string
- func AppContextServiceName(ctx context.Context) string
- func AppContextStartTime(ctx context.Context) time.Time
- func AppContextTaskId(ctx context.Context) string
- func AppContextTaskNotifyUrl(ctx context.Context) string
- func AppContextTrace(ctx context.Context) *trace.STrace
- type AppContextData
- type AppContextKey
Constants ¶
View Source
const ( APP_CONTEXT_KEY_DB = AppContextKey("db") APP_CONTEXT_KEY_CACHE = AppContextKey("cache") APP_CONTEXT_KEY_APPNAME = AppContextKey("appname") APP_CONTEXT_KEY_APP = AppContextKey("application") APP_CONTEXT_KEY_CUR_PATH = AppContextKey("currentpath") APP_CONTEXT_KEY_CUR_ROOT = AppContextKey("currentroot") APP_CONTEXT_KEY_PARAMS = AppContextKey("parameters") APP_CONTEXT_KEY_METADATA = AppContextKey("metadata") APP_CONTEXT_KEY_TRACE = AppContextKey("trace") APP_CONTEXT_KEY_REQUEST_ID = AppContextKey("requestid") APP_CONTEXT_KEY_TASK_ID = AppContextKey("taskid") APP_CONTEXT_KEY_TASK_NOTIFY_URL = AppContextKey("tasknotifyurl") APP_CONTEXT_KEY_OBJECT_ID = AppContextKey("objectid") APP_CONTEXT_KEY_OBJECT_TYPE = AppContextKey("objecttype") APP_CONTEXT_KEY_START_TIME = AppContextKey("starttime") APP_CONTEXT_KEY_TASKNAME = AppContextKey("taskname") APP_CONTEXT_KEY_HOST_ID = AppContextKey("hostid") APP_CONTEXT_KEY_AUTH_TOKEN = AppContextKey("X_AUTH_TOKEN") )
Variables ¶
View Source
var (
Background context.Context
)
Functions ¶
func AppContextCurrentPath ¶
func AppContextCurrentRoot ¶
func AppContextHostId ¶
func AppContextLang ¶
func AppContextMetadata ¶
func AppContextObjectID ¶
func AppContextObjectType ¶
func AppContextRequestId ¶
func AppContextServiceName ¶
func AppContextTaskId ¶
func AppContextTaskNotifyUrl ¶
Types ¶
type AppContextData ¶
type AppContextData struct { Trace trace.STrace RequestId string ObjectType string ObjectId string TaskId string TaskNotifyUrl string ServiceName string Lang string }
func FetchAppContextData ¶
func FetchAppContextData(ctx context.Context) AppContextData
func (*AppContextData) GetContext ¶
func (self *AppContextData) GetContext() context.Context
func (*AppContextData) IsZero ¶
func (self *AppContextData) IsZero() bool
type AppContextKey ¶
type AppContextKey string
Click to show internal directories.
Click to hide internal directories.