func client(c *cli.Context) *Client { vulcanUrl := c.String("vulcan") if len(vulcanUrl) == 0 { vulcanUrl = "http://localhost:8182" } return NewClient(vulcanUrl) }
func deleteRateLimitAction(c *cli.Context) { printStatus(client(c).DeleteRateLimit( c.String("host"), c.String("loc"), c.String("id"))) }
func addRateLimitAction(c *cli.Context) { printStatus( client(c).AddRateLimit( c.String("host"), c.String("loc"), c.String("id"), c.String("var"), c.String("reqs"), c.String("period"), c.String("burst"))) }
func deleteHostAction(c *cli.Context) { printStatus(client(c).DeleteHost(c.String("name"))) }
func addHostAction(c *cli.Context) { printStatus(client(c).AddHost(c.String("name"))) }
func deleteLocationAction(c *cli.Context) { printStatus(client(c).DeleteLocation(c.String("host"), c.String("id"))) }
func locationUpdateUpstreamAction(c *cli.Context) { printStatus(client(c).UpdateLocationUpstream(c.String("host"), c.String("id"), c.String("up"))) }
func addLocationAction(c *cli.Context) { printStatus(client(c).AddLocation(c.String("host"), c.String("id"), c.String("path"), c.String("up"))) }
func deleteEndpointAction(c *cli.Context) { printStatus(client(c).DeleteEndpoint(c.String("up"), c.String("id"))) }
func addEndpointAction(c *cli.Context) { printStatus(client(c).AddEndpoint(c.String("up"), c.String("id"), c.String("url"))) }
func deleteUpstreamAction(c *cli.Context) { printStatus(client(c).DeleteUpstream(c.String("id"))) }
func addUpstreamAction(c *cli.Context) { printStatus(client(c).AddUpstream(c.String("id"))) }