gopkg.in/simversity/gottp.v3@v3.0.0-20160401065405-576cf030ca0e/conf/config.go (about) 1 package conf 2 3 type GottpSettings struct { 4 EmailHost string 5 EmailPort string 6 EmailUsername string 7 EmailPassword string 8 EmailSender string 9 EmailFrom string 10 ErrorTo string 11 EmailDummy bool 12 Listen string 13 } 14 15 const baseConfig = `;Sample Configuration File 16 [gottp] 17 listen="127.0.0.1:8005";` 18 19 type Config struct { 20 Gottp GottpSettings 21 } 22 23 func (self *Config) MakeConfig(configPath string) { 24 ReadConfig(baseConfig, self) 25 if configPath != "" { 26 MakeConfig(configPath, self) 27 } 28 } 29 30 func (self *Config) GetGottpConfig() *GottpSettings { 31 return &self.Gottp 32 }