aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/main.go b/main.go
index 2b37803..b446042 100644
--- a/main.go
+++ b/main.go
@@ -40,6 +40,7 @@ type ConfigFile struct {
ConsulHost string `json:"consul_host"`
ConsulConsistent bool `json:"consul_force_consistency"`
+ ConsulToken string `json:"consul_token"`
Acl []string `json:"acl"`
@@ -56,6 +57,7 @@ type Config struct {
ConsulHost string
ConsulConsistent bool
+ ConsulToken string
Acl ACL
@@ -114,6 +116,7 @@ func readConfig(logger *log.Logger) Config {
ConsulHost: config_file.ConsulHost,
ConsulConsistent: config_file.ConsulConsistent,
+ ConsulToken: config_file.ConsulToken,
Acl: acl,
}
@@ -168,6 +171,9 @@ func main() {
if config.ConsulHost != "" {
consul_config.Address = config.ConsulHost
}
+ if config.ConsulToken != "" {
+ consul_config.Token = config.ConsulToken
+ }
consul_client, err := consul.NewClient(consul_config)
if err != nil {
logger.Fatal(err)