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 ¶ added in v0.12.0
GetQTypeName splits the provided addr into two parts: the QType (if any) and the name.
func IsDynamicNode ¶ added in v0.12.0
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.
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 ¶ added in v0.7.0
type ResolverType string
const ( GolangResolverType ResolverType = "golang" MiekgdnsResolverType ResolverType = "miekgdns" )
func (ResolverType) ToResolver ¶ added in v0.7.0
func (t ResolverType) ToResolver(logger log.Logger) ipLookupResolver
Click to show internal directories.
Click to hide internal directories.