A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pkg.go.dev/github.com/go-kit/kit@v0.13.0/sd/dnssrv below:

dnssrv package - github.com/go-kit/kit/sd/dnssrv - Go Packages

Overview

Package dnssrv provides an Instancer implementation for DNS SRV records.

Index Constants

This section is empty.

Variables View Source
var ErrPortZero = errors.New("resolver returned SRV record with port 0")

ErrPortZero is returned by the resolve machinery when a DNS resolver returns an SRV record with its port set to zero.

Functions

This section is empty.

Types type Instancer added in v0.5.0
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 added in v0.5.0
func NewInstancer(
	name string,
	ttl time.Duration,
	logger log.Logger,
) *Instancer

NewInstancer returns a DNS SRV instancer.

func NewInstancerDetailed added in v0.5.0
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 added in v0.5.0
func (in *Instancer) Deregister(ch chan<- sd.Event)

Deregister implements Instancer.

func (*Instancer) Register added in v0.5.0
func (in *Instancer) Register(ch chan<- sd.Event)

Register implements Instancer.

func (*Instancer) Stop added in v0.5.0
func (in *Instancer) Stop()

Stop terminates the Instancer.

type Lookup
type Lookup func(service, proto, name string) (cname string, addrs []*net.SRV, err error)

Lookup is a function that resolves a DNS SRV record to multiple addresses. It has the same signature as net.LookupSRV.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4