func listenAndServe(conf incus.Configuration) { listenAddr := fmt.Sprintf(":%s", conf.Get("listening_port")) err := http.ListenAndServe(listenAddr, nil) if err != nil { log.Fatal(err) } }
func listenAndServeTLS(conf incus.Configuration) { if conf.GetBool("tls_enabled") { tlsListenAddr := fmt.Sprintf(":%s", conf.Get("tls_port")) err := http.ListenAndServeTLS(tlsListenAddr, conf.Get("cert_file"), conf.Get("key_file"), nil) if err != nil { log.Println(err) log.Fatal(err) } } }
func initLogger(conf incus.Configuration) { incus.DEBUG = false if conf.Get("log_level") == "debug" { incus.DEBUG = true } }