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"`
}
}
# Functions
Load loads configurations into the given structPtr.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author