# Functions
AccessLog adds an access logging middleware.
AccessLogHandler returns a http.Handler that adds access-logging on the info level.
AccessMetrics collects metrics about bytes send and response status codes and writes them to the provided prometheus registerer.
AccessMetricsHandler collects the bytes send out as well as the status codes as prometheus metrics and writes them to the registry.
AccessMetricsRegister registrates the relevant prometheus types and returns a custom registration type.
AddGracefulShutdown intercepts the cancel function of the received ctx and calls the shutdowner.Shutdown interface instead.
Build a http server from the provided options.
Caching adds a caching middleware handler which uses the ETag HTTP response and If-None-Match HTTP request headers.
CspFileReplace replaces the nonce variable in all content responses and has the hard requirement that a session cookie is present in the context, see server.SessionCookie to add one.
CspHeaderHandler replaces the nonce placerholder in the Content-Security-header.
CspHeaderReplace replaces the nonce variable in the Content-Security-Header.
Fallback adds a fallback route handler.
FallbackHandler routes the request to a fallback route on of the given HTTP fallback status codes.
H2C adds a middleware that supports h2c (unencrypted http2).
Header adds a static HTTP header adding middleware.
HealthCheckConditionalHandler is a conditional healthcheck handler that returns HTTP 200 when the condition argument function returns true and HTTP 503 if not.
HealthCheckHandler is a dummy handler that always returns HTTP 200.
NewCacheHandler computes and stores the hashes for all files.
NewCspFileHandler returns a CspFileHandler, it implements the http.Handler interface and fixes the Angular style-src CSP issue.
Optional sets the middleware if the isActive condition is fulfilled.
ReplacerCollectionFromInput constructs a replacer that prepares the input data into a template where the toReplace string will be replaced.
RunTillWaitGroupFinishes runs the server argument until the WaitGroup wg finishes.
SessionCookieHandler reads the cookieName cookie from the request and adds if to the context unter the SessionIdKey if present.
SessionId adds a session cookie adding middleware.
nolint:mnd // 2 is the signals we need to cache to allow double sending the signal for immediate exit.
Validate adds to the validate middleware and prevent path transversal attacks by cleaning the request path.
ValidateHandler returns HTTP 405 if the request method is not GET or HEAD.
# Constants
CspHeaderName is the Content-Security-Policy HTTP-Header name.
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SessionIdKey is the ContextKey under which the current sessionId can be found.
No description provided by the author
# Structs
AngularCspReplaceConfig holds the config options for fixing the syle-src CSP issue in Angular.
Config holds the advanced server config options.
ContextKey is a struct used for storing relevant keys in the request context.
CspFileHandler implements the http.Handler interface and fixes the Angular style-src CSP issue.
HeaderHandler implements the http.Handler interface and adds the static headers provided in the Headers map to the response.
PrometheusRegistration wraps a prometheus registerer and corresponding registered types.
ReplacerCollection is a series of replacer implementations which are used to effectively replace a given string by pre-splitting the target template.
# Interfaces
Shutdowner are functions that support a Shutdown operation.
# Type aliases
HandlerMiddleware wraps a received handler with another wrapper handler to add functionality.