Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 662 Bytes

File metadata and controls

25 lines (18 loc) · 662 Bytes

docs/configuration-sources.md

Configuration Sources

gorealconf supports multiple configuration sources:

File Source

source, err := gorealconf.NewFileSource[AppConfig]("config.json")
cfg := gorealconf.New[AppConfig](gorealconf.WithSource[AppConfig](source))

Etcd Source

source, err := gorealconf.NewEtcdSource[AppConfig]([]string{"localhost:2379"}, "/app/config")
cfg := gorealconf.New[AppConfig](gorealconf.WithSource[AppConfig](source))

Consul Source

source, err := gorealconf.NewConsulSource[AppConfig]("localhost:8500", "app/config")
cfg := gorealconf.New[AppConfig](gorealconf.WithSource[AppConfig](source))