Allow multiple bootstrap servers

This commit is contained in:
Star Brilliant
2017-11-25 15:46:29 +08:00
parent 2577b720c7
commit a0bd8eb8a1
3 changed files with 22 additions and 11 deletions
+6 -1
View File
@@ -21,6 +21,7 @@ package main
import (
"flag"
"log"
"strings"
)
func main() {
@@ -32,7 +33,11 @@ func main() {
verbose := flag.Bool("verbose", false, "Enable logging")
flag.Parse()
client, err := NewClient(*addr, *upstream, *bootstrap, *timeout, *noECS, *verbose)
bootstraps := []string {}
if *bootstrap != "" {
bootstraps = strings.Split(*bootstrap, ",")
}
client, err := NewClient(*addr, *upstream, bootstraps, *timeout, *noECS, *verbose)
if err != nil { log.Fatalln(err) }
_ = client.Start()
}