|
@@ -0,0 +1,414 @@
|
|
|
+// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
|
+// source: queue.proto
|
|
|
+
|
|
|
+//声明 包名
|
|
|
+
|
|
|
+package proto
|
|
|
+
|
|
|
+import (
|
|
|
+ context "context"
|
|
|
+ fmt "fmt"
|
|
|
+ proto "github.com/golang/protobuf/proto"
|
|
|
+ grpc "google.golang.org/grpc"
|
|
|
+ codes "google.golang.org/grpc/codes"
|
|
|
+ status "google.golang.org/grpc/status"
|
|
|
+ math "math"
|
|
|
+)
|
|
|
+
|
|
|
+// 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
|
|
|
+
|
|
|
+//任务
|
|
|
+type PubReq struct {
|
|
|
+ Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
|
|
+ ChannelId string `protobuf:"bytes,2,opt,name=channelId,proto3" json:"channelId,omitempty"`
|
|
|
+ Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"`
|
|
|
+ SerialType int32 `protobuf:"varint,4,opt,name=serial_type,json=serialType,proto3" json:"serial_type,omitempty"`
|
|
|
+ PublishType int32 `protobuf:"varint,5,opt,name=publish_type,json=publishType,proto3" json:"publish_type,omitempty"`
|
|
|
+ Param []byte `protobuf:"bytes,6,opt,name=param,proto3" json:"param,omitempty"`
|
|
|
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
+ XXX_unrecognized []byte `json:"-"`
|
|
|
+ XXX_sizecache int32 `json:"-"`
|
|
|
+}
|
|
|
+
|
|
|
+func (m *PubReq) Reset() { *m = PubReq{} }
|
|
|
+func (m *PubReq) String() string { return proto.CompactTextString(m) }
|
|
|
+func (*PubReq) ProtoMessage() {}
|
|
|
+func (*PubReq) Descriptor() ([]byte, []int) {
|
|
|
+ return fileDescriptor_96e4d7d76a734cd8, []int{0}
|
|
|
+}
|
|
|
+
|
|
|
+func (m *PubReq) XXX_Unmarshal(b []byte) error {
|
|
|
+ return xxx_messageInfo_PubReq.Unmarshal(m, b)
|
|
|
+}
|
|
|
+func (m *PubReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
+ return xxx_messageInfo_PubReq.Marshal(b, m, deterministic)
|
|
|
+}
|
|
|
+func (m *PubReq) XXX_Merge(src proto.Message) {
|
|
|
+ xxx_messageInfo_PubReq.Merge(m, src)
|
|
|
+}
|
|
|
+func (m *PubReq) XXX_Size() int {
|
|
|
+ return xxx_messageInfo_PubReq.Size(m)
|
|
|
+}
|
|
|
+func (m *PubReq) XXX_DiscardUnknown() {
|
|
|
+ xxx_messageInfo_PubReq.DiscardUnknown(m)
|
|
|
+}
|
|
|
+
|
|
|
+var xxx_messageInfo_PubReq proto.InternalMessageInfo
|
|
|
+
|
|
|
+func (m *PubReq) GetId() string {
|
|
|
+ if m != nil {
|
|
|
+ return m.Id
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+}
|
|
|
+
|
|
|
+func (m *PubReq) GetChannelId() string {
|
|
|
+ if m != nil {
|
|
|
+ return m.ChannelId
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+}
|
|
|
+
|
|
|
+func (m *PubReq) GetSender() string {
|
|
|
+ if m != nil {
|
|
|
+ return m.Sender
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+}
|
|
|
+
|
|
|
+func (m *PubReq) GetSerialType() int32 {
|
|
|
+ if m != nil {
|
|
|
+ return m.SerialType
|
|
|
+ }
|
|
|
+ return 0
|
|
|
+}
|
|
|
+
|
|
|
+func (m *PubReq) GetPublishType() int32 {
|
|
|
+ if m != nil {
|
|
|
+ return m.PublishType
|
|
|
+ }
|
|
|
+ return 0
|
|
|
+}
|
|
|
+
|
|
|
+func (m *PubReq) GetParam() []byte {
|
|
|
+ if m != nil {
|
|
|
+ return m.Param
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
+//标准字符串返回结果
|
|
|
+type PubResp struct {
|
|
|
+ Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
|
|
|
+ Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
|
|
|
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
+ XXX_unrecognized []byte `json:"-"`
|
|
|
+ XXX_sizecache int32 `json:"-"`
|
|
|
+}
|
|
|
+
|
|
|
+func (m *PubResp) Reset() { *m = PubResp{} }
|
|
|
+func (m *PubResp) String() string { return proto.CompactTextString(m) }
|
|
|
+func (*PubResp) ProtoMessage() {}
|
|
|
+func (*PubResp) Descriptor() ([]byte, []int) {
|
|
|
+ return fileDescriptor_96e4d7d76a734cd8, []int{1}
|
|
|
+}
|
|
|
+
|
|
|
+func (m *PubResp) XXX_Unmarshal(b []byte) error {
|
|
|
+ return xxx_messageInfo_PubResp.Unmarshal(m, b)
|
|
|
+}
|
|
|
+func (m *PubResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
+ return xxx_messageInfo_PubResp.Marshal(b, m, deterministic)
|
|
|
+}
|
|
|
+func (m *PubResp) XXX_Merge(src proto.Message) {
|
|
|
+ xxx_messageInfo_PubResp.Merge(m, src)
|
|
|
+}
|
|
|
+func (m *PubResp) XXX_Size() int {
|
|
|
+ return xxx_messageInfo_PubResp.Size(m)
|
|
|
+}
|
|
|
+func (m *PubResp) XXX_DiscardUnknown() {
|
|
|
+ xxx_messageInfo_PubResp.DiscardUnknown(m)
|
|
|
+}
|
|
|
+
|
|
|
+var xxx_messageInfo_PubResp proto.InternalMessageInfo
|
|
|
+
|
|
|
+func (m *PubResp) GetCode() int32 {
|
|
|
+ if m != nil {
|
|
|
+ return m.Code
|
|
|
+ }
|
|
|
+ return 0
|
|
|
+}
|
|
|
+
|
|
|
+func (m *PubResp) GetMsg() string {
|
|
|
+ if m != nil {
|
|
|
+ return m.Msg
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+}
|
|
|
+
|
|
|
+type RecvReq struct {
|
|
|
+ Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
|
|
|
+ ChannelId string `protobuf:"bytes,2,opt,name=channelId,proto3" json:"channelId,omitempty"`
|
|
|
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
+ XXX_unrecognized []byte `json:"-"`
|
|
|
+ XXX_sizecache int32 `json:"-"`
|
|
|
+}
|
|
|
+
|
|
|
+func (m *RecvReq) Reset() { *m = RecvReq{} }
|
|
|
+func (m *RecvReq) String() string { return proto.CompactTextString(m) }
|
|
|
+func (*RecvReq) ProtoMessage() {}
|
|
|
+func (*RecvReq) Descriptor() ([]byte, []int) {
|
|
|
+ return fileDescriptor_96e4d7d76a734cd8, []int{2}
|
|
|
+}
|
|
|
+
|
|
|
+func (m *RecvReq) XXX_Unmarshal(b []byte) error {
|
|
|
+ return xxx_messageInfo_RecvReq.Unmarshal(m, b)
|
|
|
+}
|
|
|
+func (m *RecvReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
+ return xxx_messageInfo_RecvReq.Marshal(b, m, deterministic)
|
|
|
+}
|
|
|
+func (m *RecvReq) XXX_Merge(src proto.Message) {
|
|
|
+ xxx_messageInfo_RecvReq.Merge(m, src)
|
|
|
+}
|
|
|
+func (m *RecvReq) XXX_Size() int {
|
|
|
+ return xxx_messageInfo_RecvReq.Size(m)
|
|
|
+}
|
|
|
+func (m *RecvReq) XXX_DiscardUnknown() {
|
|
|
+ xxx_messageInfo_RecvReq.DiscardUnknown(m)
|
|
|
+}
|
|
|
+
|
|
|
+var xxx_messageInfo_RecvReq proto.InternalMessageInfo
|
|
|
+
|
|
|
+func (m *RecvReq) GetSender() string {
|
|
|
+ if m != nil {
|
|
|
+ return m.Sender
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+}
|
|
|
+
|
|
|
+func (m *RecvReq) GetChannelId() string {
|
|
|
+ if m != nil {
|
|
|
+ return m.ChannelId
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+}
|
|
|
+
|
|
|
+func init() {
|
|
|
+ proto.RegisterType((*PubReq)(nil), "proto.PubReq")
|
|
|
+ proto.RegisterType((*PubResp)(nil), "proto.PubResp")
|
|
|
+ proto.RegisterType((*RecvReq)(nil), "proto.RecvReq")
|
|
|
+}
|
|
|
+
|
|
|
+func init() {
|
|
|
+ proto.RegisterFile("queue.proto", fileDescriptor_96e4d7d76a734cd8)
|
|
|
+}
|
|
|
+
|
|
|
+var fileDescriptor_96e4d7d76a734cd8 = []byte{
|
|
|
+ // 271 bytes of a gzipped FileDescriptorProto
|
|
|
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0x4f, 0x4b, 0xc3, 0x40,
|
|
|
+ 0x10, 0xc5, 0xbb, 0x69, 0x93, 0xd2, 0x49, 0x2c, 0x32, 0x88, 0x84, 0x22, 0x18, 0x73, 0xca, 0x41,
|
|
|
+ 0xaa, 0xe8, 0x07, 0xf0, 0xec, 0x4d, 0x57, 0xef, 0x92, 0x3f, 0x83, 0x5d, 0x49, 0x93, 0x6d, 0xb6,
|
|
|
+ 0x09, 0xf4, 0x1b, 0xf9, 0x31, 0x65, 0x67, 0x23, 0xb5, 0x17, 0x4f, 0x3b, 0xef, 0xcd, 0x5b, 0xf8,
|
|
|
+ 0xcd, 0x83, 0x70, 0xd7, 0x53, 0x4f, 0x6b, 0xdd, 0xb5, 0xfb, 0x16, 0x7d, 0x7e, 0xd2, 0x6f, 0x01,
|
|
|
+ 0xc1, 0x4b, 0x5f, 0x48, 0xda, 0xe1, 0x12, 0x3c, 0x55, 0xc5, 0x22, 0x11, 0xd9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x00, 0xff, 0xff, 0x21, 0x96, 0x01, 0xe7, 0xa5, 0x01, 0x00, 0x00,
|
|
|
+}
|
|
|
+
|
|
|
+// Reference imports to suppress errors if they are not otherwise used.
|
|
|
+var _ context.Context
|
|
|
+var _ grpc.ClientConnInterface
|
|
|
+
|
|
|
+// This is a compile-time assertion to ensure that this generated file
|
|
|
+// is compatible with the grpc package it is being compiled against.
|
|
|
+const _ = grpc.SupportPackageIsVersion6
|
|
|
+
|
|
|
+// QueueServiceClient is the client API for QueueService service.
|
|
|
+//
|
|
|
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
|
+type QueueServiceClient interface {
|
|
|
+ //任务发布
|
|
|
+ Publish(ctx context.Context, opts ...grpc.CallOption) (QueueService_PublishClient, error)
|
|
|
+ //任务接收
|
|
|
+ Receive(ctx context.Context, in *RecvReq, opts ...grpc.CallOption) (QueueService_ReceiveClient, error)
|
|
|
+}
|
|
|
+
|
|
|
+type queueServiceClient struct {
|
|
|
+ cc grpc.ClientConnInterface
|
|
|
+}
|
|
|
+
|
|
|
+func NewQueueServiceClient(cc grpc.ClientConnInterface) QueueServiceClient {
|
|
|
+ return &queueServiceClient{cc}
|
|
|
+}
|
|
|
+
|
|
|
+func (c *queueServiceClient) Publish(ctx context.Context, opts ...grpc.CallOption) (QueueService_PublishClient, error) {
|
|
|
+ stream, err := c.cc.NewStream(ctx, &_QueueService_serviceDesc.Streams[0], "/proto.QueueService/Publish", opts...)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ x := &queueServicePublishClient{stream}
|
|
|
+ return x, nil
|
|
|
+}
|
|
|
+
|
|
|
+type QueueService_PublishClient interface {
|
|
|
+ Send(*PubReq) error
|
|
|
+ CloseAndRecv() (*PubResp, error)
|
|
|
+ grpc.ClientStream
|
|
|
+}
|
|
|
+
|
|
|
+type queueServicePublishClient struct {
|
|
|
+ grpc.ClientStream
|
|
|
+}
|
|
|
+
|
|
|
+func (x *queueServicePublishClient) Send(m *PubReq) error {
|
|
|
+ return x.ClientStream.SendMsg(m)
|
|
|
+}
|
|
|
+
|
|
|
+func (x *queueServicePublishClient) CloseAndRecv() (*PubResp, error) {
|
|
|
+ if err := x.ClientStream.CloseSend(); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ m := new(PubResp)
|
|
|
+ if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return m, nil
|
|
|
+}
|
|
|
+
|
|
|
+func (c *queueServiceClient) Receive(ctx context.Context, in *RecvReq, opts ...grpc.CallOption) (QueueService_ReceiveClient, error) {
|
|
|
+ stream, err := c.cc.NewStream(ctx, &_QueueService_serviceDesc.Streams[1], "/proto.QueueService/Receive", opts...)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ x := &queueServiceReceiveClient{stream}
|
|
|
+ if err := x.ClientStream.SendMsg(in); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ if err := x.ClientStream.CloseSend(); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return x, nil
|
|
|
+}
|
|
|
+
|
|
|
+type QueueService_ReceiveClient interface {
|
|
|
+ Recv() (*PubReq, error)
|
|
|
+ grpc.ClientStream
|
|
|
+}
|
|
|
+
|
|
|
+type queueServiceReceiveClient struct {
|
|
|
+ grpc.ClientStream
|
|
|
+}
|
|
|
+
|
|
|
+func (x *queueServiceReceiveClient) Recv() (*PubReq, error) {
|
|
|
+ m := new(PubReq)
|
|
|
+ if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return m, nil
|
|
|
+}
|
|
|
+
|
|
|
+// QueueServiceServer is the server API for QueueService service.
|
|
|
+type QueueServiceServer interface {
|
|
|
+ //任务发布
|
|
|
+ Publish(QueueService_PublishServer) error
|
|
|
+ //任务接收
|
|
|
+ Receive(*RecvReq, QueueService_ReceiveServer) error
|
|
|
+}
|
|
|
+
|
|
|
+// UnimplementedQueueServiceServer can be embedded to have forward compatible implementations.
|
|
|
+type UnimplementedQueueServiceServer struct {
|
|
|
+}
|
|
|
+
|
|
|
+func (*UnimplementedQueueServiceServer) Publish(srv QueueService_PublishServer) error {
|
|
|
+ return status.Errorf(codes.Unimplemented, "method Publish not implemented")
|
|
|
+}
|
|
|
+func (*UnimplementedQueueServiceServer) Receive(req *RecvReq, srv QueueService_ReceiveServer) error {
|
|
|
+ return status.Errorf(codes.Unimplemented, "method Receive not implemented")
|
|
|
+}
|
|
|
+
|
|
|
+func RegisterQueueServiceServer(s *grpc.Server, srv QueueServiceServer) {
|
|
|
+ s.RegisterService(&_QueueService_serviceDesc, srv)
|
|
|
+}
|
|
|
+
|
|
|
+func _QueueService_Publish_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
|
+ return srv.(QueueServiceServer).Publish(&queueServicePublishServer{stream})
|
|
|
+}
|
|
|
+
|
|
|
+type QueueService_PublishServer interface {
|
|
|
+ SendAndClose(*PubResp) error
|
|
|
+ Recv() (*PubReq, error)
|
|
|
+ grpc.ServerStream
|
|
|
+}
|
|
|
+
|
|
|
+type queueServicePublishServer struct {
|
|
|
+ grpc.ServerStream
|
|
|
+}
|
|
|
+
|
|
|
+func (x *queueServicePublishServer) SendAndClose(m *PubResp) error {
|
|
|
+ return x.ServerStream.SendMsg(m)
|
|
|
+}
|
|
|
+
|
|
|
+func (x *queueServicePublishServer) Recv() (*PubReq, error) {
|
|
|
+ m := new(PubReq)
|
|
|
+ if err := x.ServerStream.RecvMsg(m); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return m, nil
|
|
|
+}
|
|
|
+
|
|
|
+func _QueueService_Receive_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
|
+ m := new(RecvReq)
|
|
|
+ if err := stream.RecvMsg(m); err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ return srv.(QueueServiceServer).Receive(m, &queueServiceReceiveServer{stream})
|
|
|
+}
|
|
|
+
|
|
|
+type QueueService_ReceiveServer interface {
|
|
|
+ Send(*PubReq) error
|
|
|
+ grpc.ServerStream
|
|
|
+}
|
|
|
+
|
|
|
+type queueServiceReceiveServer struct {
|
|
|
+ grpc.ServerStream
|
|
|
+}
|
|
|
+
|
|
|
+func (x *queueServiceReceiveServer) Send(m *PubReq) error {
|
|
|
+ return x.ServerStream.SendMsg(m)
|
|
|
+}
|
|
|
+
|
|
|
+var _QueueService_serviceDesc = grpc.ServiceDesc{
|
|
|
+ ServiceName: "proto.QueueService",
|
|
|
+ HandlerType: (*QueueServiceServer)(nil),
|
|
|
+ Methods: []grpc.MethodDesc{},
|
|
|
+ Streams: []grpc.StreamDesc{
|
|
|
+ {
|
|
|
+ StreamName: "Publish",
|
|
|
+ Handler: _QueueService_Publish_Handler,
|
|
|
+ ClientStreams: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ StreamName: "Receive",
|
|
|
+ Handler: _QueueService_Receive_Handler,
|
|
|
+ ServerStreams: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ Metadata: "queue.proto",
|
|
|
+}
|