Skip to content

Instantly share code, notes, and snippets.

@negz
Created October 13, 2016 00:04
Show Gist options
  • Save negz/1a4c33d39b2bf74f34d19fa45e95b738 to your computer and use it in GitHub Desktop.
Save negz/1a4c33d39b2bf74f34d19fa45e95b738 to your computer and use it in GitHub Desktop.
SRV resolution test
func main() {
log := zap.New(zap.NewTextEncoder(), zap.AddCaller(), zap.DebugLevel)
lib := dns.NewLookupLib("127.0.0.1:53")
srv := "_talos._https.example.org"
b := lb.New(&lb.Config{Dns: lib, Strategy: random.RandomStrategy}, srv)
for {
time.Sleep(time.Second)
a, err := b.Next()
if err != nil {
log.Error("fail", zap.Error(err))
continue
}
log.Info("host", zap.String("a", a.String()))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment