Пример #1
0
func main() {

	fmt.Println("Starting DistGo...")

	//db.StartDB() //initialize the database

	//Start Controllers
	cli := clientController.New()
	cli.Init()

	problem, err := getProblem(conf.Problem())
	if err != nil {
		log.Fatal(err)
	}

	probCon, err := problemController.New(problem)
	if err != nil {
		log.Fatal(err)
	}

	probCon.Init()

	con := connectionController.New(cli, probCon)

	fmt.Println("DistGo is working!")

	con.Init()

}
Пример #2
0
func setup() *httptest.Server {
	cli = clientController.New()
	cli.Init()

	prob := problems.GetProblem("pruebaProblem")
	probCon = problemController.New(prob)
	if probCon == nil {
		panic("nil problemController")
	}
	probCon.Init()

	con := New(cli, probCon)

	server := httptest.NewUnstartedServer(con)

	go server.Start()
	time.Sleep(100 * time.Millisecond)

	return server
}