Skip to content

alexsukhrin/consul

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

consul

consul config

Example

package consul

import (
	"fmt"
	"os"
	"testing"
)

func TestConfig(t *testing.T) {
	consul := new(Consul)
	consul.Host = os.Getenv("CONSUL_HOST")
	consul.Port = os.Getenv("CONSUL_PORT")
	consul.Stage = os.Getenv("STAGE")
	consul.ServiceName = os.Getenv("CONSUL_SERVICE")
	consul.TokenPath = os.Getenv("CONSUL_SECRET_TOKEN")
	consul.ConfigAddress = consul.Address()
	consul.ConfigPath = consul.Path()
	consul.TokenKey = consul.Token()

	config := consul.Config()
	t.Log(fmt.Sprintf("Config %s", config))
}

About

consul config

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages