cbcontext

package
v0.0.0-...-9235d7d Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureError

func CaptureError(ctx context.Context, err error)

CaptureError takes an error and captures the details about it and sends it off to Sentry, if Sentry has been set up.

func FromRequestID

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

FromRequestID generates a new context with the given context as its parent, and stores the given ID with the context. The ID can be retrieved again using RequestIDFromContext. If this is the beginning of the request, it is inherited from the X-Request-ID from Heroku.

func LoggerFromContext

func LoggerFromContext(ctx context.Context) *logrus.Entry

LoggerFromContext returns a logrus.Entry with the PID of the current process set as a field, and also includes every field set using the From* functions this package.

func RequestIDFromContext

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

RequestIDFromContext returns the Request ID stored in the context with FromRequestID. If no RequestID is stored in the context, the second argument is false. Otherwise it is true.

Types

This section is empty.

Jump to

Keyboard shortcuts

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