consul

module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2026 License: Apache-2.0

README

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL