Esempio n. 1
0
func (c *client) ListRoutes(parentRef string) ([]*router.Route, error) {
	path := "/routes"
	if parentRef != "" {
		q := make(url.Values)
		q.Set("parent_ref", parentRef)
		path += "?" + q.Encode()
	}
	var res []*router.Route
	err := c.get(path, &res)
	return res, err
}
Esempio n. 2
0
func (c *client) GetRoute(id string) (*router.Route, error) {
	res := &router.Route{}
	err := c.get("/routes/"+id, res)
	return res, err
}