Documentation ¶
Overview ¶
Package etcd provides the etcd backend middleware.
Index ¶
- type Etcd
- func (e Etcd) A(zone string, state request.Request, previousRecords []dns.RR, opt Options) (records []dns.RR, debug []msg.Service, err error)
- func (e Etcd) AAAA(zone string, state request.Request, previousRecords []dns.RR, opt Options) (records []dns.RR, debug []msg.Service, err error)
- func (e Etcd) CNAME(zone string, state request.Request, opt Options) (records []dns.RR, debug []msg.Service, err error)
- func (e *Etcd) Err(zone string, rcode int, state request.Request, debug []msg.Service, err error, ...) (int, error)
- func (e *Etcd) Get(path string, recursive bool) (*etcdc.Response, error)
- func (e Etcd) MX(zone string, state request.Request, opt Options) (records, extra []dns.RR, debug []msg.Service, err error)
- func (e Etcd) NS(zone string, state request.Request, opt Options) (records, extra []dns.RR, debug []msg.Service, err error)
- func (e Etcd) PTR(zone string, state request.Request, opt Options) (records []dns.RR, debug []msg.Service, err error)
- func (e *Etcd) Records(name string, exact bool) ([]msg.Service, error)
- func (e Etcd) SOA(zone string, state request.Request, opt Options) ([]dns.RR, []msg.Service, error)
- func (e Etcd) SRV(zone string, state request.Request, opt Options) (records, extra []dns.RR, debug []msg.Service, err error)
- func (e *Etcd) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)
- func (e *Etcd) TTL(node *etcdc.Node, serv *msg.Service) uint32
- func (e Etcd) TXT(zone string, state request.Request, opt Options) (records []dns.RR, debug []msg.Service, err error)
- func (e *Etcd) UpdateStubZones()
- type Options
- type Stub
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Etcd ¶
type Etcd struct { Next middleware.Handler Zones []string PathPrefix string Proxy proxy.Proxy // Proxy for looking up names during the resolution process Client etcdc.KeysAPI Ctx context.Context Inflight *singleflight.Group Stubmap *map[string]proxy.Proxy // list of proxies for stub resolving. Debug bool // Do we allow debug queries. }
Etcd is a middleware talks to an etcd cluster.
func (Etcd) A ¶
func (e Etcd) A(zone string, state request.Request, previousRecords []dns.RR, opt Options) (records []dns.RR, debug []msg.Service, err error)
A returns A records from etcd or an error.
func (Etcd) AAAA ¶
func (e Etcd) AAAA(zone string, state request.Request, previousRecords []dns.RR, opt Options) (records []dns.RR, debug []msg.Service, err error)
AAAA returns AAAA records from etcd or an error.
func (Etcd) CNAME ¶
func (e Etcd) CNAME(zone string, state request.Request, opt Options) (records []dns.RR, debug []msg.Service, err error)
CNAME returns CNAME records from etcd or an error.
func (*Etcd) Err ¶
func (e *Etcd) Err(zone string, rcode int, state request.Request, debug []msg.Service, err error, opt Options) (int, error)
Err write an error response to the client.
func (*Etcd) Get ¶
Get is a wrapper for client.Get that uses SingleInflight to suppress multiple outstanding queries.
func (Etcd) MX ¶
func (e Etcd) MX(zone string, state request.Request, opt Options) (records, extra []dns.RR, debug []msg.Service, err error)
MX returns MX records from etcd. If the Target is not a name but an IP address, a name is created on the fly.
func (Etcd) NS ¶
func (e Etcd) NS(zone string, state request.Request, opt Options) (records, extra []dns.RR, debug []msg.Service, err error)
NS returns NS records from etcd or an error.
func (Etcd) PTR ¶
func (e Etcd) PTR(zone string, state request.Request, opt Options) (records []dns.RR, debug []msg.Service, err error)
PTR returns the PTR records, only services that have a domain name as host are included.
func (*Etcd) Records ¶
Records looks up records in etcd. If exact is true, it will lookup just this name. This is used when find matches when completing SRV lookups for instance.
func (Etcd) SRV ¶
func (e Etcd) SRV(zone string, state request.Request, opt Options) (records, extra []dns.RR, debug []msg.Service, err error)
SRV returns SRV records from etcd. If the Target is not a name but an IP address, a name is created on the fly.
func (*Etcd) TTL ¶
TTL returns the smaller of the etcd TTL and the service's TTL. If neither of these are set (have a zero value), a default is used.
func (Etcd) TXT ¶
func (e Etcd) TXT(zone string, state request.Request, opt Options) (records []dns.RR, debug []msg.Service, err error)
TXT returns TXT records from etcd or an error.
func (*Etcd) UpdateStubZones ¶
func (e *Etcd) UpdateStubZones()
UpdateStubZones checks etcd for an update on the stubzones.
type Options ¶
type Options struct {
Debug string // This is a debug query. A query prefixed with debug.o-o
}
Options are extra options that can be specified for a lookup.