dnssrv

package
v0.0.0-...-18e0330 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package dnssrv defines some implementations for a dns based service discovery

Index

Examples

Constants

View Source
const Namespace = "dns"

Namespace is the key for the dns sd module

Variables

View Source
var DefaultLookup = net.LookupSRV

DefaultLookup is the function used for the DNS resolution

View Source
var TTL = 30 * time.Second

TTL is the duration of the cached data

Functions

func New

func New(name string) sd.Subscriber

New creates a DNS subscriber with the default values

func NewDetailed

func NewDetailed(name string, lookup lookup, ttl time.Duration) sd.Subscriber

NewDetailed creates a DNS subscriber with the received values

Example
Output:

http://127.0.0.1:81
http://127.0.0.1:81
http://127.0.0.1:80
http://127.0.0.1:90
http://foobar:90

func Register

func Register() error

Register registers the dns sd subscriber factory under the name defined by Namespace

Example
Output:

http://127.0.0.1:81
http://127.0.0.1:81
http://127.0.0.1:80
http://127.0.0.1:90
http://foobar:90

func SubscriberFactory

func SubscriberFactory(cfg *config.Backend) sd.Subscriber

SubscriberFactory builds a DNS_SRV Subscriber with the received config

Types

This section is empty.

Jump to

Keyboard shortcuts

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