Documentation ¶
Index ¶
Constants ¶
View Source
const ( // A qtype performs A/AAAA lookup. A = QType("dns") // SRV qtype performs SRV lookup with A/AAAA lookup for each SRV result. SRV = QType("dnssrv") // SRVNoA qtype performs SRV lookup without any A/AAAA lookup for each SRV result. SRVNoA = QType("dnssrvnoa") )
Variables ¶
This section is empty.
Functions ¶
func GetQTypeName ¶
GetQTypeName splits the provided addr into two parts: the QType (if any) and the name.
func IsDynamicNode ¶
IsDynamicNode returns if the specified StoreAPI addr uses any kind of SD mechanism.
Types ¶
type Provider ¶
Provider is a stateful cache for asynchronous DNS resolutions. It provides a way to resolve addresses and obtain them.
func NewProvider ¶
func NewProvider(logger log.Logger, reg prometheus.Registerer, resolverType ResolverType) *Provider
NewProvider returns a new empty provider with a given resolver type. If empty resolver type is net.DefaultResolver.
func (*Provider) Collect ¶
func (p *Provider) Collect(ch chan<- prometheus.Metric)
Describe implements prometheus.Collector
func (*Provider) Describe ¶
func (p *Provider) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector
type Resolver ¶
type Resolver interface { // Resolve performs a DNS lookup and returns a list of records. // name is the domain name to be resolved. // qtype is the query type. Accepted values are `dns` for A/AAAA lookup and `dnssrv` for SRV lookup. // If scheme is passed through name, it is preserved on IP results. Resolve(ctx context.Context, name string, qtype QType) ([]string, error) }
func NewResolver ¶
NewResolver creates a resolver with given underlying resolver.
type ResolverType ¶
type ResolverType string
const ( GolangResolverType ResolverType = "golang" MiekgdnsResolverType ResolverType = "miekgdns" )
func (ResolverType) ToResolver ¶
func (t ResolverType) ToResolver(logger log.Logger) ipLookupResolver
Click to show internal directories.
Click to hide internal directories.