mirror of
https://gitlab.com/ric_harvey/MailHog.git
synced 2024-11-27 16:24:04 +00:00
27 lines
400 B
Go
27 lines
400 B
Go
package config
|
|
|
|
import (
|
|
"flag"
|
|
|
|
"github.com/ian-kent/envconf"
|
|
)
|
|
|
|
func DefaultConfig() *Config {
|
|
return &Config{
|
|
AuthFile: "",
|
|
}
|
|
}
|
|
|
|
type Config struct {
|
|
AuthFile string
|
|
}
|
|
|
|
var cfg = DefaultConfig()
|
|
|
|
func Configure() *Config {
|
|
return cfg
|
|
}
|
|
|
|
func RegisterFlags() {
|
|
flag.StringVar(&cfg.AuthFile, "auth-file", envconf.FromEnvP("MH_AUTH_FILE", "").(string), "A username:bcryptpw mapping file")
|
|
}
|