本文整理汇总了Golang中github.com/juju/utils/proxy.Settings.AsScriptEnvironment方法的典型用法代码示例。如果您正苦于以下问题:Golang Settings.AsScriptEnvironment方法的具体用法?Golang Settings.AsScriptEnvironment怎么用?Golang Settings.AsScriptEnvironment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/juju/utils/proxy.Settings
的用法示例。
在下文中一共展示了Settings.AsScriptEnvironment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: TestAsScriptEnvironmentOneValue
func (s *proxySuite) TestAsScriptEnvironmentOneValue(c *gc.C) {
proxies := proxy.Settings{
Http: "some-value",
}
expected := `
export http_proxy=some-value
export HTTP_PROXY=some-value`[1:]
c.Assert(proxies.AsScriptEnvironment(), gc.Equals, expected)
}
示例2: TestAsScriptEnvironmentAllValue
func (s *proxySuite) TestAsScriptEnvironmentAllValue(c *gc.C) {
proxies := proxy.Settings{
Http: "some-value",
Https: "special",
Ftp: "who uses this?",
NoProxy: "10.0.3.1,localhost",
}
expected := `
export http_proxy=some-value
export HTTP_PROXY=some-value
export https_proxy=special
export HTTPS_PROXY=special
export ftp_proxy=who uses this?
export FTP_PROXY=who uses this?
export no_proxy=10.0.3.1,localhost
export NO_PROXY=10.0.3.1,localhost`[1:]
c.Assert(proxies.AsScriptEnvironment(), gc.Equals, expected)
}
示例3: TestAsScriptEnvironmentEmpty
func (s *proxySuite) TestAsScriptEnvironmentEmpty(c *gc.C) {
proxies := proxy.Settings{}
c.Assert(proxies.AsScriptEnvironment(), gc.Equals, "")
}