package
0.0.0-20230221181438-c5fed4d542bb
Repository: https://github.com/saas-templates/go-svelte.git
Documentation: pkg.go.dev
# README
Config
A convenience wrapper around viper
that provides easy-to-use struct-based config loading.
Example
Load Directly
package main
func main() {
var cfg Config
opts := []config.Option{
config.WithEnv(),
}
if err := config.Load(&cfg, opts...); err != nil {
panic(err)
}
fmt.Println(cfg)
}
type Config struct {
Addr string `default:":8080"`
StatsD struct {
Host string `default:"localhost"`
Port int `default:"8125"`
}
}