Example #1
0
func (c *AppConf) Load() *AppConf {
	if c.IsExist() {
		logger.Tracef("Load config. AppName:%s Location:%s", c.AppName, c.Location())
		c.StringKeyValueMap = ini.NewIniConfig(c.Location()).LoadKeyValue()
		return c
	}
	logger.Tracef("Location not exists, Create Default StringKeyValueMap. AppName:%s", c.AppName)
	c.StringKeyValueMap = mcore.NewStringKeyValueMap()
	c.performLoad = false
	return c
}
Example #2
0
func Demo() {
	var c mconf.Config = mconf.NewConfig(ini.NewIniConfig("../data/demo.ini", "../data/demo2.ini"))
	c.Put("put", "temp put")
	demo.DemoConfig(c)
	fmt.Println(c.GetString("put"))
}
Example #3
0
File: db.go Project: mabetle/mdb
// NewDBConfFromFile
// file in ini format.
func NewDBConfFromFile(location string) *DBConf {
	logger.Trace("NewDBConfFromFile() locaton: ", location)
	loader := ini.NewIniConfig(location)
	c := mconf.NewConfig(loader)
	return NewDBConfFromConfig(c)
}