Help us shape the future of Go! Take the 2026 Go Developer Survey

dns

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("no records found")

ErrNotFound is returned when no DNS records are found for a host.

Functions

This section is empty.

Types

type Discovery added in v0.10.0

type Discovery struct {
	// contains filtered or unexported fields
}

Discovery implements service discovery using DNS.

func NewDNSServiceDiscovery

func NewDNSServiceDiscovery(servers []string, valid time.Duration) (*Discovery, error)

NewDNSServiceDiscovery creates a new DNSServiceDiscovery instance.

func (*Discovery) Close added in v0.10.0

func (d *Discovery) Close() error

Close stops the DNS service discovery ticker.

func (*Discovery) GetInstances added in v0.10.0

func (d *Discovery) GetInstances(
	ctx context.Context,
	options provider.GetInstanceOptions,
) ([]provider.DiscoveryResult, error)

GetInstances resolves the given host to IP addresses and returns them as service instances.

func (*Discovery) Lookup added in v0.10.0

func (d *Discovery) Lookup(ctx context.Context, host string) ([]string, error)

Lookup resolves the given host to a list of IP addresses.

func (*Discovery) Watch added in v0.10.0

Watch starts a ticker that periodically signals for instance refreshes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL