Example #1
0
func catchListenAndServe(addr string, handler http.Handler, ident string, wg *sync.WaitGroup) {
	defer wg.Done()
	err := tablecloth.ListenAndServe(addr, handler, ident)
	if err != nil {
		log.Fatal(err)
	}
}
Example #2
0
func main() {
	cfg = NewConfig()
	SetupTablecloth()
	SetupLoggers(cfg)
	SetGoMaxProcs()

	extractor := NewExtractor(cfg)

	err := extractor.LoadEntities()
	if err != nil {
		log.Fatal(err)
	}

	extractorApi := NewExtractorAPI(extractor)

	logInfo("listening for requests on", cfg.extractAddress)
	err = tablecloth.ListenAndServe(cfg.extractAddress, extractorApi)
	if err != nil {
		log.Fatal(err)
	}
}
Example #3
0
func serve(addr string, handler http.Handler, wg *sync.WaitGroup, logger *logrus.Logger) {
	defer wg.Done()
	logger.Fatal(tablecloth.ListenAndServe(addr, handler))
}
Example #4
0
func serve(addr string, m http.Handler, wg *sync.WaitGroup) {
	defer wg.Done()
	log.Fatal(tablecloth.ListenAndServe(addr, m))
}