package
2.5.2
Repository: https://github.com/threefx/caddy.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
Package encode implements an encoder middleware for Caddy.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

Error is a convenient way for a Handler to populate the essential fields of a HandlerError.
GetVar gets a value out of the context's variable table by key.
NewResponseRecorder returns a new ResponseRecorder that can be used instead of a standard http.ResponseWriter.
NewTestReplacer creates a replacer for an http.Request for use in tests that are not in this package.
ParseNamedResponseMatcher parses the tokens of a named response matcher.
PrepareRequest fills the request r for use in a Caddy HTTP handler chain.
SanitizedPathJoin performs filepath.Join(root, reqPath) that is safe against directory traversal attacks.
SetVar sets a value in the context's variable table with the given key.
StatusCodeMatches returns true if a real HTTP status code matches the configured status code, which may be either a real HTTP status code or an integer representing a class of codes (e.g.

# Constants

DefaultHTTPPort is the default port for HTTP.
DefaultHTTPSPort is the default port for HTTPS.
ErrorCtxKey is the context key to use when storing an error (for use with context.Context).
MatcherErrorVarKey is the key used for the variable that holds an optional error emitted from a request matcher, to short-circuit the handler chain, since matchers cannot return errors via the RequestMatcher interface.
For a partial copy of the unmodified request that originally came into the server's entry handler.
For referencing the server instance.
For the request's variable table.

# Variables

ErrNotImplemented is returned when an underlying ResponseWriter does not implement the required method.

# Structs

App is a robust, production-ready HTTP server.
AutoHTTPSConfig is used to disable automatic HTTPS or certain aspects of it for a specific server.
HandlerError is a serializable representation of an error from within an HTTP handler.
HTTPErrorConfig determines how to handle errors from the HTTP handlers.
HTTPRedirectListenerWrapper provides HTTP->HTTPS redirects for connections that come on the TLS port as an HTTP request, by detecting using the first few bytes that it's not a TLS handshake, but instead an HTTP request.
LoggableHTTPHeader makes an HTTP header loggable with zap.Object().
LoggableHTTPRequest makes an HTTP request loggable with zap.Object().
MatchExpression matches requests by evaluating a [CEL](https://github.com/google/cel-spec) expression.
No description provided by the author
No description provided by the author
MatchRegexp is an embedable type for matching using regular expressions.
No description provided by the author
ResponseHandler pairs a response matcher with custom handling logic.
ResponseMatcher is a type which can determine if an HTTP response matches some criteria.
ResponseWriterWrapper wraps an underlying ResponseWriter and promotes its Pusher/Flusher/Hijacker methods as well.
Route consists of a set of rules for matching HTTP requests, a list of handlers to execute, and optional flow control parameters which customize the handling of HTTP requests in a highly flexible and performant manner.
Server describes an HTTP server.
ServerLogConfig describes a server's logging configuration.
StaticError implements a simple handler that returns an error.
StaticResponse implements a simple responder for static responses.
Subroute implements a handler that compiles and executes routes.

# Interfaces

Handler is like http.Handler except ServeHTTP may return an error.
HTTPInterfaces mix all the interfaces that middleware ResponseWriters need to support.
MiddlewareHandler is like Handler except it takes as a third argument the next handler in the chain.
RequestMatcher is a type that can match to a request.
ResponseRecorder is a http.ResponseWriter that records responses instead of writing them to the client.

# Type aliases

HandlerFunc is a convenience type like http.HandlerFunc.
LoggableStringArray makes a slice of strings marshalable for logging.
LoggableTLSConnState makes a TLS connection state loggable with zap.Object().
MatcherSet is a set of matchers which must all match in order for the request to be matched successfully.
MatcherSets is a group of matcher sets capable of checking whether a request matches any of the sets.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MatchVarsRE matches the value of the context variables by a given regular expression.
Middleware chains one Handler to the next by being passed the next Handler in the chain.
RawMatcherSets is a group of matcher sets in their raw, JSON form.
RouteList is a list of server routes that can create a middleware chain.
ShouldBufferFunc is a function that returns true if the response should be buffered, given the pending HTTP status code and response headers.
VarsMatcher is an HTTP request matcher which can match requests based on variables in the context.
VarsMiddleware is an HTTP middleware which sets variables to have values that can be used in the HTTP request handler chain.
WeakString is a type that unmarshals any JSON value as a string literal, with the following exceptions: 1.