dnsutils

package module
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: Apache-2.0 Imports: 3 Imported by: 29

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OrderedSRV

func OrderedSRV(service, proto, name string) (int, map[int]*net.SRV, error)

OrderedSRV returns a count of the results and a map keyed on the order they should be used. This based on the records' priority and randomised selection based on their relative weighting. The function's inputs are the same as those for net.LookupSRV To use in the correct order:

count, orderedSRV, err := OrderedSRV(service, proto, name) i := 1

for  i <= count {
  srv := orderedSRV[i]
  // Do something such as dial this SRV. If fails move on the the next or break if it succeeds.
  i += 1
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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