Пример #1
0
func init() {
	flag.Parse()
	if *htstart {
		log.Printf("starting http://%s/\n", *htaddr)
		lab.Register("htmod", htmod.New(*htaddr))
	}
}
Пример #2
0
Файл: http.go Проект: napsy/lab
func init() {
	lab.LoadConf()
	if !(*useHttp || *useHttps) {
		return
	}
	conf := htmod.Config{
		Https: *useHttps,
		Addr:  *htaddr,
	}
	if conf.Https {
		conf.KeyFile = *keyFile
		conf.CertFile = *certFile
		conf.CAFile = *cacertFile
		log.Printf("starting https://%s/\n", conf.Addr)
	} else {
		log.Printf("starting http://%s/\n", conf.Addr)
	}
	lab.Register("htmod", htmod.New(conf))
}