ctxhelper

package
v0.9.2-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

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 NewContextRequestID

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

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

func RequestIDFromContext

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

RequestIDFromContext extracts a request ID 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