Documentation ¶
Index ¶
- Constants
- func ConnIdFromContext(ctx context.Context) string
- func CorrelationIdFromContext(ctx context.Context) string
- func NewContextWithConnId(ctx context.Context, connId string) context.Context
- func NewContextWithConnIdCallback(ctx context.Context, callback IdCallbackFunc) context.Context
- func NewContextWithCorrelationId(ctx context.Context, correlationId string) context.Context
- func NewContextWithQueryId(ctx context.Context, queryId string) context.Context
- func NewContextWithQueryIdCallback(ctx context.Context, callback IdCallbackFunc) context.Context
- func QueryIdFromContext(ctx context.Context) string
- type IdCallbackFunc
Constants ¶
View Source
const ( CorrelationIdContextKey contextKey = iota ConnIdContextKey QueryIdContextKey QueryIdCallbackKey ConnIdCallbackKey )
Variables ¶
This section is empty.
Functions ¶
func ConnIdFromContext ¶
ConnIdFromContext retrieves the connectionId stored in context.
func CorrelationIdFromContext ¶
CorrelationIdFromContext retrieves the correlationId stored in context.
func NewContextWithConnId ¶
NewContextWithConnId creates a new context with connectionId value.
func NewContextWithConnIdCallback ¶ added in v1.2.0
func NewContextWithConnIdCallback(ctx context.Context, callback IdCallbackFunc) context.Context
func NewContextWithCorrelationId ¶
NewContextWithCorrelationId creates a new context with correlationId value. Used by Logger to populate field corrId.
func NewContextWithQueryId ¶ added in v1.2.0
NewContextWithQueryId creates a new context with queryId value.
func NewContextWithQueryIdCallback ¶ added in v1.2.0
func NewContextWithQueryIdCallback(ctx context.Context, callback IdCallbackFunc) context.Context
func QueryIdFromContext ¶ added in v1.2.0
QueryIdFromContext retrieves the queryId stored in context.
Types ¶
type IdCallbackFunc ¶ added in v1.2.0
type IdCallbackFunc func(string)
Click to show internal directories.
Click to hide internal directories.