示例#1
0
func (p *LXCProvisioner) router() (router.Router, error) {
	r, err := config.GetString("router")
	if err != nil {
		return nil, err
	}
	return router.Get(r)
}
示例#2
0
func getRouter() (router.Router, error) {
	r, err := config.GetString("docker:router")
	if err != nil {
		return nil, err
	}
	return router.Get(r)
}
示例#3
0
func Example() {
	router, err := router.Get("hipache")
	if err != nil {
		panic(err)
	}
	err = router.AddRoute("myapp", "http://10.10.10.10:8080")
	if err != nil {
		panic(err)
	}
	addr, _ := router.Addr("myapp")
	fmt.Println("Please access:", addr)
	err = router.RemoveRoute("myapp")
	if err != nil {
		panic(err)
	}
}
示例#4
0
文件: provisioner.go 项目: nemx/tsuru
func Router() (router.Router, error) {
	return router.Get("elb")
}
示例#5
0
func (s *S) TestShouldBeRegistered(c *gocheck.C) {
	r, err := router.Get("hipache")
	c.Assert(err, gocheck.IsNil)
	_, ok := r.(hipacheRouter)
	c.Assert(ok, gocheck.Equals, true)
}
func (s *S) TestShouldBeRegistered(c *gocheck.C) {
	r, err := router.Get("fake")
	c.Assert(err, gocheck.IsNil)
	c.Assert(r, gocheck.FitsTypeOf, &fakeRouter{})
}