本文整理汇总了Golang中king/rpc.RpcReply.Response方法的典型用法代码示例。如果您正苦于以下问题:Golang RpcReply.Response方法的具体用法?Golang RpcReply.Response怎么用?Golang RpcReply.Response使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类king/rpc.RpcReply
的用法示例。
在下文中一共展示了RpcReply.Response方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: CheckDeployPath
func (h *RpcClient) CheckDeployPath(r *http.Request, args *rpc.CheckDeployPathArgs, reply *rpc.RpcReply) error {
if err := utils.PathEnable(args.Path); err != nil {
reply.Response = err.Error()
} else {
reply.Response = true
}
return nil
}
示例2: Deploy
func (h *RpcClient) Deploy(r *http.Request, args *rpc.SimpleArgs, reply *rpc.RpcReply) error {
host.Active(args.Id)
task.Trigger("host.Deploy")
reply.Response = true
return nil
}
示例3: DeployStatue
func (h *RpcServer) DeployStatue(r *http.Request, args *rpc.SimpleArgs, reply *rpc.RpcReply) error {
c := client.FindFromCache(args.Id)
c.SetMessage(args.Message)
webSocket.BroadCastAll(&webSocket.Message{
Method: "deploy",
Params: args,
})
switch args.What {
case deployEnum.Error:
c.SetError(args.Message)
c.SetMessage()
c.SetBusy(false)
break
case deployEnum.Finish:
c.SetError()
c.SetMessage()
c.SetBusy(false)
break
}
reply.Response = true
return nil
}
示例4: ReportUsage
func (h *RpcServer) ReportUsage(r *http.Request, args *rpc.UsageArgs, reply *rpc.RpcReply) error {
if args.Id > 0 {
client.UpdateUsage(args.Id, args.CPUPercent, args.MEMPercent)
}
reply.Response = true
return nil
}
示例5: Status
func (h *RpcServer) Status(r *http.Request, args *JSON.Type, reply *rpc.RpcReply) error {
reply.Response = JSON.Type{
"Ip": "ok",
"Status": "ok",
}
return nil
}
示例6: GetBackupList
func (h *RpcClient) GetBackupList(r *http.Request, args *rpc.SimpleArgs, reply *rpc.RpcReply) error {
host.Active(args.Id)
result, err := host.GetBackupList()
if err != nil {
return err
}
reply.Response = result
return nil
}
示例7: Revert
func (h *RpcClient) Revert(r *http.Request, args *rpc.SimpleArgs, reply *rpc.RpcReply) error {
host.Active(args.Id)
err := host.Revert(args.Message)
if err != nil {
return err
}
reply.Response = true
return nil
}
示例8: Active
//客户端启动通知,保存客户端入库
func (h *RpcServer) Active(r *http.Request, args *rpc.ActiveArgs, reply *rpc.RpcReply) error {
id, err := client.Active(&model.WebServer{
Ip: args.Ip,
InternalIp: args.InternalIp,
Port: args.Port,
})
if err != nil {
return helper.NewError("add client error", err)
}
reply.Response = id
return nil
}
示例9: ShowLog
func (h *RpcClient) ShowLog(r *http.Request, args *rpc.SimpleArgs, reply *rpc.RpcReply) error {
host.Active(args.Id)
output, err := host.ShowLog()
reply.Response = output
return err
}
示例10: Update
func (h *RpcClient) Update(r *http.Request, args *rpc.UpdateArgs, reply *rpc.RpcReply) error {
host.Active(args.Id)
reply.Response = host.Update(args)
return nil
}
示例11: BroadCastAll
func (h *RpcServer) BroadCastAll(r *http.Request, args *webSocket.Message, reply *rpc.RpcReply) error {
webSocket.BroadCastAll(args)
reply.Response = true
return nil
}
示例12: Message
func (h *RpcServer) Message(r *http.Request, args *JSON.Type, reply *rpc.RpcReply) error {
reply.Response = args
return nil
}