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.