package
0.0.0-20230728070032-dd9e68f319d5
Repository: https://github.com/weaveworks/common.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# Functions
ClientUserHeaderInterceptor propagates the user ID from the context to gRPC metadata, which eventually ends up as a HTTP2 header.
CountingListener returns a Listener that increments a Prometheus gauge when a connection is accepted, and decrements the gauge when the connection is closed.
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))).
No description provided by the author
NewSourceIPs creates a new SourceIPs.
NewStatsHandler creates handler that can be added to gRPC server options to track received and sent message sizes.
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.
StreamClientInstrumentInterceptor records duration of streaming gRPC requests client side.
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.
UnaryClientInstrumentInterceptor records duration of gRPC requests client side.
UnaryServerInstrumentInterceptor instruments gRPC requests for errors and latency.
# Variables
AuthenticateUser propagates the user ID from HTTP headers back to the request's context.
BodySizeBuckets defines buckets for request/response body sizes.
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.
SourceIPExtractor extracts the source IPs from a HTTP request.
Tracer is a middleware which traces incoming requests.
# Interfaces
Interface is the shared contract for all middlesware, and allows middlesware to wrap handlers.
An error can implement ShouldLog() to control whether GRPCServerLog will log.
RouteMatcher matches routes.
# Type aliases
Func is to Interface as http.HandlerFunc is to http.Handler.