本文整理匯總了Golang中github.com/opsgenie/opsgenie-go-sdk/client.OpsGenieClient.SetHTTPTransportSettings方法的典型用法代碼示例。如果您正苦於以下問題:Golang OpsGenieClient.SetHTTPTransportSettings方法的具體用法?Golang OpsGenieClient.SetHTTPTransportSettings怎麽用?Golang OpsGenieClient.SetHTTPTransportSettings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/opsgenie/opsgenie-go-sdk/client.OpsGenieClient
的用法示例。
在下文中一共展示了OpsGenieClient.SetHTTPTransportSettings方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: initialize
func initialize(c *gcli.Context) *ogcli.OpsGenieClient {
if c.IsSet("v") {
verbose = true
printVerboseMessage("Will execute command in verbose mode.")
}
readConfigFile(c)
apiKey := grabAPIKey(c)
cli := new(ogcli.OpsGenieClient)
cli.SetAPIKey(apiKey)
if apiURL := cfg.Get("opsgenie.api.url"); apiURL != "" {
cli.SetOpsGenieAPIUrl(apiURL)
}
proxyHost := cfg.Get("proxyHost")
proxyPort, err := strconv.Atoi(cfg.Get("proxyPort"))
if err == nil && proxyPort != 0 && proxyHost != "" {
cli.SetProxyConfiguration(proxyConf(proxyHost, proxyPort))
}
cli.SetHTTPTransportSettings(connectionConf())
return cli
}