Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 551 Bytes

README.md

File metadata and controls

30 lines (24 loc) · 551 Bytes

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))
}