dns

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 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.Instancer, 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

func (d *Discovery) Watch(
	ctx context.Context,
	_ provider.GetInstanceOptions,
) (<-chan []provider.Instancer, error)

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