summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Turner <jt@jtnet.co.uk>2017-11-30 06:55:01 -0800
committerJonathan Turner <jt@jtnet.co.uk>2017-11-30 06:55:01 -0800
commit262de68950570843c869ef3f46cbd78cad647ca9 (patch)
tree580d08e00c2fb22359e1830da93753a8b24e857d
parenta58124b8ce973a500cfdade1eecda03031775eb7 (diff)
comment update
-rw-r--r--srv.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/srv.go b/srv.go
index 94b0537..6b85515 100644
--- a/srv.go
+++ b/srv.go
@@ -25,13 +25,16 @@ func (s SRVRecords) Less(i, j int) bool {
return s[i].Priority < s[j].Priority
}
-// OrderedSRV returns a sorted int slice for the entries in the map. To use in the correct order:
+// 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(addrs)
+// 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
+// // Do something such as dial this SRV. If fails move on the the next or break if it succeeds.
// i += 1
// }
//