ctxutil

package
v0.13.0-nightly.20241105 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithFilepath added in v0.6.0

func ContextWithFilepath(ctx context.Context, filepath string) context.Context

ContextWithFilepath wraps ctx and returns a context that contains filepath.

func ContextWithMessageID

func ContextWithMessageID(ctx context.Context, messageID string) context.Context

ContextWithMessageID wraps ctx and returns a context that contains message ID.

func ContextWithProcessorID added in v0.11.0

func ContextWithProcessorID(ctx context.Context, processorID string) context.Context

ContextWithProcessorID wraps ctx and returns a context that contains processor ID.

func ContextWithRequestID

func ContextWithRequestID(ctx context.Context, requestID string) context.Context

ContextWithRequestID wraps ctx and returns a context that contains requestID.

func FilepathFromContext added in v0.6.0

func FilepathFromContext(ctx context.Context) string

FilepathFromContext fetches the record filepath from the context. If the context does not contain a filepath it returns nil.

func MessageIDFromContext

func MessageIDFromContext(ctx context.Context) string

MessageIDFromContext fetches the record message ID from the context. If the context does not contain a message ID it returns nil.

func ProcessorIDFromContext added in v0.11.0

func ProcessorIDFromContext(ctx context.Context) string

ProcessorIDFromContext fetches the record processor ID from the context. If the context does not contain a processor ID it returns nil.

func RequestIDFromContext

func RequestIDFromContext(ctx context.Context) string

RequestIDFromContext fetches the request ID from the context. If the context does not contain a request ID 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.

func (FilepathLogCtxHook) Run added in v0.6.0

Run executes the log hook.

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.

func (MessageIDLogCtxHook) Run

Run executes the log hook.

type ProcessorIDLogCtxHook added in v0.11.0

type ProcessorIDLogCtxHook struct{}

ProcessorIDLogCtxHook fetches the record processor ID from the context and if it exists it adds the processorID to the log output.

func (ProcessorIDLogCtxHook) Run added in v0.11.0

Run executes the log hook.

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.

func (RequestIDLogCtxHook) Run

Run executes the log hook.

Jump to

Keyboard shortcuts

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