requestid

package
v1.38.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRequestID added in v1.27.0

func GenerateRequestID() string

GenerateRequestID generates a new request ID.

func PropagateIfExists added in v1.31.0

func PropagateIfExists(source, target context.Context) context.Context

PropagateIfExists copies the request ID from the source context to the target context if it exists. The updated target context is returned.

func StreamClientInterceptor added in v1.31.0

func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor

StreamClientInterceptor returns a new interceptor which handles client requestIDs according to the provided options.

func StreamServerInterceptor

func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor

StreamServerInterceptor returns a new interceptor which handles server request IDs according to the provided options.

func UnaryClientInterceptor added in v1.31.0

func UnaryClientInterceptor(opts ...Option) grpc.UnaryClientInterceptor

UnaryClientInterceptor returns a new interceptor which handles client request IDs according to the provided options.

func UnaryServerInterceptor

func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor

UnaryServerInterceptor returns a new interceptor which handles server request IDs according to the provided options.

Types

type IDGenerator

type IDGenerator func() string

IDGenerator functions are used to generate request IDs if a new one is needed.

type Option

type Option func(*handleRequestID)

Option instances control how the middleware is initialized.

func GenerateIfMissing

func GenerateIfMissing(enable bool) Option

GenerateIfMissing will instruct the middleware to create a request ID if one isn't already on the incoming request.

default: false

Jump to

Keyboard shortcuts

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