本文整理汇总了Golang中github.com/vmware/govmomi/vim25/types.Extension.ShownInSolutionManager方法的典型用法代码示例。如果您正苦于以下问题:Golang Extension.ShownInSolutionManager方法的具体用法?Golang Extension.ShownInSolutionManager怎么用?Golang Extension.ShownInSolutionManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/vmware/govmomi/vim25/types.Extension
的用法示例。
在下文中一共展示了Extension.ShownInSolutionManager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Register
// Register installs an extension to the target
func (p *Pluginator) Register() error {
defer trace.End(trace.Begin(""))
var err error
if !p.connected {
return errors.New("not connected")
}
desc := types.Description{
Label: p.info.Name,
Summary: p.info.Summary,
}
e := types.Extension{
Key: p.info.Key,
Version: p.info.Version,
Company: p.info.Company,
Description: &desc,
}
eci := types.ExtensionClientInfo{
Version: p.info.Version,
Company: p.info.Company,
Description: &desc,
Type: p.info.Type,
Url: p.info.URL,
}
e.Client = append(e.Client, eci)
d := types.KeyValue{
Key: "name",
Value: p.info.Name,
}
eri := types.ExtensionResourceInfo{
Locale: "en_US",
Module: "name",
}
eri.Data = append(eri.Data, d)
e.ResourceList = append(e.ResourceList, eri)
// HTTPS requires extension server info
if strings.HasPrefix(strings.ToLower(p.info.URL), "https://") {
esi := types.ExtensionServerInfo{
Url: p.info.URL,
Description: &desc,
Company: p.info.Company,
Type: "HTTPS",
AdminEmail: []string{"[email protected]"},
ServerThumbprint: p.info.ServerThumbprint,
}
e.Server = append(e.Server, esi)
}
e.ShownInSolutionManager = &p.info.ShowInSolutionManager
e.LastHeartbeatTime = time.Now().UTC()
err = p.ExtensionManager.Register(p.Context, e)
if err != nil {
return err
}
return nil
}