Skip to content

Repository files navigation

Go Report CardcodecovPkgGoDev

boa

A small configuration library for go application with a viper-like API, but with limited scope and no external dependency

It supports:

  • reading a config in JSON or JSONC ( JSON with comments)
  • setting default

example

config:=`{ "http_server": { "enabled": true, "host": "127.0.0.1" }}`boa.SetDefault("http_server.port", 80)
err:=boa.ParseConfig(strings.NewReader(config))
iferr!=nil {
log.Fatal(err)
}
srvHost:=boa.GetString("http_server.host")
srvPort:=boa.GetInt("http_server.port")
fmt.Printf("%s:%d", srvHost, srvPort)
// Output: 127.0.0.1:80

About

minimalist configuration library for go

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages