本文整理匯總了Golang中github.com/juju/utils/proxy.Settings.AsEnvironmentValues方法的典型用法代碼示例。如果您正苦於以下問題:Golang Settings.AsEnvironmentValues方法的具體用法?Golang Settings.AsEnvironmentValues怎麽用?Golang Settings.AsEnvironmentValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/juju/utils/proxy.Settings
的用法示例。
在下文中一共展示了Settings.AsEnvironmentValues方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: TestAsEnvironmentValuesOneValue
func (s *proxySuite) TestAsEnvironmentValuesOneValue(c *gc.C) {
proxies := proxy.Settings{
Http: "some-value",
}
expected := []string{
"http_proxy=some-value",
"HTTP_PROXY=some-value",
}
c.Assert(proxies.AsEnvironmentValues(), gc.DeepEquals, expected)
}
示例2: TestAsEnvironmentValuesAllValue
func (s *proxySuite) TestAsEnvironmentValuesAllValue(c *gc.C) {
proxies := proxy.Settings{
Http: "some-value",
Https: "special",
Ftp: "who uses this?",
NoProxy: "10.0.3.1,localhost",
}
expected := []string{
"http_proxy=some-value",
"HTTP_PROXY=some-value",
"https_proxy=special",
"HTTPS_PROXY=special",
"ftp_proxy=who uses this?",
"FTP_PROXY=who uses this?",
"no_proxy=10.0.3.1,localhost",
"NO_PROXY=10.0.3.1,localhost",
}
c.Assert(proxies.AsEnvironmentValues(), gc.DeepEquals, expected)
}
示例3: TestAsEnvironmentValuesEmpty
func (s *proxySuite) TestAsEnvironmentValuesEmpty(c *gc.C) {
proxies := proxy.Settings{}
c.Assert(proxies.AsEnvironmentValues(), gc.HasLen, 0)
}