コード例 #1
0
func init() {
	go func() {
		// Start our webapp
		fakeRemote := dsb.NewDSBFacadeWithEndpoint("http://localhost:7777")
		http.ListenAndServe(fmt.Sprintf(":8081"), main.WebAppWithFacade(fakeRemote))
	}()
}
コード例 #2
0
ファイル: graph_test.go プロジェクト: clausthrane/futfut
// Not a test
func loadData(t *testing.T) *models.TrainEventList {

	// quickest way
	mockserver.HttpServerDSBTestApi(t, 44444)
	remoteAPI := dsb.NewDSBFacadeWithEndpoint("http://localhost:44444")
	successC, errC := remoteAPI.GetTrains("", "")

	select {
	case response := <-successC:
		return response
	case <-errC:
		return &models.TrainEventList{nil}
	}
}