Documentation ¶
Index ¶
- Variables
- func Copy(source context.Context, target *context.Context) error
- func EchoMiddleware() echo.MiddlewareFunc
- func Get(ctx context.Context) (requestID string, err error)
- func RestyMiddleware(c *resty.Client, r *resty.Request) error
- func Set(ctx context.Context, requestID string) context.Context
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is the error when the context does not contain a reqestID. ErrNotFound = errors.New("context does not contain a requestID") // ErrWrongType is the error when the value in the context has the wrong type. ErrWrongType = errors.New("value is not of type string") )
Functions ¶
func Copy ¶ added in v0.4.0
Copy gets the requestID from the source context, and copies it over to the target context.
func EchoMiddleware ¶
func EchoMiddleware() echo.MiddlewareFunc
EchoMiddleware puts the requestID into the context value.
func Get ¶
Get returns the stored value of the requestIDKey if no value is present (ErrNotFound) or for some reason the value is not a string (ErrWrongType) an error is returned.
func RestyMiddleware ¶
RestyMiddleware gets the requestID from the context and puts it into the header.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.