Documentation ¶
Index ¶
- func ContextWithMessageID(ctx context.Context, messageID string) context.Context
- func ContextWithRequestID(ctx context.Context, requestID string) context.Context
- func ContextWithTransaction(ctx context.Context, transaction database.Transaction) context.Context
- func MessageIDFromContext(ctx context.Context) string
- func RequestIDFromContext(ctx context.Context) string
- func TransactionFromContext(ctx context.Context) database.Transaction
- type MessageIDLogCtxHook
- type RequestIDLogCtxHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithMessageID ¶
ContextWithMessageID wraps ctx and returns a context that contains message ID.
func ContextWithRequestID ¶
ContextWithRequestID wraps ctx and returns a context that contains requestID.
func ContextWithTransaction ¶
ContextWithTransaction wraps ctx and returns a context that contains transaction.
func MessageIDFromContext ¶
MessageIDFromContext fetches the record message ID from the context. If the context does not contain a message ID it returns nil.
func RequestIDFromContext ¶
RequestIDFromContext fetches the request ID from the context. If the context does not contain a request ID it returns nil.
func TransactionFromContext ¶
func TransactionFromContext(ctx context.Context) database.Transaction
TransactionFromContext fetches the transaction from the context. If the context does not contain a transaction it returns nil.
Types ¶
type MessageIDLogCtxHook ¶
type MessageIDLogCtxHook struct{}
MessageIDLogCtxHook fetches the record message ID from the context and if it exists it adds the messageID to the log output.
type RequestIDLogCtxHook ¶
type RequestIDLogCtxHook struct{}
RequestIDLogCtxHook fetches the request ID from the context and if it exists it adds the request ID to the log output.