本文整理汇总了Golang中github.com/juju/juju/apiserver/params.StringResult类的典型用法代码示例。如果您正苦于以下问题:Golang StringResult类的具体用法?Golang StringResult怎么用?Golang StringResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StringResult类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: CurrentEnvironUUID
// CurrentEnvironUUID returns the UUID for the current juju environment.
func (u *UniterAPI) CurrentEnvironUUID() (params.StringResult, error) {
result := params.StringResult{}
env, err := u.st.Environment()
if err == nil {
result.Result = env.UUID()
}
return result, err
}
示例2: ProviderType
// ProviderType returns the provider type used by the current juju
// model.
//
// TODO(dimitern): Refactor the uniter to call this instead of calling
// ModelConfig() just to get the provider type. Once we have machine
// addresses, this might be completely unnecessary though.
func (u *UniterAPIV3) ProviderType() (params.StringResult, error) {
result := params.StringResult{}
cfg, err := u.st.ModelConfig()
if err == nil {
result.Result = cfg.Type()
}
return result, err
}
示例3: ProviderType
// ProviderType returns the provider type used by the current juju
// environment.
//
// TODO(dimitern): Refactor the uniter to call this instead of calling
// EnvironConfig() just to get the provider type. Once we have machine
// addresses, this might be completely unnecessary though.
func (u *uniterBaseAPI) ProviderType() (params.StringResult, error) {
result := params.StringResult{}
cfg, err := u.st.EnvironConfig()
if err == nil {
result.Result = cfg.Type()
}
return result, err
}