Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Configuration interface implementation inspired by the .NET configuration extension

License

Notifications You must be signed in to change notification settings

zekro-archive/configoration

Repository files navigation

configoration

GoDoc Actions GitHub tag (latest SemVer)

go get github.com/zekroTJA/configoration

Details

configoration (yeah, it's no typo) is another configuration interface library which provides a similar API to the Configuration Extension of .NET Platform Extensions 3.1 providing a ConfigurationBuilder like builder struct which produces a Section instance which is inspired by the IConfiguration interface of .NET.

Example

c, err := configoration.NewBuilder().
	SetBasePath("./testdata").
	AddJsonFile("config.json", true).
	AddJsonFile("config.Development.json", true).
	AddYamlFile("config.yaml", true).
	AddEnvironmentVariables("APP_", false).
	Build()

if err != nil {
	panic(err)
}

tls := c.GetSection("WebServer:TLS")
enable, ok := tls.GetBool("enable")

About

Configuration interface implementation inspired by the .NET configuration extension

Resources

License

Stars

Watchers

Forks

Languages