func (s *Service) initApi() error { var err error s.apiApp, err = scroll.NewApp() if err != nil { return err } api.InitProxyController(s.ng, s.supervisor, s.apiApp) return nil }
func (s *ApiSuite) SetUpTest(c *C) { newProxy := func(id int) (proxy.Proxy, error) { return proxy.New(id, stapler.New(), proxy.Options{}) } s.ng = memng.New(registry.GetRegistry()) sv := supervisor.New(newProxy, s.ng, make(chan error), supervisor.Options{}) app, _ := scroll.NewApp() InitProxyController(s.ng, sv, app) s.testServer = httptest.NewServer(app.GetHandler()) s.client = NewClient(s.testServer.URL, registry.GetRegistry()) }
func (s *CmdSuite) SetUpTest(c *C) { s.ng = memng.New(registry.GetRegistry()) newProxy := func(id int) (proxy.Proxy, error) { return proxy.New(id, stapler.New(), proxy.Options{}) } sv := supervisor.New(newProxy, s.ng, make(chan error), supervisor.Options{}) sv.Start() s.sv = sv app, _ := scroll.NewApp() api.InitProxyController(s.ng, sv, app) s.testServer = httptest.NewServer(app.GetHandler()) s.out = &bytes.Buffer{} s.cmd = &Command{registry: registry.GetRegistry(), out: s.out, vulcanUrl: s.testServer.URL} }
func (s *Service) initApi() error { s.apiApp = scroll.NewApp() api.InitProxyController(s.ng, s.supervisor, s.apiApp) return nil }