Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultRequestIDKey = "Request-Id"
DefaultRequestIDKey is the metadata key name for request ID
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext returns the Request-Id information from ctx if it exists.
func NewContext ¶
NewContext creates a new context with Request-Id attached if not exists.
func UnaryServerInterceptor ¶
func UnaryServerInterceptor() grpc.UnaryServerInterceptor
UnaryServerInterceptor returns grpc.UnaryServerInterceptor that should be used as a middleware to generate/include Request-Id in headers and context for tracing and tracking user's request.
Returned middleware populates Request-Id from gRPC metadata if they defined in a testRequest message else creates a new one.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.