Documentation ¶
Index ¶
- func GenerateRequestID() string
- func PropagateIfExists(source, target context.Context) context.Context
- func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor
- func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor
- func UnaryClientInterceptor(opts ...Option) grpc.UnaryClientInterceptor
- func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor
- type IDGenerator
- type Option
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
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 ¶
GenerateIfMissing will instruct the middleware to create a request ID if one isn't already on the incoming request.
default: false