ctxhelper

package module
v0.0.0-...-e5acbb5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 *zap.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 *zap.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 NewContextStartTime

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

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

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