simpledns

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package simpledns discovers config API servers by performing simple DNS queries.

It is not a DNS-SD implementation. It requires all API servers to listen on the same port.

Index

Constants

View Source
const (
	// DefaultInterval is the default interval at which DNS queries are performed.
	DefaultInterval = 10 * time.Second

	// DefaultServerPort is the default server TCP port.
	DefaultServerPort = "https"
)
View Source
const (
	// QueryHostKey is the target meta-data key for the hostname used in the DNS
	// query that discovered the target.
	QueryHostKey key = "simpledns.query-host"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Discoverer

type Discoverer struct {
	QueryHost  string
	ServerPort string
	Observer   discovery.TargetObserver
	Interval   time.Duration
	Resolver   Resolver
	// contains filtered or unexported fields
}

Discoverer periodically performs a DNS query to discover API servers and notifies a target observer.

func (*Discoverer) Run

func (d *Discoverer) Run(ctx context.Context) error

Run performs discovery until ctx is canceled or an error occurs.

type Resolver

type Resolver interface {
	LookupHost(ctx context.Context, host string) ([]string, error)
}

Resolver is an interface for the subset of net.Resolver used by the discoverer.

Jump to

Keyboard shortcuts

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