Пример #1
0
func client(c *cli.Context) *Client {
	vulcanUrl := c.String("vulcan")
	if len(vulcanUrl) == 0 {
		vulcanUrl = "http://localhost:8182"
	}
	return NewClient(vulcanUrl)
}
Пример #2
0
func deleteRateLimitAction(c *cli.Context) {
	printStatus(client(c).DeleteRateLimit(
		c.String("host"),
		c.String("loc"),
		c.String("id")))
}
Пример #3
0
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")))
}
Пример #4
0
func deleteHostAction(c *cli.Context) {
	printStatus(client(c).DeleteHost(c.String("name")))
}
Пример #5
0
func addHostAction(c *cli.Context) {
	printStatus(client(c).AddHost(c.String("name")))
}
Пример #6
0
func deleteLocationAction(c *cli.Context) {
	printStatus(client(c).DeleteLocation(c.String("host"), c.String("id")))
}
Пример #7
0
func locationUpdateUpstreamAction(c *cli.Context) {
	printStatus(client(c).UpdateLocationUpstream(c.String("host"), c.String("id"), c.String("up")))
}
Пример #8
0
func addLocationAction(c *cli.Context) {
	printStatus(client(c).AddLocation(c.String("host"), c.String("id"), c.String("path"), c.String("up")))
}
Пример #9
0
func deleteEndpointAction(c *cli.Context) {
	printStatus(client(c).DeleteEndpoint(c.String("up"), c.String("id")))
}
Пример #10
0
func addEndpointAction(c *cli.Context) {
	printStatus(client(c).AddEndpoint(c.String("up"), c.String("id"), c.String("url")))
}
Пример #11
0
func deleteUpstreamAction(c *cli.Context) {
	printStatus(client(c).DeleteUpstream(c.String("id")))
}
Пример #12
0
func addUpstreamAction(c *cli.Context) {
	printStatus(client(c).AddUpstream(c.String("id")))
}