Documentation
¶
Index ¶
- Constants
- func ClearGorilla(inner endpoint.Endpoint) endpoint.Endpoint
- func GetID(ctx context.Context) string
- func GetRequestID(r *http.Request) string
- func HTTPRequest(ctx context.Context) *http.Request
- func New(r *http.Request) context.Context
- func NewEmpty() context.Context
- func UseGorilla(parent context.Context, r *http.Request) context.Context
- func UseID(parent context.Context, r *http.Request) context.Context
- func WithGorilla(parent context.Context, r *http.Request) context.Context
- func WithHTTPRequest(parent context.Context, r *http.Request) context.Context
- func WithID(parent context.Context, id string) context.Context
Constants ¶
View Source
const IDHeaderKey = "X-Request-ID"
IDHeaderKey is the string key used to store context ID in HTTP header
Variables ¶
This section is empty.
Functions ¶
func ClearGorilla ¶
ClearGorilla implements go-kit endpoint.Middleware that removes all values stored for a given request. Works like ClearHandler provided by gorilla
func GetRequestID ¶
GetRequestID get string id from http request
func HTTPRequest ¶
HTTPRequest returns the *http.Request associated with ctx using NewContext, if any.
func UseGorilla ¶
UseGorilla implements go-kit http transport RequestFunc
func WithGorilla ¶
WithGorilla wraps a given context.Context with our wrapper context. It also runs WithHTTPRequest inside.
func WithHTTPRequest ¶
WithHTTPRequest adds the current HTTP Request to context.Context
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.