Documentation
¶
Overview ¶
Package middleware defines common http middlewares.
Index ¶
- func PopulateLogger(originalLogger *zap.SugaredLogger) mux.MiddlewareFunc
- func PopulateObservability() mux.MiddlewareFunc
- func PopulateRequestID() mux.MiddlewareFunc
- func ProcessChaff(t *chaff.Tracker) mux.MiddlewareFunc
- func ProcessMaintenance(cfg Maintainable) mux.MiddlewareFunc
- func RequestIDFromContext(ctx context.Context) string
- type Maintainable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PopulateLogger ¶
func PopulateLogger(originalLogger *zap.SugaredLogger) mux.MiddlewareFunc
PopulateLogger populates the logger onto the context.
func PopulateObservability ¶
func PopulateObservability() mux.MiddlewareFunc
PopulateObservability sets common observability context fields.
func PopulateRequestID ¶
func PopulateRequestID() mux.MiddlewareFunc
PopulateRequestID populates the request context with a random UUID if one does not already exist.
func ProcessChaff ¶
func ProcessChaff(t *chaff.Tracker) mux.MiddlewareFunc
ProcessChaff injects the chaff processing middleware.
func ProcessMaintenance ¶
func ProcessMaintenance(cfg Maintainable) mux.MiddlewareFunc
func RequestIDFromContext ¶
RequestIDFromContext pulls the request ID from the context, if one was set. If one was not set, it returns the empty string.
Types ¶
type Maintainable ¶
type Maintainable interface {
MaintenanceMode() bool
}
Maintainable is an interface that determines if the implementer can supply maintenance mode settings.
Click to show internal directories.
Click to hide internal directories.