3 Star 2 Fork 0

info-superbahn-ict / superbahn

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
impl_pull.go 978 Bytes
一键复制 编辑 原始数据 按行查看 历史
tangshibo 提交于 2021-11-19 12:29 . 11-19
package commands_nervous
import (
"context"
"encoding/json"
"fmt"
"gitee.com/info-superbahn-ict/superbahn/internal/supbctl/supbmanager/options"
"gitee.com/info-superbahn-ict/superbahn/pkg/supbmanager/clireq"
kafkaNervous "gitee.com/info-superbahn-ict/superbahn/pkg/supbnervous/kafka-nervous"
"gitee.com/info-superbahn-ict/superbahn/sync/define"
)
func pullImpl(ctx context.Context,opt *options.ManagerOpts,args []string)error{
req := clireq.ClientRequest{
Names: args,
}
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)
}
//if err = Nic.Run();err!=nil{
// return fmt.Errorf("nervous run %v",err)
//}
resp,err := Nic.RPCCallCustom(define.RPCCommonGuidOfManager,tryTime,tryInterval,"pull",string(reqBytes))
if err !=nil {
return fmt.Errorf("call pull %v",err)
}
fmt.Printf("%s",resp)
return nil
}
Go
1
https://gitee.com/info-superbahn-ict/superbahn.git
git@gitee.com:info-superbahn-ict/superbahn.git
info-superbahn-ict
superbahn
superbahn
5fda629dab96

搜索帮助