requestid

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package requestid contains middleware to inject and manage request id context.

Index

Constants

View Source
const (

	// RequestIDHeader defines the HTTP header that is set in each HTTP response
	// for a given request. The value of the header is unique per request.
	RequestIDHeader = "X-Request-Id"
)

Variables

This section is empty.

Functions

func FromContext

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

FromContext extracts the request-id from the context, if it exists.

func NewStreamingInterceptor

func NewStreamingInterceptor() grpc.StreamServerInterceptor

NewStreamingInterceptor creates a grpc.StreamServerInterceptor which must come after the trace interceptor and before the logging interceptor.

func NewUnaryInterceptor

func NewUnaryInterceptor() grpc.UnaryServerInterceptor

NewUnaryInterceptor creates a grpc.UnaryServerInterceptor which must come after the trace interceptor and before the logging interceptor.

Types

This section is empty.

Jump to

Keyboard shortcuts

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