requestid

package
v1.8.12 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: Apache-2.0 Imports: 8 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 InitRequestID added in v1.5.4

func InitRequestID(ctx context.Context) string

InitRequestID returns the ID to be used to identify the request. If tracing is enabled, returns trace ID, e.g. "1e20da43269fe07e3d2ac018c0aad2d1". Otherwise returns a new UUID, e.g. "38fee7ac-4bfe-4cf6-baa2-8b5ec296b485".

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