Documentation ¶
Overview ¶
Package middleware provides some types and functions common among middleware.
Index ¶
Constants ¶
const Namespace = "coredns"
Namespace is the namespace used for the metrics.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Addr ¶
type Addr string // Addr resprents an address in the Corefile.
Addr resprents an address in the Corefile.
type Handler ¶
Handler is like dns.Handler except ServeDNS may return an rcode and/or error.
If ServeDNS writes to the response body, it should return a status code. If the status code is not one of the following:
* SERVFAIL (dns.RcodeServerFailure)
* REFUSED (dns.RecodeRefused)
* FORMERR (dns.RcodeFormatError)
* NOTIMP (dns.RcodeNotImplemented)
CoreDNS assumes *no* reply has yet been written. All other response codes signal other handlers above it that the response message is already written, and that they should not write to it also.
If ServeDNS encounters an error, it should return the error value so it can be logged by designated error-handling middleware.
If writing a response after calling another ServeDNS method, the returned rcode SHOULD be used when writing the response.
If handling errors after calling another ServeDNS method, the returned error value SHOULD be logged or handled accordingly.
Otherwise, return values should be propagated down the middleware chain by returning them unchanged.
type HandlerFunc ¶
HandlerFunc is a convenience type like dns.HandlerFunc, except ServeDNS returns an rcode and an error. See Handler documentation for more information.
type Host ¶
type Host string // Host represents a host from the Corefile, may contain port.
Host represents a host from the Corefile, may contain port.
type Middleware ¶
Middleware is the middle layer which represents the traditional idea of middleware: it chains one Handler to the next by being passed the next Handler in the chain.
type Name ¶
type Name string
Name represents a domain name.
Directories ¶
Path | Synopsis |
---|---|
Package bind allows binding to a specific interface instead of bind to all of them.
|
Package bind allows binding to a specific interface instead of bind to all of them. |
Package cache implements a cache.
|
Package cache implements a cache. |
Package chaos implements a middleware that answer to 'CH version.bind TXT' type queries.
|
Package chaos implements a middleware that answer to 'CH version.bind TXT' type queries. |
Package dnssec implements a middleware that signs responses on-the-fly using NSEC black lies.
|
Package dnssec implements a middleware that signs responses on-the-fly using NSEC black lies. |
Package errors implements an HTTP error handling middleware.
|
Package errors implements an HTTP error handling middleware. |
Package etcd provides the etcd backend middleware.
|
Package etcd provides the etcd backend middleware. |
msg
Package msg defines the Service structure which is used for service discovery.
|
Package msg defines the Service structure which is used for service discovery. |
Package file implements a file backend.
|
Package file implements a file backend. |
tree
Package tree implements Left-Leaning Red Black trees as described by Robert Sedgewick.
|
Package tree implements Left-Leaning Red Black trees as described by Robert Sedgewick. |
Package health implements an HTTP handler that responds to health checks.
|
Package health implements an HTTP handler that responds to health checks. |
Package kubernetes provides the kubernetes backend.
|
Package kubernetes provides the kubernetes backend. |
Package loadbalance is middleware for rewriting responses to do "load balancing" Package loadbalance shuffles A and AAAA records.
|
Package loadbalance is middleware for rewriting responses to do "load balancing" Package loadbalance shuffles A and AAAA records. |
Package log implements basic but useful request (access) logging middleware.
|
Package log implements basic but useful request (access) logging middleware. |
Package metrics implement a handler and middleware that provides Prometheus metrics.
|
Package metrics implement a handler and middleware that provides Prometheus metrics. |
pkg
|
|
dnsrecorder
Package dnsrecorder allows you to record a DNS response when it is send to the client.
|
Package dnsrecorder allows you to record a DNS response when it is send to the client. |
dnsutil
Package dnsutil contains DNS related helper functions.
|
Package dnsutil contains DNS related helper functions. |
edns
Package edns provides function usefull for adding/inspecting OPT records to/in messages.
|
Package edns provides function usefull for adding/inspecting OPT records to/in messages. |
singleflight
Package singleflight provides a duplicate function call suppression mechanism.
|
Package singleflight provides a duplicate function call suppression mechanism. |
storage
Package storage abstracts away where middleware can store assests (zones, keys, etc).
|
Package storage abstracts away where middleware can store assests (zones, keys, etc). |
Package pprof implement a debug endpoint for getting profiles using the go pprof tooling.
|
Package pprof implement a debug endpoint for getting profiles using the go pprof tooling. |
Package proxy is middleware that proxies requests.
|
Package proxy is middleware that proxies requests. |
Package rewrite is middleware for rewriting requests internally to something different.
|
Package rewrite is middleware for rewriting requests internally to something different. |
Package secondary implements a secondary middleware.
|
Package secondary implements a secondary middleware. |
Package test contains helper functions for writing middleware tests.
|
Package test contains helper functions for writing middleware tests. |
Package whoami implements a middleware that returns details about the resolving querying it.
|
Package whoami implements a middleware that returns details about the resolving querying it. |