Skip to content

Latest commit

 

History

History

xrequestid

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

X-Request-ID

This package provides a functional for requests tagging with a unique ID. Here is a few examples of usage:

gRPC

server := grpc.NewServer(
    grpc.InTapHandle(xrequestid.New().InTapHandler),
)

if you don't want to use InTapHandle you can use UnaryInterceptor:

server := grpc.NewServer(
    grpc.UnaryInterceptor(xrequestid.New().UnaryInterceptor),
) 

HTTP

server := &http.Server{
    Handler: xrequestid.New().PopulateHTTP(http.DefaultServeMux),
}