Created
October 13, 2016 00:04
-
-
Save negz/1a4c33d39b2bf74f34d19fa45e95b738 to your computer and use it in GitHub Desktop.
SRV resolution test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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