コード例 #1
0
ファイル: config.go プロジェクト: moyee/mycron
func init() {
	c := conf.NewConfig(ConfigPath)
	//mysql
	Mysql_host = c.Read("mysql", "host")
	Mysql_prot = c.GetInt("mysql", "port")
	Mysql_user = c.Read("mysql", "user")
	Mysql_pwd = c.Read("mysql", "pwd")
	Mysql_dbname = c.Read("mysql", "dbname")

	//logger
	Log_Path = c.Read("log", "logPath")
	Log_filename = c.Read("log", "filename")
}
コード例 #2
0
ファイル: main.go プロジェクト: widaT/image_resize
func init() {
	configPath := "etc/ir.conf"
	c := conf.NewConfig(configPath)
	sorce_base_path = c.Read("base", "sorce_base_path")
	thumb_base_path = c.Read("base", "thumb_base_path")
	ip = c.Read("base", "ip")
	port = c.GetInt("base", "port")
	for_cdn = c.GetInt("base", "for_cdn")
	compress = c.Read("base", "compress")
	suport_size = c.Read("base", "suport_size")
	if suport_size != "" {
		size_arr := strings.Split(suport_size, ",")
		for _, v := range size_arr {
			size_map[v] = true
		}
	}
}