Ai
70 Star 93 Fork 79

openEuler/PilotGo-plugins

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
machine.go 480 Bytes
一键复制 编辑 原始数据 按行查看 历史
guozhengxin1999 提交于 2023-06-16 09:26 +08:00 . fix httputils response error
package client
import (
"encoding/json"
"gitee.com/openeuler/PilotGo-plugins/sdk/common"
"gitee.com/openeuler/PilotGo-plugins/sdk/utils/httputils"
)
func (c *Client) MachineList() ([]*common.MachineNode, error) {
url := c.Server + "/api/v1/pluginapi/machine_list"
r, err := httputils.Get(url, nil)
if err != nil {
return nil, err
}
result := []*common.MachineNode{}
if err := json.Unmarshal(r.Body, &result); err != nil {
return nil, err
}
return result, nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openeuler/PilotGo-plugins.git
git@gitee.com:openeuler/PilotGo-plugins.git
openeuler
PilotGo-plugins
PilotGo-plugins
80198980aca1

搜索帮助