dnssrv

package
v0.0.0-...-3bf07d8 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Publisher

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

Publisher yields endpoints taken from the named DNS SRV record. The name is resolved on a fixed schedule. Priorities and weights are ignored.

func NewPublisher

func NewPublisher(
	name string,
	ttl time.Duration,
	factory loadbalancer.Factory,
	logger log.Logger,
) *Publisher

NewPublisher returns a DNS SRV publisher. The name is resolved synchronously as part of construction; if that resolution fails, the constructor will return an error. The factory is used to convert a host:port to a usable endpoint. The logger is used to report DNS and factory errors.

func NewPublisherDetailed

func NewPublisherDetailed(
	name string,
	refreshTicker *time.Ticker,
	lookupSRV func(service, proto, name string) (cname string, addrs []*net.SRV, err error),
	factory loadbalancer.Factory,
	logger log.Logger,
) *Publisher

NewPublisherDetailed is the same as NewPublisher, but allows users to provide an explicit lookup refresh ticker instead of a TTL, and specify the function used to perform lookups instead of using net.LookupSRV.

func (*Publisher) Endpoints

func (p *Publisher) Endpoints() ([]endpoint.Endpoint, error)

Endpoints implements the Publisher interface.

func (*Publisher) Stop

func (p *Publisher) Stop()

Stop terminates the publisher.

Jump to

Keyboard shortcuts

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