예제 #1
0
func (s *ConfSuite) SetUpTest(c *C) {
	s.router = hostroute.NewHostRouter()
	proxy, err := vulcan.NewProxy(s.router)
	if err != nil {
		c.Fatal(err)
	}
	s.conf = NewConfigurator(proxy)
}
예제 #2
0
func (s *Service) createProxy() error {
	s.router = hostroute.NewHostRouter()
	proxy, err := vulcan.NewProxy(s.router)
	if err != nil {
		return err
	}
	s.proxy = proxy
	return nil
}
예제 #3
0
func (s *ApiSuite) SetUpTest(c *C) {
	s.backend = membackend.NewMemBackend(registry.GetRegistry())

	muxRouter := mux.NewRouter()
	hostRouter := hostroute.NewHostRouter()
	proxy, err := vulcan.NewProxy(hostRouter)
	configurator := configure.NewConfigurator(proxy)
	c.Assert(err, IsNil)

	InitProxyController(s.backend, adapter.NewAdapter(proxy), configurator.GetConnWatcher(), muxRouter)
	s.testServer = httptest.NewServer(muxRouter)
	s.client = NewClient(s.testServer.URL, registry.GetRegistry())
}