3 Star 2 Fork 0

info-superbahn-ict/superbahn

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
impl_delete.go 1022 Bytes
一键复制 编辑 原始数据 按行查看 历史
Fhl 提交于 2021-12-06 11:54 . 1206 update
package commands_nervous
import (
"context"
"encoding/json"
"fmt"
"gitee.com/info-superbahn-ict/superbahn/internal/supbctl/supbagent/options"
"gitee.com/info-superbahn-ict/superbahn/pkg/supbagent/clireq"
kafkaNervous "gitee.com/info-superbahn-ict/superbahn/pkg/supbnervous/kafka-nervous"
"gitee.com/info-superbahn-ict/superbahn/sync/define"
)
func deleteImpl(ctx context.Context, opt *options.AgentOpts, args []string) error {
if len(args) < 1 {
return fmt.Errorf("please add guid")
}
guid := args[0]
req := clireq.ClientRequest{
Guid: guid,
}
reqBytes, err := json.Marshal(req)
if err != nil {
return fmt.Errorf("marshal req %v", err)
}
Nic, err := kafkaNervous.NewNervous(ctx, opt.ConfigPath, "CLI")
if err != nil {
return fmt.Errorf("new %v", err)
}
resp, err := Nic.RPCCallCustom(opt.AgentGuid, tryTime, tryInterval, define.RPCFunctionNameOfAgentForDeleteObject, string(reqBytes))
if err != nil {
return fmt.Errorf("call get %v", err)
}
fmt.Printf("%s", resp)
return nil
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/info-superbahn-ict/superbahn.git
git@gitee.com:info-superbahn-ict/superbahn.git
info-superbahn-ict
superbahn
superbahn
5fda629dab96

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385