func (p *LXCProvisioner) router() (router.Router, error) { r, err := config.GetString("router") if err != nil { return nil, err } return router.Get(r) }
func getRouter() (router.Router, error) { r, err := config.GetString("docker:router") if err != nil { return nil, err } return router.Get(r) }
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) } }
func Router() (router.Router, error) { return router.Get("elb") }
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{}) }