// Code generated by protoc-gen-micro. DO NOT EDIT.
|
// source: aiot_business.proto
|
|
package aiot
|
|
import (
|
fmt "fmt"
|
proto "github.com/golang/protobuf/proto"
|
math "math"
|
)
|
|
import (
|
context "context"
|
client "github.com/micro/go-micro/client"
|
server "github.com/micro/go-micro/server"
|
)
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
var _ = proto.Marshal
|
var _ = fmt.Errorf
|
var _ = math.Inf
|
|
// This is a compile-time assertion to ensure that this generated file
|
// is compatible with the proto package it is being compiled against.
|
// A compilation error at this line likely means your copy of the
|
// proto package needs to be updated.
|
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
var _ context.Context
|
var _ client.Option
|
var _ server.Option
|
|
// Client API for AiotService service
|
|
type AiotService interface {
|
// 发送指向单个设备的请求
|
SendToNode(ctx context.Context, in *NodeReq, opts ...client.CallOption) (*BusinessReply, error)
|
// 直接发送同步tcp请求
|
SendAiotSyncReq(ctx context.Context, in *Protocol, opts ...client.CallOption) (*BusinessReply, error)
|
// 直接发送异步tcp请求
|
SendAiotAsyncReq(ctx context.Context, in *Protocol, opts ...client.CallOption) (*BusinessReply, error)
|
// 发送群组请求
|
SendToCluster(ctx context.Context, in *ClusterReq, opts ...client.CallOption) (*BusinessReply, error)
|
// 向多个设备同时发起相同参数请求
|
SendToNodes(ctx context.Context, in *NodesReq, opts ...client.CallOption) (*BusinessReply, error)
|
}
|
|
type aiotService struct {
|
c client.Client
|
name string
|
}
|
|
func NewAiotService(name string, c client.Client) AiotService {
|
if c == nil {
|
c = client.NewClient()
|
}
|
if len(name) == 0 {
|
name = "aiot"
|
}
|
return &aiotService{
|
c: c,
|
name: name,
|
}
|
}
|
|
func (c *aiotService) SendToNode(ctx context.Context, in *NodeReq, opts ...client.CallOption) (*BusinessReply, error) {
|
req := c.c.NewRequest(c.name, "AiotService.SendToNode", in)
|
out := new(BusinessReply)
|
err := c.c.Call(ctx, req, out, opts...)
|
if err != nil {
|
return nil, err
|
}
|
return out, nil
|
}
|
|
func (c *aiotService) SendAiotSyncReq(ctx context.Context, in *Protocol, opts ...client.CallOption) (*BusinessReply, error) {
|
req := c.c.NewRequest(c.name, "AiotService.SendAiotSyncReq", in)
|
out := new(BusinessReply)
|
err := c.c.Call(ctx, req, out, opts...)
|
if err != nil {
|
return nil, err
|
}
|
return out, nil
|
}
|
|
func (c *aiotService) SendAiotAsyncReq(ctx context.Context, in *Protocol, opts ...client.CallOption) (*BusinessReply, error) {
|
req := c.c.NewRequest(c.name, "AiotService.SendAiotAsyncReq", in)
|
out := new(BusinessReply)
|
err := c.c.Call(ctx, req, out, opts...)
|
if err != nil {
|
return nil, err
|
}
|
return out, nil
|
}
|
|
func (c *aiotService) SendToCluster(ctx context.Context, in *ClusterReq, opts ...client.CallOption) (*BusinessReply, error) {
|
req := c.c.NewRequest(c.name, "AiotService.SendToCluster", in)
|
out := new(BusinessReply)
|
err := c.c.Call(ctx, req, out, opts...)
|
if err != nil {
|
return nil, err
|
}
|
return out, nil
|
}
|
|
func (c *aiotService) SendToNodes(ctx context.Context, in *NodesReq, opts ...client.CallOption) (*BusinessReply, error) {
|
req := c.c.NewRequest(c.name, "AiotService.SendToNodes", in)
|
out := new(BusinessReply)
|
err := c.c.Call(ctx, req, out, opts...)
|
if err != nil {
|
return nil, err
|
}
|
return out, nil
|
}
|
|
// Server API for AiotService service
|
|
type AiotServiceHandler interface {
|
// 发送指向单个设备的请求
|
SendToNode(context.Context, *NodeReq, *BusinessReply) error
|
// 直接发送同步tcp请求
|
SendAiotSyncReq(context.Context, *Protocol, *BusinessReply) error
|
// 直接发送异步tcp请求
|
SendAiotAsyncReq(context.Context, *Protocol, *BusinessReply) error
|
// 发送群组请求
|
SendToCluster(context.Context, *ClusterReq, *BusinessReply) error
|
// 向多个设备同时发起相同参数请求
|
SendToNodes(context.Context, *NodesReq, *BusinessReply) error
|
}
|
|
func RegisterAiotServiceHandler(s server.Server, hdlr AiotServiceHandler, opts ...server.HandlerOption) error {
|
type aiotService interface {
|
SendToNode(ctx context.Context, in *NodeReq, out *BusinessReply) error
|
SendAiotSyncReq(ctx context.Context, in *Protocol, out *BusinessReply) error
|
SendAiotAsyncReq(ctx context.Context, in *Protocol, out *BusinessReply) error
|
SendToCluster(ctx context.Context, in *ClusterReq, out *BusinessReply) error
|
SendToNodes(ctx context.Context, in *NodesReq, out *BusinessReply) error
|
}
|
type AiotService struct {
|
aiotService
|
}
|
h := &aiotServiceHandler{hdlr}
|
return s.Handle(s.NewHandler(&AiotService{h}, opts...))
|
}
|
|
type aiotServiceHandler struct {
|
AiotServiceHandler
|
}
|
|
func (h *aiotServiceHandler) SendToNode(ctx context.Context, in *NodeReq, out *BusinessReply) error {
|
return h.AiotServiceHandler.SendToNode(ctx, in, out)
|
}
|
|
func (h *aiotServiceHandler) SendAiotSyncReq(ctx context.Context, in *Protocol, out *BusinessReply) error {
|
return h.AiotServiceHandler.SendAiotSyncReq(ctx, in, out)
|
}
|
|
func (h *aiotServiceHandler) SendAiotAsyncReq(ctx context.Context, in *Protocol, out *BusinessReply) error {
|
return h.AiotServiceHandler.SendAiotAsyncReq(ctx, in, out)
|
}
|
|
func (h *aiotServiceHandler) SendToCluster(ctx context.Context, in *ClusterReq, out *BusinessReply) error {
|
return h.AiotServiceHandler.SendToCluster(ctx, in, out)
|
}
|
|
func (h *aiotServiceHandler) SendToNodes(ctx context.Context, in *NodesReq, out *BusinessReply) error {
|
return h.AiotServiceHandler.SendToNodes(ctx, in, out)
|
}
|