• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang gopy.Convert函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/skyrings/skyring-common/tools/gopy.Convert函数的典型用法代码示例。如果您正苦于以下问题:Golang Convert函数的具体用法?Golang Convert怎么用?Golang Convert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Convert函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: GetNodeNetwork

func (s Salt) GetNodeNetwork(node string, ctxt string) (n models.Network, err error) {
	mutex.Lock()
	defer mutex.Unlock()
	if pyobj, loc_err := pyFuncs["GetNodeNetwork"].Call(node, ctxt); loc_err == nil {
		err = gopy.Convert(python.PyDict_GetItemString(pyobj, node), &n)
	} else {
		err = loc_err
	}
	return
}
开发者ID:skyrings,项目名称:skyring,代码行数:10,代码来源:salt.go


示例2: GetNodeMemory

func (s Salt) GetNodeMemory(node string, ctxt string) (memory models.Memory, err error) {
	mutex.Lock()
	defer mutex.Unlock()
	if pyobj, loc_err := pyFuncs["GetNodeMemory"].Call(node, ctxt); loc_err == nil {
		err = gopy.Convert(python.PyDict_GetItemString(pyobj, node), &memory)
	} else {
		err = loc_err
	}
	return
}
开发者ID:skyrings,项目名称:skyring,代码行数:10,代码来源:salt.go


示例3: GetJournalDeviceDetails

func (c Salt) GetJournalDeviceDetails(node string, journalPath string, ctxt string) (devDet backend.DeviceDetail, err error) {
	mutex.Lock()
	defer mutex.Unlock()
	if pyobj, loc_err := pyFuncs["GetJournalDeviceDetails"].Call(node, journalPath, ctxt); loc_err == nil {
		err = gopy.Convert(pyobj, &devDet)
	} else {
		err = loc_err
	}
	return
}
开发者ID:skyrings,项目名称:bigfin,代码行数:10,代码来源:salt.go


示例4: NodeUptime

func (s Salt) NodeUptime(node string, ctxt string) (uptime string, err error) {
	mutex.Lock()
	defer mutex.Unlock()
	if pyobj, loc_err := pyFuncs["NodeUptime"].Call(node, ctxt); loc_err == nil {
		err = gopy.Convert(pyobj, &uptime)
	} else {
		err = loc_err
	}
	return
}
开发者ID:skyrings,项目名称:skyring,代码行数:10,代码来源:salt.go


示例5: GetFingerPrint

func (s Salt) GetFingerPrint(node string, ctxt string) (fingerprint string, err error) {
	mutex.Lock()
	defer mutex.Unlock()
	if pyobj, loc_err := pyFuncs["GetFingerPrint"].Call(node, ctxt); loc_err == nil {
		err = gopy.Convert(python.PyDict_GetItemString(pyobj, node), &fingerprint)
	} else {
		err = loc_err
	}
	return
}
开发者ID:skyrings,项目名称:skyring,代码行数:10,代码来源:salt.go


示例6: SetupSkynetService

func (s Salt) SetupSkynetService(node string, ctxt string) (status bool, err error) {
	mutex.Lock()
	defer mutex.Unlock()
	if pyobj, loc_err := pyFuncs["SetupSkynetService"].Call(node, ctxt); loc_err == nil {
		err = gopy.Convert(pyobj, &status)
	} else {
		err = loc_err
	}
	return
}
开发者ID:skyrings,项目名称:skyring,代码行数:10,代码来源:salt.go


示例7: GetNodes

func (s Salt) GetNodes(ctxt string) (nodes backend.NodeList, err error) {
	mutex.Lock()
	defer mutex.Unlock()
	if pyobj, loc_err := pyFuncs["GetNodes"].Call(ctxt); loc_err == nil {
		err = gopy.Convert(pyobj, &nodes)
	} else {
		err = loc_err
	}
	return
}
开发者ID:skyrings,项目名称:skyring,代码行数:10,代码来源:salt.go


示例8: GetNodeOs

func (s Salt) GetNodeOs(node string, ctxt string) (os models.OperatingSystem, err error) {
	mutex.Lock()
	defer mutex.Unlock()
	if pyobj, loc_err := pyFuncs["GetNodeOs"].Call(node, ctxt); loc_err == nil {
		err = gopy.Convert(python.PyDict_GetItemString(pyobj, node), &os)
	} else {
		err = loc_err
	}
	return
}
开发者ID:skyrings,项目名称:skyring,代码行数:10,代码来源:salt.go


示例9: GetServiceCount

func (c Salt) GetServiceCount(Hostname string, ctxt string) (service_details map[string]int, err error) {
	service_details = make(map[string]int)
	mutex.Lock()
	defer mutex.Unlock()
	if pyobj, loc_err := pyFuncs["GetServiceCount"].Call(Hostname, ctxt); loc_err == nil {
		err = gopy.Convert(pyobj, &service_details)
	} else {
		err = loc_err
	}
	return
}
开发者ID:skyrings,项目名称:bigfin,代码行数:11,代码来源:salt.go


示例10: UpdateMonitoringConfiguration

func (s Salt) UpdateMonitoringConfiguration(nodes []string, config []monitoring.Plugin, ctxt string) (failed_nodes map[string]string, err error) {
	failed_nodes = make(map[string]string)
	mutex.Lock()
	defer mutex.Unlock()
	if pyobj, loc_err := pyFuncs["UpdateMonitoringConfiguration"].Call(nodes, monitoring.ToSaltPillarCompat(config), ctxt); loc_err == nil {
		err = gopy.Convert(pyobj, &failed_nodes)
	} else {
		err = loc_err
	}
	return
}
开发者ID:skyrings,项目名称:skyring,代码行数:11,代码来源:salt.go


示例11: ListPoolNames

func (s Salt) ListPoolNames(mon string, clusterName string, ctxt string) (names []string, err error) {
	mutex.Lock()
	defer mutex.Unlock()
	if pyobj, loc_err := pyFuncs["ListPool"].Call(mon, clusterName, ctxt); loc_err == nil {
		err = gopy.Convert(pyobj, &names)
	} else {
		err = loc_err
	}

	return
}
开发者ID:skyrings,项目名称:bigfin,代码行数:11,代码来源:salt.go


示例12: SyncModules

func (s Salt) SyncModules(node string, ctxt string) (status bool, err error) {
	mutex.Lock()
	defer mutex.Unlock()
	if pyobj, loc_err := pyFuncs["SyncModules"].Call(node, ctxt); loc_err == nil {
		err = gopy.Convert(pyobj, &status)
	} else {
		status = false
		err = loc_err
	}
	return
}
开发者ID:skyrings,项目名称:skyring,代码行数:11,代码来源:salt.go


示例13: AcceptNode

func (s Salt) AcceptNode(node string, fingerprint string, ignored bool, ctxt string) (status bool, err error) {
	mutex.Lock()
	defer mutex.Unlock()
	if pyobj, loc_err := pyFuncs["AcceptNode"].Call(node, fingerprint, ignored, ctxt); loc_err == nil {
		err = gopy.Convert(pyobj, &status)
	} else {
		status = false
		err = loc_err
	}
	return
}
开发者ID:skyrings,项目名称:skyring,代码行数:11,代码来源:salt.go


示例14: GetCpuMetricFromCollectd

func (s Salt) GetCpuMetricFromCollectd(nodes []string, ctxt string) (result map[string]models.CollectdCpuMetric, err error) {
	mutex.Lock()
	defer mutex.Unlock()
	result = make(map[string]models.CollectdCpuMetric)
	if pyobj, loc_err := pyFuncs["GetSingleValuedMetricFromCollectd"].Call(nodes, monitoring.CPU, ctxt); loc_err == nil {
		err = gopy.Convert(pyobj, &result)
	} else {
		err = loc_err
	}
	return
}
开发者ID:skyrings,项目名称:skyring,代码行数:11,代码来源:salt.go


示例15: EnableService

func (s Salt) EnableService(node string, service string, start bool, ctxt string) (status bool, err error) {
	mutex.Lock()
	defer mutex.Unlock()
	if pyobj, loc_err := pyFuncs["EnableService"].Call(node, service, start, ctxt); loc_err == nil {
		err = gopy.Convert(pyobj, &status)
	} else {
		status = false
		err = loc_err
	}
	return
}
开发者ID:skyrings,项目名称:skyring,代码行数:11,代码来源:salt.go


示例16: GetSingleValuedMetricFromCollectd

func (s Salt) GetSingleValuedMetricFromCollectd(nodes []string, metricName string, ctxt string) (result map[string]models.CollectdSingleValuedMetric, err error) {
	mutex.Lock()
	defer mutex.Unlock()
	result = make(map[string]models.CollectdSingleValuedMetric)
	if pyobj, loc_err := pyFuncs["GetSingleValuedMetricFromCollectd"].CallWithTimeOut(5*time.Minute, nodes, metricName, ctxt); loc_err == nil {
		err = gopy.Convert(pyobj, &result)
	} else {
		err = loc_err
	}
	return
}
开发者ID:skyrings,项目名称:skyring,代码行数:11,代码来源:salt.go


示例17: GetClusterStatus

func (s Salt) GetClusterStatus(mon string, clusterId uuid.UUID, clusterName string, ctxt string) (status string, err error) {
	mutex.Lock()
	defer mutex.Unlock()
	if pyobj, loc_err := pyFuncs["GetClusterStatus"].Call(mon, clusterName, ctxt); loc_err == nil {
		err = gopy.Convert(pyobj, &status)
	} else {
		err = loc_err
	}

	return
}
开发者ID:skyrings,项目名称:bigfin,代码行数:11,代码来源:salt.go


示例18: RemoveMonitoringPlugin

func (s Salt) RemoveMonitoringPlugin(nodes []string, pluginName string, ctxt string) (failed_nodes map[string]string, err error) {
	failed_nodes = make(map[string]string)
	mutex.Lock()
	defer mutex.Unlock()
	pyobj, loc_err := pyFuncs["RemoveMonitoringPlugin"].Call(nodes, pluginName, ctxt)
	if loc_err == nil {
		err = gopy.Convert(pyobj, &failed_nodes)
	} else {
		err = loc_err
	}
	return
}
开发者ID:skyrings,项目名称:skyring,代码行数:12,代码来源:salt.go


示例19: AddMonitoringPlugin

func (s Salt) AddMonitoringPlugin(pluginNames []string, nodes []string, master string, pluginMap map[string]map[string]string, ctxt string) (failed_nodes map[string]interface{}, err error) {
	mutex.Lock()
	defer mutex.Unlock()
	failed_nodes = make(map[string]interface{})
	pyobj, loc_err := pyFuncs["AddMonitoringPlugin"].Call(pluginNames, nodes, master, pluginMap, ctxt)
	if loc_err == nil {
		err = gopy.Convert(pyobj, &failed_nodes)
	} else {
		err = loc_err
	}
	return
}
开发者ID:skyrings,项目名称:skyring,代码行数:12,代码来源:salt.go


示例20: AddOSD

func (s Salt) AddOSD(clusterName string, osd backend.OSD, ctxt string) (osds map[string][]string, err error) {
	mutex.Lock()
	defer mutex.Unlock()
	osdMap := make(map[string][]string)
	if pyobj, loc_err := pyFuncs["AddOSD"].Call(clusterName, osd, ctxt); loc_err == nil {
		err = gopy.Convert(pyobj, &osdMap)
		osds = osdMap
	} else {
		err = loc_err
	}

	return
}
开发者ID:skyrings,项目名称:bigfin,代码行数:13,代码来源:salt.go



注:本文中的github.com/skyrings/skyring-common/tools/gopy.Convert函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang logger.Get函数代码示例发布时间:2022-05-28
下一篇:
Golang models.AppEvent类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap