package
0.0.0-20240624235250-9e89dfb7520d
Repository: https://github.com/tailscale/pkgsitelib.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# Functions

AcceptRequests serves 405 (Method Not Allowed) for any method not on the given list and 414 (Method Request URI Too Long) for any URI that exceeds the maxURILength.
ActiveRequests returns all requests that are currently being handled by the server, sorted by start time.
BetaPkgGoDevRedirect redirects requests from pkg.go.dev to beta.pkg.go.dev, based on whether a cookie is set for betapkggodev-redirect.
Chain creates a new Middleware that applies a sequence of Middlewares, so that they execute in the given order when handling an http request.
ErrorReporting returns a middleware that reports any server errors using the report func.
Experiment returns a new Middleware that sets active experiments for each incoming request.
GodocOrgRedirect redirects requests from godoc.org to pkg.go.dev.
Identity is a middleware that does nothing.
NewCacher returns a new Cacher, used for creating a middleware that caches each request.
NewExperimenter returns an Experimenter for use in the middleware.
Panic returns a middleware that executes panicHandler on any panic originating from the delegate handler.
Quota implements a simple IP-based rate limiter.
RequestForTraceID returns the active request with the given trace ID, or nil if there is no such request.
RequestInfo adds information about the request to a context.
RequestLog returns a middleware that logs each incoming requests using the given logger.
SecureHeaders adds a content-security-policy and other security-related headers to all responses.
ValidateIAPHeader checks that the request has a header that proves it arrived via the IAP.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
QuotaResultCount is a counter of quota results, by whether the request was blocked or not.
To avoid test flakiness, when TestMode is true, cache writes are synchronous.

# Structs

An Experimenter contains information about active experiments from the experiment source.
LocalLogger is a logger that can be used when running locally (i.e.: not on GCP).

# Interfaces

Logger is the interface used to write request logs to GCP.

# Type aliases

ExperimentGetter is the signature of a function that gets experiments.
An Expirer computes the TTL that should be used when caching a page.
A Middleware is a func that wraps an http.Handler.