Documentation ¶
Index ¶
- Constants
- Variables
- type BcsCustom
- func (bc *BcsCustom) IsNameError(err error) bool
- func (bc *BcsCustom) Lookup(state request.Request, name string, typ uint16) (*dns.Msg, error)
- func (bc *BcsCustom) MinTTL(state request.Request) uint32
- func (bc *BcsCustom) Name() string
- func (bc *BcsCustom) Records(state request.Request, exact bool) ([]msg.Service, error)
- func (bc *BcsCustom) Reverse(state request.Request, exact bool, opt plugin.Options) ([]msg.Service, error)
- func (bc *BcsCustom) Serial(state request.Request) uint32
- func (bc *BcsCustom) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)
- func (bc *BcsCustom) Services(state request.Request, exact bool, opt plugin.Options) (services []msg.Service, err error)
- func (bc *BcsCustom) Transfer(ctx context.Context, state request.Request) (int, error)
- type DNS
- type DNSMessage
- type TLS
Constants ¶
const ( Success = "success" Failure = "failure" )
Variables ¶
var ( RequestCount = prometheus.NewCounterVec(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: "bcscustom", Name: "request_count_total", Help: "Counter of requests to plugin bcscustom.", }, []string{"status"}) RequestLatency = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Namespace: plugin.Namespace, Subsystem: "bcscustom", Name: "request_latency_seconds", Buckets: plugin.TimeBuckets, Help: "Histogram of the time (in seconds) each request took.", }, []string{"status"}) DnsTotal = prometheus.NewGauge(prometheus.GaugeOpts{ Namespace: plugin.Namespace, Subsystem: "bcscustom", Name: "dns_total", Help: "Total counter of dns in plugin bcscustom.", }) )
Metrics the bcscustom plugin exports.
Functions ¶
This section is empty.
Types ¶
type BcsCustom ¶
type BcsCustom struct { Next plugin.Handler FallThrough bool Zones []string RootPrefix string Upstream upstream.Upstream // Proxy for looking up names during the resolution process EtcdCli *etcdcv3.Client EtcdPlugin *etcd.Etcd Ctx context.Context Listen string SvrTLS TLS // contains filtered or unexported fields }
BcsCustom represent a bcscustom server class Etcd is a plugin talks to an etcd cluster. BcsCustom is a plugin talks to an etcd cluster.
func (*BcsCustom) IsNameError ¶
IsNameError implements the coredns.plugin.ServiceBackend interface. IsNameError return true if err indicated a record not found condition
func (*BcsCustom) Lookup ¶
Lookup implements the coredns.plugin.ServiceBackend interface. Lookup is used to find records else where.
func (*BcsCustom) MinTTL ¶
MinTTL implements the coredns.plugin.ServiceBackend interface. MinTTL returns the minimum TTL to be used in the SOA record.
func (*BcsCustom) Records ¶
Records implements the coredns.plugin.ServiceBackend interface. Records _all_ services that matches a certain name. Note: it does not implement a specific service.
func (*BcsCustom) Reverse ¶
func (bc *BcsCustom) Reverse(state request.Request, exact bool, opt plugin.Options) ([]msg.Service, error)
Reverse implements the coredns.plugin.ServiceBackend interface. Reverse communicates with the backend to retrieve service definition based on a IP address instead of a name. I.e. a reverse DNS lookup.
func (*BcsCustom) Serial ¶
Serial implements the coredns.plugin.ServiceBackend interface. Serial returns a SOA serial number to construct a SOA record.
type DNS ¶
type DNS struct { DomainName string `json:"domain"` Messages []DNSMessage `json:"messages"` }
DNS data structure for request
type DNSMessage ¶
type DNSMessage struct { Alias string `json:"alias"` // extend field, alias name for this message Host string `json:"host,omitempty"` Port int `json:"port,omitempty"` Priority int `json:"priority,omitempty"` Weight int `json:"weight,omitempty"` Text string `json:"text,omitempty"` Mail bool `json:"mail,omitempty"` TTL uint32 `json:"ttl,omitempty"` // When a SRV record with a "Host: IP-address" is added, we synthesize // a srv.Target domain name. Normally we convert the full Key where // the record lives to a DNS name and use this as the srv.Target. When // TargetStrip > 0 we strip the left most TargetStrip labels from the // DNS name. TargetStrip int `json:"targetstrip,omitempty"` // Group is used to group (or *not* to group) different services // together. Services with an identical Group are returned in the same // answer. Group string `json:"group,omitempty"` }
DNSMessage dns detail for one host