Beispiel #1
0
func loadTemplates() {
	log.Infof("Loading HTML templates...")
	err := data.LoadTemplates(config.ImageTemplate)
	if err != nil {
		log.Fatalf("Failed to load image page: %s", err)
		os.Exit(3)
	}
	log.Debugln("Successfully loaded HTML templates")
}
Beispiel #2
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.")
}
Beispiel #3
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.")
}
Beispiel #4
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.")
}
Beispiel #5
0
func loadDatabase() {
	log.Infof("Loading database...")

	database = data.CreateDatabase(config.SQL)

	err := database.Load()
	if err != nil {
		log.Fatalf("Failed to load database: %[1]s", err)
		os.Exit(2)
	}

	auth, err = mauth.Create(database.GetInternalDB())
	if err != nil {
		log.Fatalf("Failed to load Mauth: %[1]s", err)
	}

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