queue.pb.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: queue.proto
  3. //声明 包名
  4. package proto
  5. import (
  6. context "context"
  7. fmt "fmt"
  8. proto "github.com/golang/protobuf/proto"
  9. grpc "google.golang.org/grpc"
  10. codes "google.golang.org/grpc/codes"
  11. status "google.golang.org/grpc/status"
  12. math "math"
  13. )
  14. // Reference imports to suppress errors if they are not otherwise used.
  15. var _ = proto.Marshal
  16. var _ = fmt.Errorf
  17. var _ = math.Inf
  18. // This is a compile-time assertion to ensure that this generated file
  19. // is compatible with the proto package it is being compiled against.
  20. // A compilation error at this line likely means your copy of the
  21. // proto package needs to be updated.
  22. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
  23. //任务
  24. type PubReq struct {
  25. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  26. ChannelId string `protobuf:"bytes,2,opt,name=channelId,proto3" json:"channelId,omitempty"`
  27. Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"`
  28. SerialType int32 `protobuf:"varint,4,opt,name=serial_type,json=serialType,proto3" json:"serial_type,omitempty"`
  29. PublishType int32 `protobuf:"varint,5,opt,name=publish_type,json=publishType,proto3" json:"publish_type,omitempty"`
  30. Param []byte `protobuf:"bytes,6,opt,name=param,proto3" json:"param,omitempty"`
  31. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  32. XXX_unrecognized []byte `json:"-"`
  33. XXX_sizecache int32 `json:"-"`
  34. }
  35. func (m *PubReq) Reset() { *m = PubReq{} }
  36. func (m *PubReq) String() string { return proto.CompactTextString(m) }
  37. func (*PubReq) ProtoMessage() {}
  38. func (*PubReq) Descriptor() ([]byte, []int) {
  39. return fileDescriptor_96e4d7d76a734cd8, []int{0}
  40. }
  41. func (m *PubReq) XXX_Unmarshal(b []byte) error {
  42. return xxx_messageInfo_PubReq.Unmarshal(m, b)
  43. }
  44. func (m *PubReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  45. return xxx_messageInfo_PubReq.Marshal(b, m, deterministic)
  46. }
  47. func (m *PubReq) XXX_Merge(src proto.Message) {
  48. xxx_messageInfo_PubReq.Merge(m, src)
  49. }
  50. func (m *PubReq) XXX_Size() int {
  51. return xxx_messageInfo_PubReq.Size(m)
  52. }
  53. func (m *PubReq) XXX_DiscardUnknown() {
  54. xxx_messageInfo_PubReq.DiscardUnknown(m)
  55. }
  56. var xxx_messageInfo_PubReq proto.InternalMessageInfo
  57. func (m *PubReq) GetId() string {
  58. if m != nil {
  59. return m.Id
  60. }
  61. return ""
  62. }
  63. func (m *PubReq) GetChannelId() string {
  64. if m != nil {
  65. return m.ChannelId
  66. }
  67. return ""
  68. }
  69. func (m *PubReq) GetSender() string {
  70. if m != nil {
  71. return m.Sender
  72. }
  73. return ""
  74. }
  75. func (m *PubReq) GetSerialType() int32 {
  76. if m != nil {
  77. return m.SerialType
  78. }
  79. return 0
  80. }
  81. func (m *PubReq) GetPublishType() int32 {
  82. if m != nil {
  83. return m.PublishType
  84. }
  85. return 0
  86. }
  87. func (m *PubReq) GetParam() []byte {
  88. if m != nil {
  89. return m.Param
  90. }
  91. return nil
  92. }
  93. //标准字符串返回结果
  94. type PubResp struct {
  95. Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
  96. Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
  97. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  98. XXX_unrecognized []byte `json:"-"`
  99. XXX_sizecache int32 `json:"-"`
  100. }
  101. func (m *PubResp) Reset() { *m = PubResp{} }
  102. func (m *PubResp) String() string { return proto.CompactTextString(m) }
  103. func (*PubResp) ProtoMessage() {}
  104. func (*PubResp) Descriptor() ([]byte, []int) {
  105. return fileDescriptor_96e4d7d76a734cd8, []int{1}
  106. }
  107. func (m *PubResp) XXX_Unmarshal(b []byte) error {
  108. return xxx_messageInfo_PubResp.Unmarshal(m, b)
  109. }
  110. func (m *PubResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  111. return xxx_messageInfo_PubResp.Marshal(b, m, deterministic)
  112. }
  113. func (m *PubResp) XXX_Merge(src proto.Message) {
  114. xxx_messageInfo_PubResp.Merge(m, src)
  115. }
  116. func (m *PubResp) XXX_Size() int {
  117. return xxx_messageInfo_PubResp.Size(m)
  118. }
  119. func (m *PubResp) XXX_DiscardUnknown() {
  120. xxx_messageInfo_PubResp.DiscardUnknown(m)
  121. }
  122. var xxx_messageInfo_PubResp proto.InternalMessageInfo
  123. func (m *PubResp) GetCode() int32 {
  124. if m != nil {
  125. return m.Code
  126. }
  127. return 0
  128. }
  129. func (m *PubResp) GetMsg() string {
  130. if m != nil {
  131. return m.Msg
  132. }
  133. return ""
  134. }
  135. type RecvReq struct {
  136. Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
  137. ChannelId string `protobuf:"bytes,2,opt,name=channelId,proto3" json:"channelId,omitempty"`
  138. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  139. XXX_unrecognized []byte `json:"-"`
  140. XXX_sizecache int32 `json:"-"`
  141. }
  142. func (m *RecvReq) Reset() { *m = RecvReq{} }
  143. func (m *RecvReq) String() string { return proto.CompactTextString(m) }
  144. func (*RecvReq) ProtoMessage() {}
  145. func (*RecvReq) Descriptor() ([]byte, []int) {
  146. return fileDescriptor_96e4d7d76a734cd8, []int{2}
  147. }
  148. func (m *RecvReq) XXX_Unmarshal(b []byte) error {
  149. return xxx_messageInfo_RecvReq.Unmarshal(m, b)
  150. }
  151. func (m *RecvReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  152. return xxx_messageInfo_RecvReq.Marshal(b, m, deterministic)
  153. }
  154. func (m *RecvReq) XXX_Merge(src proto.Message) {
  155. xxx_messageInfo_RecvReq.Merge(m, src)
  156. }
  157. func (m *RecvReq) XXX_Size() int {
  158. return xxx_messageInfo_RecvReq.Size(m)
  159. }
  160. func (m *RecvReq) XXX_DiscardUnknown() {
  161. xxx_messageInfo_RecvReq.DiscardUnknown(m)
  162. }
  163. var xxx_messageInfo_RecvReq proto.InternalMessageInfo
  164. func (m *RecvReq) GetSender() string {
  165. if m != nil {
  166. return m.Sender
  167. }
  168. return ""
  169. }
  170. func (m *RecvReq) GetChannelId() string {
  171. if m != nil {
  172. return m.ChannelId
  173. }
  174. return ""
  175. }
  176. func init() {
  177. proto.RegisterType((*PubReq)(nil), "proto.PubReq")
  178. proto.RegisterType((*PubResp)(nil), "proto.PubResp")
  179. proto.RegisterType((*RecvReq)(nil), "proto.RecvReq")
  180. }
  181. func init() {
  182. proto.RegisterFile("queue.proto", fileDescriptor_96e4d7d76a734cd8)
  183. }
  184. var fileDescriptor_96e4d7d76a734cd8 = []byte{
  185. // 271 bytes of a gzipped FileDescriptorProto
  186. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0x4f, 0x4b, 0xc3, 0x40,
  187. 0x10, 0xc5, 0xbb, 0x69, 0x93, 0xd2, 0x49, 0x2c, 0x32, 0x88, 0x84, 0x22, 0x18, 0x73, 0xca, 0x41,
  188. 0xaa, 0xe8, 0x07, 0xf0, 0xec, 0x4d, 0x57, 0xef, 0x92, 0x3f, 0x83, 0x5d, 0x49, 0x93, 0x6d, 0xb6,
  189. 0x09, 0xf4, 0x1b, 0xf9, 0x31, 0x65, 0x67, 0x23, 0xb5, 0x17, 0x4f, 0x3b, 0xef, 0xcd, 0x5b, 0xf8,
  190. 0xcd, 0x83, 0x70, 0xd7, 0x53, 0x4f, 0x6b, 0xdd, 0xb5, 0xfb, 0x16, 0x7d, 0x7e, 0xd2, 0x6f, 0x01,
  191. 0xc1, 0x4b, 0x5f, 0x48, 0xda, 0xe1, 0x12, 0x3c, 0x55, 0xc5, 0x22, 0x11, 0xd9, 0x42, 0x7a, 0xaa,
  192. 0xc2, 0x2b, 0x58, 0x94, 0x9b, 0xbc, 0x69, 0xa8, 0x7e, 0xae, 0x62, 0x8f, 0xed, 0xa3, 0x81, 0x97,
  193. 0x10, 0x18, 0x6a, 0x2a, 0xea, 0xe2, 0x29, 0xaf, 0x46, 0x85, 0xd7, 0x10, 0x1a, 0xea, 0x54, 0x5e,
  194. 0x7f, 0xec, 0x0f, 0x9a, 0xe2, 0x59, 0x22, 0x32, 0x5f, 0x82, 0xb3, 0xde, 0x0f, 0x9a, 0xf0, 0x06,
  195. 0x22, 0xdd, 0x17, 0xb5, 0x32, 0x1b, 0x97, 0xf0, 0x39, 0x11, 0x8e, 0x1e, 0x47, 0x2e, 0xc0, 0xd7,
  196. 0x79, 0x97, 0x6f, 0xe3, 0x20, 0x11, 0x59, 0x24, 0x9d, 0x48, 0xef, 0x60, 0xce, 0xa4, 0x46, 0x23,
  197. 0xc2, 0xac, 0x6c, 0x2b, 0x62, 0x58, 0x5f, 0xf2, 0x8c, 0xe7, 0x30, 0xdd, 0x9a, 0xcf, 0x11, 0xd4,
  198. 0x8e, 0xe9, 0x13, 0xcc, 0x25, 0x95, 0x83, 0xbd, 0xed, 0x48, 0x2b, 0x4e, 0x68, 0xff, 0xbd, 0xf1,
  199. 0xe1, 0x0b, 0xa2, 0x57, 0x5b, 0xd9, 0x1b, 0x75, 0x83, 0x2a, 0x09, 0x6f, 0x99, 0xc0, 0x62, 0xe2,
  200. 0x99, 0xab, 0x71, 0xed, 0xba, 0x5b, 0x2d, 0xff, 0x4a, 0xa3, 0xd3, 0x49, 0x26, 0x6c, 0x5a, 0x52,
  201. 0x49, 0x6a, 0x20, 0xfc, 0x5d, 0x8f, 0x38, 0xab, 0xd3, 0xdf, 0xe9, 0xe4, 0x5e, 0x14, 0x01, 0x3b,
  202. 0x8f, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x21, 0x96, 0x01, 0xe7, 0xa5, 0x01, 0x00, 0x00,
  203. }
  204. // Reference imports to suppress errors if they are not otherwise used.
  205. var _ context.Context
  206. var _ grpc.ClientConnInterface
  207. // This is a compile-time assertion to ensure that this generated file
  208. // is compatible with the grpc package it is being compiled against.
  209. const _ = grpc.SupportPackageIsVersion6
  210. // QueueServiceClient is the client API for QueueService service.
  211. //
  212. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  213. type QueueServiceClient interface {
  214. //任务发布
  215. Publish(ctx context.Context, opts ...grpc.CallOption) (QueueService_PublishClient, error)
  216. //任务接收
  217. Receive(ctx context.Context, in *RecvReq, opts ...grpc.CallOption) (QueueService_ReceiveClient, error)
  218. }
  219. type queueServiceClient struct {
  220. cc grpc.ClientConnInterface
  221. }
  222. func NewQueueServiceClient(cc grpc.ClientConnInterface) QueueServiceClient {
  223. return &queueServiceClient{cc}
  224. }
  225. func (c *queueServiceClient) Publish(ctx context.Context, opts ...grpc.CallOption) (QueueService_PublishClient, error) {
  226. stream, err := c.cc.NewStream(ctx, &_QueueService_serviceDesc.Streams[0], "/proto.QueueService/Publish", opts...)
  227. if err != nil {
  228. return nil, err
  229. }
  230. x := &queueServicePublishClient{stream}
  231. return x, nil
  232. }
  233. type QueueService_PublishClient interface {
  234. Send(*PubReq) error
  235. CloseAndRecv() (*PubResp, error)
  236. grpc.ClientStream
  237. }
  238. type queueServicePublishClient struct {
  239. grpc.ClientStream
  240. }
  241. func (x *queueServicePublishClient) Send(m *PubReq) error {
  242. return x.ClientStream.SendMsg(m)
  243. }
  244. func (x *queueServicePublishClient) CloseAndRecv() (*PubResp, error) {
  245. if err := x.ClientStream.CloseSend(); err != nil {
  246. return nil, err
  247. }
  248. m := new(PubResp)
  249. if err := x.ClientStream.RecvMsg(m); err != nil {
  250. return nil, err
  251. }
  252. return m, nil
  253. }
  254. func (c *queueServiceClient) Receive(ctx context.Context, in *RecvReq, opts ...grpc.CallOption) (QueueService_ReceiveClient, error) {
  255. stream, err := c.cc.NewStream(ctx, &_QueueService_serviceDesc.Streams[1], "/proto.QueueService/Receive", opts...)
  256. if err != nil {
  257. return nil, err
  258. }
  259. x := &queueServiceReceiveClient{stream}
  260. if err := x.ClientStream.SendMsg(in); err != nil {
  261. return nil, err
  262. }
  263. if err := x.ClientStream.CloseSend(); err != nil {
  264. return nil, err
  265. }
  266. return x, nil
  267. }
  268. type QueueService_ReceiveClient interface {
  269. Recv() (*PubReq, error)
  270. grpc.ClientStream
  271. }
  272. type queueServiceReceiveClient struct {
  273. grpc.ClientStream
  274. }
  275. func (x *queueServiceReceiveClient) Recv() (*PubReq, error) {
  276. m := new(PubReq)
  277. if err := x.ClientStream.RecvMsg(m); err != nil {
  278. return nil, err
  279. }
  280. return m, nil
  281. }
  282. // QueueServiceServer is the server API for QueueService service.
  283. type QueueServiceServer interface {
  284. //任务发布
  285. Publish(QueueService_PublishServer) error
  286. //任务接收
  287. Receive(*RecvReq, QueueService_ReceiveServer) error
  288. }
  289. // UnimplementedQueueServiceServer can be embedded to have forward compatible implementations.
  290. type UnimplementedQueueServiceServer struct {
  291. }
  292. func (*UnimplementedQueueServiceServer) Publish(srv QueueService_PublishServer) error {
  293. return status.Errorf(codes.Unimplemented, "method Publish not implemented")
  294. }
  295. func (*UnimplementedQueueServiceServer) Receive(req *RecvReq, srv QueueService_ReceiveServer) error {
  296. return status.Errorf(codes.Unimplemented, "method Receive not implemented")
  297. }
  298. func RegisterQueueServiceServer(s *grpc.Server, srv QueueServiceServer) {
  299. s.RegisterService(&_QueueService_serviceDesc, srv)
  300. }
  301. func _QueueService_Publish_Handler(srv interface{}, stream grpc.ServerStream) error {
  302. return srv.(QueueServiceServer).Publish(&queueServicePublishServer{stream})
  303. }
  304. type QueueService_PublishServer interface {
  305. SendAndClose(*PubResp) error
  306. Recv() (*PubReq, error)
  307. grpc.ServerStream
  308. }
  309. type queueServicePublishServer struct {
  310. grpc.ServerStream
  311. }
  312. func (x *queueServicePublishServer) SendAndClose(m *PubResp) error {
  313. return x.ServerStream.SendMsg(m)
  314. }
  315. func (x *queueServicePublishServer) Recv() (*PubReq, error) {
  316. m := new(PubReq)
  317. if err := x.ServerStream.RecvMsg(m); err != nil {
  318. return nil, err
  319. }
  320. return m, nil
  321. }
  322. func _QueueService_Receive_Handler(srv interface{}, stream grpc.ServerStream) error {
  323. m := new(RecvReq)
  324. if err := stream.RecvMsg(m); err != nil {
  325. return err
  326. }
  327. return srv.(QueueServiceServer).Receive(m, &queueServiceReceiveServer{stream})
  328. }
  329. type QueueService_ReceiveServer interface {
  330. Send(*PubReq) error
  331. grpc.ServerStream
  332. }
  333. type queueServiceReceiveServer struct {
  334. grpc.ServerStream
  335. }
  336. func (x *queueServiceReceiveServer) Send(m *PubReq) error {
  337. return x.ServerStream.SendMsg(m)
  338. }
  339. var _QueueService_serviceDesc = grpc.ServiceDesc{
  340. ServiceName: "proto.QueueService",
  341. HandlerType: (*QueueServiceServer)(nil),
  342. Methods: []grpc.MethodDesc{},
  343. Streams: []grpc.StreamDesc{
  344. {
  345. StreamName: "Publish",
  346. Handler: _QueueService_Publish_Handler,
  347. ClientStreams: true,
  348. },
  349. {
  350. StreamName: "Receive",
  351. Handler: _QueueService_Receive_Handler,
  352. ServerStreams: true,
  353. },
  354. },
  355. Metadata: "queue.proto",
  356. }