1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
package main
// import "github.com/caarlos0/env"
//////////////////////////////////////////////////////////////////////////
// Constant and data type/structure definitions
/*
Custom environment settings:
- **EVD_HOST**: Host address (string="localhost")
- **EVD_PORT**: Listening port (int="80")
- **EVD_FRCE**: Force start (bool)
- **EVD_VERB**: Verbose mode (higher numbers increase the verbosity) (int)
*/
type envConfig struct {
Host string `env:"EVD_HOST" envDefault:"localhost"` // Host address
Port int `env:"EVD_PORT" envDefault:"80"` // Listening port
Force bool `env:"EVD_FRCE"` // Force start
Verbose int `env:"EVD_VERB"` // Verbose mode (higher numbers increase the verbosity)
}
////////////////////////////////////////////////////////////////////////////
// Global variables definitions
// var (
// progname = "evdemo"
// version = "0.1.0"
// date = "2022-01-30"
// e envConfig
// )
|