x_request_id

package
v0.0.119 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultXRequestIDKey = "X-Request-ID"

DefaultXRequestIDKey is metadata key name for request ID

Functions

func ExtractOrCreateRequestId added in v0.0.14

func ExtractOrCreateRequestId(ctx context.Context, key interface{}) []string

ExtractOrCreateRequestId extracts or create request_id from context by mdIncomingKey and key

func ExtractRequestId added in v0.0.14

func ExtractRequestId(ctx context.Context, key interface{}) []string

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

func InjectRequestId(ctx context.Context, requestId string) context.Context

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.

Jump to

Keyboard shortcuts

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