requestid

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

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

func FromContext(ctx context.Context) (reqID string, exists bool)

FromContext returns the Request-Id information from ctx if it exists.

func NewContext

func NewContext(ctx context.Context, reqID string) context.Context

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.

Jump to

Keyboard shortcuts

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