本文整理匯總了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")))
}