correlation

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

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

Go to latest
Published: Mar 23, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithCorrelationID

func ContextWithCorrelationID(parent context.Context, correlationID ...string) context.Context

ContextWithCorrelationID sets correlation ID to context for further use. When no correlation ID is provided, the function generates a new correlation ID.

func GenerateID

func GenerateID() string

GenerateID generates correlation ID

func ID

func ID(ctx context.Context) string

ID returns correlation ID from the context, if found. Otherwise the return value is an empty string.

func SetCorrelationID

func SetCorrelationID(ctx context.Context, r *http.Request)

SetCorrelationID stored in the context in the HTTP request.

func WithCorrelationID

func WithCorrelationID(next http.Handler) http.Handler

WithCorrelationID is an HTTP handler factory function for use in the handlers chain. The handler extracts "Correlation-ID" header from HTTP request and saves it in the request context. If there is no "Correlation-ID" header found in the request, a new correlation ID is generated.

Types

This section is empty.

Jump to

Keyboard shortcuts

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