package
0.0.0-20190821092711-97de089901e6
Repository: https://github.com/sandlis/weaveworks-common.git
Documentation: pkg.go.dev

# Functions

ClientUserHeaderInterceptor propagates the user ID from the context to gRPC metadata, which eventually ends up as a HTTP2 header.
ExtractTraceID extracts the trace id, if any from the context.
IsWSHandshakeRequest returns true if the given request is a websocket handshake request.
MakeLabelValue converts a Gorilla mux path to a string suitable for use in a Prometheus label value.
Merge produces a middleware that applies multiple middlesware in turn; ie Merge(f,g,h).Wrap(handler) == f.Wrap(g.Wrap(h.Wrap(handler))).
PathReplace replcase Request.RequestURI with the specified string.
PathRewrite supports regex matching and replace on Request URIs.
ServerUserHeaderInterceptor propagates the user ID from the gRPC metadata back to our context.
StreamClientUserHeaderInterceptor propagates the user ID from the context to gRPC metadata, which eventually ends up as a HTTP2 header.
StreamServerInstrumentInterceptor instruments gRPC requests for errors and latency.
StreamServerUserHeaderInterceptor propagates the user ID from the gRPC metadata back to our context.
UnaryServerInstrumentInterceptor instruments gRPC requests for errors and latency.

# Variables

AuthenticateUser propagates the user ID from HTTP headers back to the request's context.
Identity is an Interface which doesn't do anything.
Logging middleware logs each HTTP request method, path, response code and duration for all HTTP requests.

# Structs

ErrorHandler lets you call an alternate http handler upon a certain response code.
GRPCServerLog logs grpc requests, errors, and latency.
HeaderAdder adds headers to responses.
Instrument is a Middleware which records timings for every HTTP request.
Log middleware logs http requests.
Tracer is a middleware which traces incoming requests.

# Interfaces

Interface is the shared contract for all middlesware, and allows middlesware to wrap handlers.
RouteMatcher matches routes.

# Type aliases

Func is to Interface as http.HandlerFunc is to http.Handler.