Documentation ¶
Index ¶
- Variables
- func ExtractOrCreateRequestId(ctx context.Context, key interface{}) []string
- func ExtractRequestId(ctx context.Context, key interface{}) []string
- func InjectOrCreateRequestId(ctx context.Context, key interface{}, requestId string) context.Context
- func InjectRequestId(ctx context.Context, requestId string) context.Context
- func StreamClientInterceptor(key interface{}, chained bool) grpc.StreamClientInterceptor
- func StreamServerInterceptor(key interface{}, chained bool) grpc.StreamServerInterceptor
- func UnaryClientInterceptor(key interface{}, chained bool) grpc.UnaryClientInterceptor
- func UnaryServerInterceptor(key interface{}, chained bool) grpc.UnaryServerInterceptor
Constants ¶
This section is empty.
Variables ¶
var DefaultXRequestIDKey = "X-Request-ID"
DefaultXRequestIDKey is metadata key name for request ID
Functions ¶
func ExtractOrCreateRequestId ¶ added in v0.0.14
ExtractOrCreateRequestId extracts or create request_id from context by mdIncomingKey and key
func ExtractRequestId ¶ added in v0.0.14
ExtractRequestId extracts request_id from context by mdIncomingKey and key
func InjectOrCreateRequestId ¶ added in v0.0.14
func InjectOrCreateRequestId(ctx context.Context, key interface{}, requestId string) context.Context
InjectOrCreateRequestId injects or create request_id to context by mdIncomingKey and key
func InjectRequestId ¶ added in v0.0.14
InjectRequestId injects request_id to context by mdIncomingKey
func StreamClientInterceptor ¶
func StreamClientInterceptor(key interface{}, chained bool) grpc.StreamClientInterceptor
StreamServerInterceptor returns a new streaming client interceptor with tags in context.
func StreamServerInterceptor ¶
func StreamServerInterceptor(key interface{}, chained bool) grpc.StreamServerInterceptor
StreamServerInterceptor returns a new streaming server interceptor with tags in context. key is RequestID within Context if have chained to chain multiple request ids by generating new request id for each request and concatenating it to original request ids.
func UnaryClientInterceptor ¶
func UnaryClientInterceptor(key interface{}, chained bool) grpc.UnaryClientInterceptor
UnaryClientInterceptor returns a new unary client interceptor with tags in context.
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(key interface{}, chained bool) grpc.UnaryServerInterceptor
UnaryServerInterceptor returns a new unary server interceptors with tags in context. key is RequestID within Context if have chained to chain multiple request ids by generating new request id for each request and concatenating it to original request ids.
Types ¶
This section is empty.