dns
v0.0.0-20230630043320-433fd72654f0
github.com/ioVN/database/internal/mongo-driver/x/mongo/driver/dns
Documentation
pkg.go.dev ↗Variables
DefaultResolver
var DefaultResolver = &Resolver{net.LookupSRV, net.LookupTXT}
DefaultResolver is a Resolver that uses the default Resolver from the net package.
Types
Resolver
type Resolver struct {
// Holds the functions to use for DNS lookups
LookupSRV func(string, string, string) (string, []*net.SRV, error)
LookupTXT func(string) ([]string, error)
}
Resolver resolves DNS records.
Resolver.GetConnectionArgsFromTXT
func (r *Resolver) GetConnectionArgsFromTXT(host string) ([]string, error)
GetConnectionArgsFromTXT gets the TXT record associated with the host and returns the connection arguments.
Resolver.ParseHosts
func (r *Resolver) ParseHosts(host string, srvName string, stopOnErr bool) ([]string, error)
ParseHosts uses the srv string and service name to get the hosts.