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