func main() { app := server.New() app.RegisterObject("Test", &testService{}) http.ListenAndServe("127.0.0.1:9009", app) }
func TestEnd2End(t *testing.T) { app := server.New() app.RegisterObject("End2End", &testService{}) testServer := httptest.NewServer(app) defer testServer.Close() client := ExampleClient(testServer.URL) if result, err := client.EmptyParams(); assert.NoError(t, err) { assert.Equal(t, "EmptyParams", result) } if result, err := client.Sum(2, 3); assert.NoError(t, err) { assert.Equal(t, 5, result) } }