本文整理汇总了Golang中github.com/skyrings/skyring-common/tools/gopy.Convert函数的典型用法代码示例。如果您正苦于以下问题:Golang Convert函数的具体用法?Golang Convert怎么用?Golang Convert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Convert函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}