common

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratedTraceId

func GeneratedTraceId(ctx context.Context) string

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) (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.

Jump to

Keyboard shortcuts

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