Esempio n. 1
0
func main() {
	var creds golhashmap.HashMap
	flag.Parse()

	creds = make(golhashmap.HashMap)
	json := golconfig.GetConfig("json")
	json.ConfigFromFile(*config, &creds)

	panic_for_config(creds)

	fmt.Println("starting stalking")
	twt.StalkFollowers(creds)
}
/* config from flags */
func ConfigFromFlags() Config {
	flag.Parse()

	var config Config
	config = make(Config)
	if *flag_config != "" {
		config_file := golconfig.GetConfig("json")
		config_file.ConfigFromFile(*flag_config, &config)
	}

	assignIfEmpty(config, "dbpath", *flag_dbpath)
	assignIfEmpty(config, "server-uri", *flag_server_uri)
	assignIfEmpty(config, "http-port", *flag_http_port)
	assignIfEmpty(config, "rep-ports", *flag_rep_ports)
	assignIfEmpty(config, "cpuprofile", *flag_cpuprofile)

	fmt.Println("Starting for:", config)
	return config
}