Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New() endpoint.Middleware
New returns a new endpoint middleware that ensures that the context has a request ID and a trace.
The request and trace packages both check the context before adding the information in the context so this middleware is safe for using with middlewares from the transport layer that may have placed a trace or a request ID in the context.
For the trace to work properly, it's expected that the trace.Setup() functions was called previously.
Types ¶
type Traceable ¶
Traceable is an interface of something that has trace.
This is intentend to be used in places that you don't have a transport middleware to initialize the trace but you have the trace in the request, so you can make the request Traceable and have this middleware extracting the Trace and placing on the cotnext.