Skip to content

go-external-config/consul

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ConsulPropertySource

HashiCorp Consul is a service networking solution that enables teams to manage secure network connectivity between services and across on-prem and multi-cloud environments and runtimes. Consul offers service discovery, service mesh, traffic management, and automated updates to network infrastructure devices. (more)

cmd/app/main.go

import (
    consul "github.com/go-external-config/consul/env"
    "github.com/go-external-config/go/env"
)

var _ = env.Instance().WithPropertySource(consul.NewConsulPropertySource())

func main() {
	defer err.Recover()
	fmt.Println(env.Value[string]("${db.pass}"))
	// fmt.Println(env.Value[string]("${consul.app/db/password}"))
}

config/application.yaml

db:
	pass: consul:app/db/password

consul:
	addr: http://127.0.0.1:8500
	token: generated

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors