Documentation ¶
Overview ¶
Package etcd provides the etcd backend.
Index ¶
- type Etcd
- func (e Etcd) A(zone string, state middleware.State, previousRecords []dns.RR, opt Options) (records []dns.RR, debug []msg.Service, err error)
- func (e Etcd) AAAA(zone string, state middleware.State, previousRecords []dns.RR, opt Options) (records []dns.RR, debug []msg.Service, err error)
- func (e Etcd) CNAME(zone string, state middleware.State, opt Options) (records []dns.RR, debug []msg.Service, err error)
- func (e *Etcd) Err(zone string, rcode int, state middleware.State, 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 middleware.State, opt Options) (records, extra []dns.RR, debug []msg.Service, err error)
- func (e Etcd) NS(zone string, state middleware.State, opt Options) (records, extra []dns.RR, debug []msg.Service, err error)
- func (e Etcd) PTR(zone string, state middleware.State, 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 middleware.State, opt Options) ([]dns.RR, []msg.Service, error)
- func (e Etcd) SRV(zone string, state middleware.State, 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 middleware.State, 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. }
func (*Etcd) Err ¶
func (e *Etcd) Err(zone string, rcode int, state middleware.State, 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 middleware.State, 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) PTR ¶
func (e Etcd) PTR(zone string, state middleware.State, 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) SOA ¶
func (e Etcd) SOA(zone string, state middleware.State, opt Options) ([]dns.RR, []msg.Service, error)
SOA Record returns a SOA record.
func (Etcd) SRV ¶
func (e Etcd) SRV(zone string, state middleware.State, 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) UpdateStubZones ¶
func (e *Etcd) UpdateStubZones()