本文整理匯總了Golang中github.com/juju/juju/tools.Filter.Series方法的典型用法代碼示例。如果您正苦於以下問題:Golang Filter.Series方法的具體用法?Golang Filter.Series怎麽用?Golang Filter.Series使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/juju/juju/tools.Filter
的用法示例。
在下文中一共展示了Filter.Series方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: findBootstrapTools
// findBootstrapTools returns a tools.List containing only those tools with
// which it would be reasonable to launch an environment's first machine,
// given the supplied constraints. If a specific agent version is not requested,
// all tools matching the current major.minor version are chosen.
func findBootstrapTools(env environs.Environ, vers *version.Number, arch, series *string) (list coretools.List, err error) {
// Construct a tools filter.
cliVersion := jujuversion.Current
var filter coretools.Filter
if arch != nil {
filter.Arch = *arch
}
if series != nil {
filter.Series = *series
}
if vers != nil {
filter.Number = *vers
}
stream := envtools.PreferredStream(vers, env.Config().Development(), env.Config().AgentStream())
return findTools(env, cliVersion.Major, cliVersion.Minor, stream, filter)
}