Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IncomingRequestID ¶
func OutgoingRequestID ¶
Types ¶
type RequestIDMiddleware ¶
type RequestIDMiddleware struct{}
func NewRequestIDMiddleware ¶
func NewRequestIDMiddleware() *RequestIDMiddleware
func (*RequestIDMiddleware) Stream ¶
func (m *RequestIDMiddleware) Stream() grpc.StreamServerInterceptor
Stream returns a new stream server interceptor that creates a request ID and sets it on the context. If the request already contains a proper request ID, it will be persisted, and a new request ID will be appended to it, separated by a dot '.'. In order to chain request IDs (when calling other services), the caller can extract the ID from the context, or use metadata.AppendToOutgoingContext with the context available in GRPC handlers.
func (*RequestIDMiddleware) StreamClient ¶
func (m *RequestIDMiddleware) StreamClient() grpc.StreamClientInterceptor
StreamClient returns a new stream client interceptor that forwards request IDs to the outgoing context. If the context doesn't contain a request ID, no ID is added to the outgoing context.
func (*RequestIDMiddleware) Unary ¶
func (m *RequestIDMiddleware) Unary() grpc.UnaryServerInterceptor
Unary returns a new unary server interceptor that creates a request ID and sets it on the context. If the request already contains a proper request ID, it will be persisted, and a new request ID will be appended to it, separated by a dot '.'. In order to chain request IDs (when calling other services), the caller can extract the ID from the context, or use metadata.AppendToOutgoingContext with the context available in GRPC handlers.
func (*RequestIDMiddleware) UnaryClient ¶
func (m *RequestIDMiddleware) UnaryClient() grpc.UnaryClientInterceptor
UnaryClient returns a new unary client interceptor that forwards request IDs to the outgoing context. If the context doesn't contain a request ID, no ID is added to the outgoing context.