Example #1
0
File: main.go Project: se77en/incus
func listenAndServe(conf incus.Configuration) {
	listenAddr := fmt.Sprintf(":%s", conf.Get("listening_port"))
	err := http.ListenAndServe(listenAddr, nil)
	if err != nil {
		log.Fatal(err)
	}
}
Example #2
0
File: main.go Project: se77en/incus
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)
		}
	}
}
Example #3
0
File: main.go Project: se77en/incus
func initLogger(conf incus.Configuration) {
	incus.DEBUG = false
	if conf.Get("log_level") == "debug" {
		incus.DEBUG = true
	}
}