appctx

package
v0.3.10-0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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 AppContextCurrentPath(ctx context.Context) []string

func AppContextCurrentRoot

func AppContextCurrentRoot(ctx context.Context) []string

func AppContextHostId

func AppContextHostId(ctx context.Context) string

func AppContextLang

func AppContextLang(ctx context.Context) string

func AppContextMetadata

func AppContextMetadata(ctx context.Context) map[string]interface{}

func AppContextObjectID

func AppContextObjectID(ctx context.Context) string

func AppContextObjectType

func AppContextObjectType(ctx context.Context) string

func AppContextParams

func AppContextParams(ctx context.Context) map[string]string

func AppContextRequestId

func AppContextRequestId(ctx context.Context) string

func AppContextServiceName

func AppContextServiceName(ctx context.Context) string

func AppContextStartTime

func AppContextStartTime(ctx context.Context) time.Time

func AppContextTaskId

func AppContextTaskId(ctx context.Context) string

func AppContextTaskNotifyUrl

func AppContextTaskNotifyUrl(ctx context.Context) string

func AppContextTrace

func AppContextTrace(ctx context.Context) *trace.STrace

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

Jump to

Keyboard shortcuts

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