Documentation
¶
Index ¶
- func CreateConsulClient(consul *ConsulConfig) error
- func CreateQueryOptions(cache *ConsulKVCache) *api.QueryOptions
- func GetDefaultSOA(zoneName string) *records.SOARecord
- func GetDefaultTTL(record *records.Record) int
- func GetEnvOrDefault(key, defaultvalue string) string
- func GetZoneAndRecord(zones []string, qname string) (string, string)
- func HandleConsulError(r *dns.Msg, w dns.ResponseWriter, e error) (int, error)
- func HandleError(request *dns.Msg, rcode int, writer dns.ResponseWriter, e error) (int, error)
- func HandleNXDomain(qname string, soa *records.SOARecord, request *dns.Msg, ...) (int, error)
- func HandleNoData(qname string, soa *records.SOARecord, request *dns.Msg, ...) (int, error)
- func IncrementMetricsConsulConfigUpdatedTotal(err string)
- func IncrementMetricsConsulRequestDurationSeconds(status string, duration float64)
- func IncrementMetricsPluginErrorsTotal(err string)
- func IncrementMetricsQueryRequestsTotal(zone string, qtype uint16)
- func IncrementMetricsResponsesFailedTotal(zone string, qtype uint16, err string)
- func IncrementMetricsResponsesSuccessfulTotal(zone string, qtype uint16)
- func LoadConsulConfig(c *caddy.Controller, consul *ConsulConfig) error
- func LoadEnvFile(path string) error
- func PrepareResponseRcode(request *dns.Msg, rcode int, recursionAvailable bool) *dns.Msg
- func PrepareResponseReply(request *dns.Msg, recursionAvailable bool) *dns.Msg
- func SendDNSResponse(zname string, qtype uint16, msg *dns.Msg, writer dns.ResponseWriter) (int, error)
- type ConsulConfig
- func (consul *ConsulConfig) GetConfigFromConsul() (*ConsulKVConfig, error)
- func (consul *ConsulConfig) GetConsulKeyValue(key string, cache *ConsulKVCache) (*api.KVPair, float64, error)
- func (consul ConsulConfig) GetSOARecordFromConsul(zone string, cache *ConsulKVCache) (*records.SOARecord, error)
- func (consul ConsulConfig) GetZoneRecordFromConsul(zone, name string, cache *ConsulKVCache) (*records.Record, error)
- func (consul ConsulConfig) WatchConsulConfig(config *ConsulKVConfig) error
- func (consul ConsulConfig) WatchConsulKey(key string, fn handler) error
- type ConsulKVCache
- type ConsulKVConfig
- type ConsulKVPlugin
- func (plug *ConsulKVPlugin) AppendCNAMERecords(ctx context.Context, msg *dns.Msg, qname string, qtype uint16, ttl int, ...) bool
- func (plug ConsulKVPlugin) CreateDNSResponse(qname string, qtype uint16, record *records.Record, ctx context.Context, ...) (int, error)
- func (plug *ConsulKVPlugin) HandleExternalCNAME(ctx context.Context, msg *dns.Msg, alias string, qtype uint16) bool
- func (plug ConsulKVPlugin) HandleMissingRecord(qname string, qtype uint16, zname string, rname string, ctx context.Context, ...) (int, error)
- func (plug ConsulKVPlugin) HandleNoMatchingRecords(qname string, qtype uint16, ctx context.Context, request *dns.Msg, ...) (int, error)
- func (plug *ConsulKVPlugin) HandleRecord(ctx context.Context, msg *dns.Msg, qname string, qtype uint16, ...) bool
- func (plug ConsulKVPlugin) Name() string
- func (config ConsulKVPlugin) Ready() bool
- func (plug ConsulKVPlugin) ServeDNS(ctx context.Context, writer dns.ResponseWriter, r *dns.Msg) (int, error)
- type ResponseWriterWrapper
- func (w *ResponseWriterWrapper) Close() error
- func (w *ResponseWriterWrapper) Hijack()
- func (w *ResponseWriterWrapper) LocalAddr() net.Addr
- func (w *ResponseWriterWrapper) RemoteAddr() net.Addr
- func (w *ResponseWriterWrapper) TsigStatus() error
- func (w *ResponseWriterWrapper) TsigTimersOnly(bool)
- func (w *ResponseWriterWrapper) Write([]byte) (int, error)
- func (w *ResponseWriterWrapper) WriteMsg(res *dns.Msg) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateConsulClient ¶
func CreateConsulClient(consul *ConsulConfig) error
func CreateQueryOptions ¶
func CreateQueryOptions(cache *ConsulKVCache) *api.QueryOptions
func GetDefaultSOA ¶
func GetDefaultTTL ¶
func GetEnvOrDefault ¶
func HandleConsulError ¶
func HandleError ¶
func HandleNXDomain ¶
func HandleNoData ¶
func IncrementMetricsConsulConfigUpdatedTotal ¶
func IncrementMetricsConsulConfigUpdatedTotal(err string)
func IncrementMetricsPluginErrorsTotal ¶
func IncrementMetricsPluginErrorsTotal(err string)
func LoadConsulConfig ¶
func LoadConsulConfig(c *caddy.Controller, consul *ConsulConfig) error
func LoadEnvFile ¶
func PrepareResponseRcode ¶
func PrepareResponseReply ¶
func SendDNSResponse ¶
Types ¶
type ConsulConfig ¶
type ConsulConfig struct {
Client *api.Client
KVPrefix string
Address string
Token string
DisableWatch bool
}
func CreateConsulConfig ¶
func CreateConsulConfig(c *caddy.Controller) (*ConsulConfig, error)
func GetConsulEnvConfig ¶
func GetConsulEnvConfig() ConsulConfig
func (*ConsulConfig) GetConfigFromConsul ¶
func (consul *ConsulConfig) GetConfigFromConsul() (*ConsulKVConfig, error)
func (*ConsulConfig) GetConsulKeyValue ¶
func (consul *ConsulConfig) GetConsulKeyValue(key string, cache *ConsulKVCache) (*api.KVPair, float64, error)
func (ConsulConfig) GetSOARecordFromConsul ¶
func (consul ConsulConfig) GetSOARecordFromConsul(zone string, cache *ConsulKVCache) (*records.SOARecord, error)
func (ConsulConfig) GetZoneRecordFromConsul ¶
func (consul ConsulConfig) GetZoneRecordFromConsul(zone, name string, cache *ConsulKVCache) (*records.Record, error)
func (ConsulConfig) WatchConsulConfig ¶
func (consul ConsulConfig) WatchConsulConfig(config *ConsulKVConfig) error
func (ConsulConfig) WatchConsulKey ¶
func (consul ConsulConfig) WatchConsulKey(key string, fn handler) error
type ConsulKVCache ¶
type ConsulKVConfig ¶
type ConsulKVConfig struct {
ZonePrefix string `json:"zone_prefix"`
Zones []string `json:"zones"`
Flattening types.FlatteningType `json:"flattening,omitempty"`
NoCache bool `json:"no_cache,omitempty"`
ConsulCache *ConsulKVCache `json:"consul_cache,omitempty"`
}
type ConsulKVPlugin ¶
type ConsulKVPlugin struct {
Next plugin.Handler
Consul *ConsulConfig
Config *ConsulKVConfig
}
func CreatePlugin ¶
func CreatePlugin(c *caddy.Controller) (*ConsulKVPlugin, error)
func (*ConsulKVPlugin) AppendCNAMERecords ¶
func (ConsulKVPlugin) CreateDNSResponse ¶
func (*ConsulKVPlugin) HandleExternalCNAME ¶
func (ConsulKVPlugin) HandleMissingRecord ¶
func (ConsulKVPlugin) HandleNoMatchingRecords ¶
func (*ConsulKVPlugin) HandleRecord ¶
func (ConsulKVPlugin) Name ¶
func (plug ConsulKVPlugin) Name() string
func (ConsulKVPlugin) Ready ¶
func (config ConsulKVPlugin) Ready() bool
type ResponseWriterWrapper ¶
func (*ResponseWriterWrapper) Close ¶
func (w *ResponseWriterWrapper) Close() error
func (*ResponseWriterWrapper) Hijack ¶
func (w *ResponseWriterWrapper) Hijack()
func (*ResponseWriterWrapper) LocalAddr ¶
func (w *ResponseWriterWrapper) LocalAddr() net.Addr
func (*ResponseWriterWrapper) RemoteAddr ¶
func (w *ResponseWriterWrapper) RemoteAddr() net.Addr
func (*ResponseWriterWrapper) TsigStatus ¶
func (w *ResponseWriterWrapper) TsigStatus() error
func (*ResponseWriterWrapper) TsigTimersOnly ¶
func (w *ResponseWriterWrapper) TsigTimersOnly(bool)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.