Documentation ¶
Index ¶
- func ClientIpFromRequest(ctx context.Context, listenerCfg *listenerutil.ListenerConfig, r *http.Request) (string, error)
- func GeneratedTraceId(ctx context.Context) string
- func WrapWithEventsHandler(h http.Handler, e *event.Eventer, kms *kms.Kms, ...) (http.Handler, error)
- func WrapWithOptionals(ctx context.Context, with *writerWrapper, wrap http.ResponseWriter) (http.ResponseWriter, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientIpFromRequest ¶ added in v0.7.4
func ClientIpFromRequest(ctx context.Context, listenerCfg *listenerutil.ListenerConfig, r *http.Request) (string, error)
ClientIpFromRequest will determine the client IP of the http request
func GeneratedTraceId ¶
GeneratedTraceId returns a boundary generated TraceId or "" if an error occurs when generating the id.
func WrapWithEventsHandler ¶
func WrapWithEventsHandler(h http.Handler, e *event.Eventer, kms *kms.Kms, listenerCfg *listenerutil.ListenerConfig) (http.Handler, error)
WrapWithEventsHandler will wrap the provided http.Handler with a handler that adds an Eventer to the request context and starts/flushes gated events of type: observation and audit
func WrapWithOptionals ¶
func WrapWithOptionals(ctx context.Context, with *writerWrapper, wrap http.ResponseWriter) (http.ResponseWriter, error)
WrapWithOptionals will test the wrap ResponseWriter and test it for various optional interfaces: http.Flusher, http.Pusher and http.Hijacker. It return an http.ResponseWriter that satisfies those optional interfaces.
See: https://medium.com/@cep21/interface-wrapping-method-erasure-c523b3549912
Types ¶
This section is empty.