Ejemplo n.º 1
0
//indexinfo to ini
func IndexInfoToIni(this *IndexInfo, cfg *goconfig.Config) {
	f_dburl_arr := []string{"jdbc:mysql://", this.F_ip, ":", this.F_port, "/mid?useUnicode=true&characterEncoding=utf-8&useOldAliasMetadataBehavior=true"}
	var f_dburl = strings.Join(f_dburl_arr, "")

	t_dburl_arr := []string{"jdbc:mysql://", this.T_ip, ":", this.T_port, "/rptdb?useUnicode=true&characterEncoding=utf-8&useOldAliasMetadataBehavior=true"}
	var t_dburl = strings.Join(t_dburl_arr, "")
	f_dbname, _ := cfg.Get("dbconfig::f_dbname")
	t_dbname, _ := cfg.Get("dbconfig::t_dbname")

	f_dbtype, _ := cfg.Get("dbconfig::f_dbtype")
	f_driver, _ := cfg.Get("dbconfig::f_driver")
	t_dbtype, _ := cfg.Get("dbconfig::t_dbtype")
	t_driver, _ := cfg.Get("dbconfig::t_driver")
	cfg.Set("dbconfig", "f_dbtype", f_dbtype)
	cfg.Set("dbconfig", "f_driver", f_driver)
	cfg.Set("dbconfig", "f_dburl", f_dburl)
	cfg.Set("dbconfig", "f_ip", this.F_ip)
	cfg.Set("dbconfig", "f_port", this.F_port)
	cfg.Set("dbconfig", "f_dbname", f_dbname)
	cfg.Set("dbconfig", "f_user", this.F_username)
	cfg.Set("dbconfig", "f_password", this.F_password)

	cfg.Set("dbconfig", "t_dbtype", t_dbtype)
	cfg.Set("dbconfig", "t_driver", t_driver)
	cfg.Set("dbconfig", "t_dburl", t_dburl)
	cfg.Set("dbconfig", "t_ip", this.T_ip)
	cfg.Set("dbconfig", "t_port", this.T_port)
	cfg.Set("dbconfig", "t_dbname", t_dbname)
	cfg.Set("dbconfig", "t_user", this.T_username)
	cfg.Set("dbconfig", "t_password", this.T_password)

	sysid, _ := cfg.Get("dbconfig::sysid")
	systype, _ := cfg.Get("dbconfig::systype")
	sysname, _ := cfg.Get("dbconfig::sysname")
	company, _ := cfg.Get("dbconfig::company")
	platform, _ := cfg.Get("dbconfig::platform")
	logger.Info("platform===========================", platform, sysname)
	cfg.Set("dbconfig", "sysid", sysid)
	cfg.Set("dbconfig", "systype", systype)
	cfg.Set("dbconfig", "sysname", sysname)
	cfg.Set("dbconfig", "company", company)
	cfg.Set("dbconfig", "platform", platform)

}
Ejemplo n.º 2
0
//indexinfo to cfg
func IndexInfoToCfg(this *IndexInfo, cfg *goconfig.Config) {

	repeatetimer, _ := cfg.Get("config::repeatetimer")
	singletimer, _ := cfg.Get("config::singletimer")
	register_url, _ := cfg.Get("config::register_url")
	orgversion_url, _ := cfg.Get("config::orgversion_url")
	allorg_url, _ := cfg.Get("config::allorg_url")
	sites, _ := cfg.Get("config::sites")

	cfg.Set("config", "repeatetimer", repeatetimer)
	cfg.Set("config", "singletimer", singletimer)
	cfg.Set("config", "sites", sites)

	cfg.Set("config", "register_url", register_url)
	cfg.Set("config", "orgversion_url", orgversion_url)
	cfg.Set("config", "allorg_url", allorg_url)

	cfg.Set("config", "core_ip", this.Core_ip)
	cfg.Set("config", "core_port", this.Core_port)
	cfg.Set("config", "rpt_ip", this.Rpt_ip)
	cfg.Set("config", "rpt_port", this.Rpt_port)

	cfg.Set("config", "f_ip", this.F_ip)
	cfg.Set("config", "f_port", this.F_port)
	cfg.Set("config", "f_username", this.F_username)
	cfg.Set("config", "f_password", this.F_password)

	cfg.Set("config", "t_ip", this.T_ip)
	cfg.Set("config", "t_port", this.T_port)
	cfg.Set("config", "t_username", this.T_username)
	cfg.Set("config", "t_password", this.T_password)

	cfg.Set("config", "transferes", this.Transferes)
	cfg.Set("config", "nosql", this.Nosql)
}