本文整理汇总了Golang中github.com/juju/juju/version.Binary.Series方法的典型用法代码示例。如果您正苦于以下问题:Golang Binary.Series方法的具体用法?Golang Binary.Series怎么用?Golang Binary.Series使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/juju/juju/version.Binary
的用法示例。
在下文中一共展示了Binary.Series方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: makeToolsList
func makeToolsList(series string) tools.List {
var toolsVersion version.Binary
toolsVersion.Number = version.MustParse("1.26.0")
toolsVersion.Arch = arch.AMD64
toolsVersion.Series = series
return tools.List{{
Version: toolsVersion,
URL: fmt.Sprintf("http://example.com/tools/juju-%s.tgz", toolsVersion),
SHA256: "1234567890abcdef",
Size: 1024,
}}
}
示例2: UploadFakeTools
// UploadFakeTools uploads fake tools of the architectures in
// s.UploadArches for each LTS release to the specified storage.
func (s *ToolsFixture) UploadFakeTools(c *gc.C, stor storage.Storage, toolsDir, stream string) {
arches := s.UploadArches
if len(arches) == 0 {
arches = []string{arch.HostArch()}
}
var versions []version.Binary
for _, arch := range arches {
v := version.Binary{
Number: version.Current,
Arch: arch,
}
for _, series := range toolsLtsSeries {
v.Series = series
versions = append(versions, v)
}
}
_, err := UploadFakeToolsVersions(stor, toolsDir, stream, versions...)
c.Assert(err, jc.ErrorIsNil)
}
示例3: RemoveFakeTools
// RemoveFakeTools deletes the fake tools from the supplied storage.
func RemoveFakeTools(c *gc.C, stor storage.Storage, toolsDir string) {
c.Logf("removing fake tools")
toolsVersion := version.Binary{
Number: version.Current,
Arch: arch.HostArch(),
Series: series.HostSeries(),
}
name := envtools.StorageName(toolsVersion, toolsDir)
err := stor.Remove(name)
c.Check(err, jc.ErrorIsNil)
defaultSeries := coretesting.FakeDefaultSeries
if series.HostSeries() != defaultSeries {
toolsVersion.Series = defaultSeries
name := envtools.StorageName(toolsVersion, toolsDir)
err := stor.Remove(name)
c.Check(err, jc.ErrorIsNil)
}
RemoveFakeToolsMetadata(c, stor)
}