本文整理匯總了Golang中github.com/juju/juju/mongo.Version類的典型用法代碼示例。如果您正苦於以下問題:Golang Version類的具體用法?Golang Version怎麽用?Golang Version使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Version類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: ensureServiceInstalled
func (f *fakeRunCommand) ensureServiceInstalled(dataDir string, statePort, oplogSizeMB int, setNumaControlPolicy bool, version mongo.Version, auth bool) error {
ran := []string{"mongo.EnsureServiceInstalled",
dataDir,
strconv.Itoa(statePort),
strconv.Itoa(oplogSizeMB),
strconv.FormatBool(setNumaControlPolicy),
version.String(),
strconv.FormatBool(auth)}
f.ranCommands = append(f.ranCommands, ran)
return nil
}
示例2: maybeStopMongo
func (a *MachineAgent) maybeStopMongo(ver mongo.Version, isMaster bool) error {
if !a.mongoInitialized {
return nil
}
conf := a.AgentConfigWriter.CurrentConfig()
v := conf.MongoVersion()
logger.Errorf("Got version change %v", ver)
// TODO(perrito666) replace with "read-only" mode for environment when
// it is available.
if ver.NewerThan(v) > 0 {
err := a.AgentConfigWriter.ChangeConfig(func(config agent.ConfigSetter) error {
config.SetMongoVersion(mongo.MongoUpgrade)
return nil
})
if err != nil {
return err
}
}
return nil
}
示例3: SetMongoVersion
// SetMongoVersion implements configSetterOnly.
func (c *configInternal) SetMongoVersion(v mongo.Version) {
c.mongoVersion = v.String()
}