ctxhelper

package
v0.0.0-...-c283e9f Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2021 License: BSD-3-Clause Imports: 4 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComponentNameFromContext

func ComponentNameFromContext(ctx context.Context) (componentName string, ok bool)

ComponentNameFromContext extracts a component name from a context.

func LoggerFromContext

func LoggerFromContext(ctx context.Context) (logger log.Logger, ok bool)

LoggerFromContext extracts a logger from a context.

func NewContextComponentName

func NewContextComponentName(ctx context.Context, componentName string) context.Context

NewContextComponentName creates a new context that carries the provided componentName value.

func NewContextLogger

func NewContextLogger(ctx context.Context, logger log.Logger) context.Context

NewContextLogger creates a new context that carries the provided logger value.

func NewContextParams

func NewContextParams(ctx context.Context, params httprouter.Params) context.Context

NewContextParams creates a new context that carries the provided params value.

func NewContextRequestID

func NewContextRequestID(ctx context.Context, id string) context.Context

NewContextRequestID creates a new context that carries the provided request ID value.

func NewContextStartTime

func NewContextStartTime(ctx context.Context, start time.Time) context.Context

NewContextStartTime creates a new context that carries the provided start time.

func ParamsFromContext

func ParamsFromContext(ctx context.Context) (params httprouter.Params, ok bool)

ParamsFromContext extracts params from a context.

func RequestIDFromContext

func RequestIDFromContext(ctx context.Context) (id string, ok bool)

RequestIDFromContext extracts a request ID from a context.

func StartTimeFromContext

func StartTimeFromContext(ctx context.Context) (start time.Time, ok bool)

StartTimeFromContext extracts a start time from a context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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