Ai
70 Star 93 Fork 79

openEuler/PilotGo-plugins

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

搜索帮助