trackingmiddleware

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: BSD-3-Clause Imports: 4 Imported by: 1

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

type Traceable interface {
	Trace() trace.Trace
}

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.

Jump to

Keyboard shortcuts

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