Documentation ¶
Overview ¶
Package etcd provides the etcd backend.
Index ¶
- type Etcd
- func (e Etcd) A(zone string, state middleware.State, previousRecords []dns.RR) (records []dns.RR, debug []msg.Service, err error)
- func (e Etcd) AAAA(zone string, state middleware.State, previousRecords []dns.RR) (records []dns.RR, debug []msg.Service, err error)
- func (e Etcd) CNAME(zone string, state middleware.State) (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 (g Etcd) Get(path string, recursive bool) (*etcdc.Response, error)
- func (e Etcd) MX(zone string, state middleware.State) (records, extra []dns.RR, debug []msg.Service, err error)
- func (e Etcd) NS(zone string, state middleware.State) (records, extra []dns.RR, debug []msg.Service, err error)
- func (e Etcd) PTR(zone string, state middleware.State) (records []dns.RR, debug []msg.Service, err error)
- func (g Etcd) Records(name string, exact bool) ([]msg.Service, error)
- func (e Etcd) SOA(zone string, state middleware.State) ([]dns.RR, []msg.Service, error)
- func (e Etcd) SRV(zone string, state middleware.State) (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 (g Etcd) TTL(node *etcdc.Node, serv *msg.Service) uint32
- func (e Etcd) TXT(zone string, state middleware.State) (records []dns.RR, debug []msg.Service, err error)
- func (e Etcd) UpdateStubZones()
- 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. // contains filtered or unexported fields }
func (Etcd) Err ¶
func (e Etcd) Err(zone string, rcode int, state middleware.State, debug []msg.Service, err error) (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) (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) (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 middleware.State) (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()