Exemplo n.º 1
0
func loadConfig() {
	log.Infoln("Loading config...")
	var err error
	config, err = data.LoadConfig(*confPath)
	if err != nil {
		log.Fatalf("Failed to load config: %[1]s", err)
		os.Exit(1)
	}
	log.Debugln("Successfully loaded config.")
}
Exemplo n.º 2
0
func loadTemplates() {
	log.Infoln("Loading HTML redirect template...")

	var err error
	templRedirect, err = template.ParseFiles(config.RedirectTemplate)
	if err != nil {
		log.Fatalf("Failed to load HTML redirect template: %s", err)
		os.Exit(3)
	}
	log.Debugln("Successfully loaded HTML redirect template.")
}
Exemplo n.º 3
0
func loadDatabase() {
	log.Infoln("Loading database...")

	var err error
	err = data.LoadDatabase(config.SQL)
	if err != nil {
		log.Fatalf("Failed to load database: %[1]s", err)
		os.Exit(2)
	}

	log.Debugln("Successfully loaded database.")
}