requestid

package
v0.0.0-...-04c4af4 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToOutgoingContext

func AppendToOutgoingContext(ctx context.Context) context.Context

AppendToOutgoingContext returns a context with the request-id added to the gRPC metadata.

func FromContext

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

FromContext returns a request ID from gRPC metadata if available in ctx.

func Get

func Get(r *http.Request) string

Get reads the Request-ID and X-Request-ID HTTP header from an `*http.Request` If no header is set, an empty string is returned

func NewMetadata

func NewMetadata(id string) metadata.MD

NewMetadata constructs gRPC metadata with the request ID set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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