本文整理汇总了Golang中github.com/mailgun/cli.Context类的典型用法代码示例。如果您正苦于以下问题:Golang Context类的具体用法?Golang Context怎么用?Golang Context使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Context类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: client
func client(c *cli.Context) *Client {
vulcanUrl := c.String("vulcan")
if len(vulcanUrl) == 0 {
vulcanUrl = "http://localhost:8182"
}
return NewClient(vulcanUrl)
}
示例2: deleteRateLimitAction
func deleteRateLimitAction(c *cli.Context) {
printStatus(client(c).DeleteRateLimit(
c.String("host"),
c.String("loc"),
c.String("id")))
}
示例3: addRateLimitAction
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: deleteHostAction
func deleteHostAction(c *cli.Context) {
printStatus(client(c).DeleteHost(c.String("name")))
}
示例5: addHostAction
func addHostAction(c *cli.Context) {
printStatus(client(c).AddHost(c.String("name")))
}
示例6: deleteLocationAction
func deleteLocationAction(c *cli.Context) {
printStatus(client(c).DeleteLocation(c.String("host"), c.String("id")))
}
示例7: locationUpdateUpstreamAction
func locationUpdateUpstreamAction(c *cli.Context) {
printStatus(client(c).UpdateLocationUpstream(c.String("host"), c.String("id"), c.String("up")))
}
示例8: addLocationAction
func addLocationAction(c *cli.Context) {
printStatus(client(c).AddLocation(c.String("host"), c.String("id"), c.String("path"), c.String("up")))
}
示例9: deleteEndpointAction
func deleteEndpointAction(c *cli.Context) {
printStatus(client(c).DeleteEndpoint(c.String("up"), c.String("id")))
}
示例10: addEndpointAction
func addEndpointAction(c *cli.Context) {
printStatus(client(c).AddEndpoint(c.String("up"), c.String("id"), c.String("url")))
}
示例11: deleteUpstreamAction
func deleteUpstreamAction(c *cli.Context) {
printStatus(client(c).DeleteUpstream(c.String("id")))
}
示例12: addUpstreamAction
func addUpstreamAction(c *cli.Context) {
printStatus(client(c).AddUpstream(c.String("id")))
}