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") }
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.") }
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.") }
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.") }
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.") }