Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Localhost should be provided to the DNSRegistry constructor as the // value for host when using the DNSRegistry in single-node implementations, // in-meomry implementations, or tests. Localhost = "localhost" LocalAddress = "127.0.0.1" DNSServerID = "DNS_SERVER_ID" DNSServerVersion = int64(-1) DNS_ACTOR_GENERATION = 1 // Must be at least 1 because <= 0 is not a legal versionstamp DNSVersionStamp = 1 )
Variables ¶
This section is empty.
Functions ¶
func NewDNSRegistry ¶
NewDNSRegistry creates a new registry.Registry backed by DNS.
func NewDNSRegistryFromResolver ¶
func NewDNSRegistryFromResolver( resolver DNSResolver, host string, opts DNSRegistryOptions, ) (registry.Registry, error)
NewDNSRegistryFromResolver is the same as NewDNSRegistry except it allows a custom implementation of DNSResolver to be provided.
Types ¶
type DNSRegistryOptions ¶
type DNSRegistryOptions struct { // ResolveEvery controls how often the LookupIP method will be // called on the DNSResolver to detect which IPs are active. ResolveEvery time.Duration // Logger is a logging instance used for logging messages. // If no logger is provided, the default logger from the slog package (slog.Default()) will be used. Logger *slog.Logger }
DNSRegistryOptions contains the options for the DNS resgistry implementation.
type DNSResolver ¶
DNSResolver is the interface that must be implemented by a resolver in order to map a hostname to set of live IPs.
func NewDNSResolver ¶
func NewDNSResolver(port int) DNSResolver
NewDNSResolver returns a new DNSResolver that is backed by the standard library implementation of net.LookupIP.
Click to show internal directories.
Click to hide internal directories.