Documentation ¶
Index ¶
- func ContextWithoutCancel(ctx context.Context) context.Context
- func Cookies(ctx context.Context) ([]*http.Cookie, bool)
- func FillFromRequest(req *http.Request, destination interface{}) (url.Values, error)
- func GetIPFromContext(ctx context.Context) string
- func Getenv(key string, def string) string
- func NewMonitor(duration int)
- func NewServerHooks() *twirp.ServerHooks
- func SetIPToContext(ctx context.Context, ip string) context.Context
- func WrapAll(h http.Handler) http.Handler
- func WrapWithAPM(h http.Handler) http.Handler
- func WrapWithCookies(base http.Handler) http.Handler
- func WrapWithIP(h http.Handler) http.Handler
- type Error
- type ErrorBody
- type Monitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithoutCancel ¶
ContextWithoutCancel returns a non-cancelable ctx
func FillFromRequest ¶
func GetIPFromContext ¶
GetIPFromContext gets IP value from ctx
func NewMonitor ¶
func NewMonitor(duration int)
func NewServerHooks ¶
func NewServerHooks() *twirp.ServerHooks
NewServerHooks provides an error logging hook with Elastic APM
func SetIPToContext ¶
SetIPToContext sets IP value to ctx
func WrapWithAPM ¶
WrapWithAPM wraps a http.Handler to inject the APM agent
func WrapWithCookies ¶
WrapWithCookies adds the http.Request cookies into context
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.