package dnssrv
import "github.com/go-kit/kit/sd/dnssrv"
Package dnssrv provides an Instancer implementation for DNS SRV records.
Index ¶
- Variables
- type Instancer
- func NewInstancer( name string, ttl time.Duration, logger log.Logger, ) *Instancer
- func NewInstancerDetailed( name string, refresh *time.Ticker, lookup Lookup, logger log.Logger, ) *Instancer
- func (in *Instancer) Deregister(ch chan<- sd.Event)
- func (in *Instancer) Register(ch chan<- sd.Event)
- func (in *Instancer) Stop()
- type Lookup
Variables ¶
ErrPortZero is returned by the resolve machinery when a DNS resolver returns an SRV record with its port set to zero.
Types ¶
type Instancer ¶
type Instancer struct {
// contains filtered or unexported fields
}
Instancer yields instances from the named DNS SRV record. The name is resolved on a fixed schedule. Priorities and weights are ignored.
func NewInstancer ¶
NewInstancer returns a DNS SRV instancer.
func NewInstancerDetailed ¶
func NewInstancerDetailed( name string, refresh *time.Ticker, lookup Lookup, logger log.Logger, ) *Instancer
NewInstancerDetailed is the same as NewInstancer, but allows users to provide an explicit lookup refresh ticker instead of a TTL, and specify the lookup function instead of using net.LookupSRV.
func (*Instancer) Deregister ¶
Deregister implements Instancer.
func (*Instancer) Register ¶
Register implements Instancer.
func (*Instancer) Stop ¶
func (in *Instancer) Stop()
Stop terminates the Instancer.
type Lookup ¶
Lookup is a function that resolves a DNS SRV record to multiple addresses. It has the same signature as net.LookupSRV.
Source Files ¶
- Version
- v0.13.0 (latest)
- Published
- May 29, 2023
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 4 hours ago –
Tools for package owners.