Beispiel #1
0
func (s *HttpServer) Start() error {
	for pattern, handler := range s.handlers {
		http.Handle(pattern, handler)
	}
	log.Infof("Starting webserver at port %d", s.port)
	return http.ListenAndServe(fmt.Sprintf(":%d", s.port), nil)
}
Beispiel #2
0
func realMain() int {
	if *config_dir == "" {
		log.Errorf("Missing path to config directory (--config-dir | -c)")
		return 1
	}

	log.Infof("deploy-service starting")
	log.Infof("loading database")
	db := &TomlDB{}

	db.Load(*config_dir)
	log.Infof("loaded %d projects", len(db.projects))

	server := NewHttpServer(*http_port)
	server.AddHandler("/hooks/github", gitHubHookHandler(db))
	if err := server.Start(); err != nil {
		log.Errorf("Cant start hook server: %s", err)
		return 1
	}
	return 0
}
Beispiel #3
0
func TestInfoF(t *testing.T) {
	log.Infof("infof: %s", "asdsd")
}