Documentation ¶
Index ¶
- func ContextWithFilepath(ctx context.Context, filepath string) context.Context
- 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 FilepathFromContext(ctx context.Context) string
- func MessageIDFromContext(ctx context.Context) string
- func RequestIDFromContext(ctx context.Context) string
- func TransactionFromContext(ctx context.Context) database.Transaction
- type FilepathLogCtxHook
- type MessageIDLogCtxHook
- type RequestIDLogCtxHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithFilepath ¶ added in v0.6.0
ContextWithFilepath wraps ctx and returns a context that contains filepath.
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 FilepathFromContext ¶ added in v0.6.0
FilepathFromContext fetches the record filepath from the context. If the context does not contain a filepath it returns nil.
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 FilepathLogCtxHook ¶ added in v0.6.0
type FilepathLogCtxHook struct{}
FilepathLogCtxHook fetches the record filepath from the context and if it exists it adds the filepath to the log output.
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.