You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

434 lines
18 KiB

3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.2.0
  4. // - protoc v4.23.3
  5. // source: mq.proto
  6. package mq_pb
  7. import (
  8. context "context"
  9. grpc "google.golang.org/grpc"
  10. codes "google.golang.org/grpc/codes"
  11. status "google.golang.org/grpc/status"
  12. )
  13. // This is a compile-time assertion to ensure that this generated file
  14. // is compatible with the grpc package it is being compiled against.
  15. // Requires gRPC-Go v1.32.0 or later.
  16. const _ = grpc.SupportPackageIsVersion7
  17. // SeaweedMessagingClient is the client API for SeaweedMessaging service.
  18. //
  19. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
  20. type SeaweedMessagingClient interface {
  21. // control plane
  22. FindBrokerLeader(ctx context.Context, in *FindBrokerLeaderRequest, opts ...grpc.CallOption) (*FindBrokerLeaderResponse, error)
  23. AssignSegmentBrokers(ctx context.Context, in *AssignSegmentBrokersRequest, opts ...grpc.CallOption) (*AssignSegmentBrokersResponse, error)
  24. CheckSegmentStatus(ctx context.Context, in *CheckSegmentStatusRequest, opts ...grpc.CallOption) (*CheckSegmentStatusResponse, error)
  25. CheckBrokerLoad(ctx context.Context, in *CheckBrokerLoadRequest, opts ...grpc.CallOption) (*CheckBrokerLoadResponse, error)
  26. // control plane for topic partitions
  27. FindTopicBrokers(ctx context.Context, in *FindTopicBrokersRequest, opts ...grpc.CallOption) (*FindTopicBrokersResponse, error)
  28. // a pub client will call this to get the topic partitions assignment
  29. RequestTopicPartitions(ctx context.Context, in *RequestTopicPartitionsRequest, opts ...grpc.CallOption) (*RequestTopicPartitionsResponse, error)
  30. AssignTopicPartitions(ctx context.Context, in *AssignTopicPartitionsRequest, opts ...grpc.CallOption) (*AssignTopicPartitionsResponse, error)
  31. CheckTopicPartitionsStatus(ctx context.Context, in *CheckTopicPartitionsStatusRequest, opts ...grpc.CallOption) (*CheckTopicPartitionsStatusResponse, error)
  32. // data plane
  33. Publish(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_PublishClient, error)
  34. }
  35. type seaweedMessagingClient struct {
  36. cc grpc.ClientConnInterface
  37. }
  38. func NewSeaweedMessagingClient(cc grpc.ClientConnInterface) SeaweedMessagingClient {
  39. return &seaweedMessagingClient{cc}
  40. }
  41. func (c *seaweedMessagingClient) FindBrokerLeader(ctx context.Context, in *FindBrokerLeaderRequest, opts ...grpc.CallOption) (*FindBrokerLeaderResponse, error) {
  42. out := new(FindBrokerLeaderResponse)
  43. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/FindBrokerLeader", in, out, opts...)
  44. if err != nil {
  45. return nil, err
  46. }
  47. return out, nil
  48. }
  49. func (c *seaweedMessagingClient) AssignSegmentBrokers(ctx context.Context, in *AssignSegmentBrokersRequest, opts ...grpc.CallOption) (*AssignSegmentBrokersResponse, error) {
  50. out := new(AssignSegmentBrokersResponse)
  51. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/AssignSegmentBrokers", in, out, opts...)
  52. if err != nil {
  53. return nil, err
  54. }
  55. return out, nil
  56. }
  57. func (c *seaweedMessagingClient) CheckSegmentStatus(ctx context.Context, in *CheckSegmentStatusRequest, opts ...grpc.CallOption) (*CheckSegmentStatusResponse, error) {
  58. out := new(CheckSegmentStatusResponse)
  59. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/CheckSegmentStatus", in, out, opts...)
  60. if err != nil {
  61. return nil, err
  62. }
  63. return out, nil
  64. }
  65. func (c *seaweedMessagingClient) CheckBrokerLoad(ctx context.Context, in *CheckBrokerLoadRequest, opts ...grpc.CallOption) (*CheckBrokerLoadResponse, error) {
  66. out := new(CheckBrokerLoadResponse)
  67. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/CheckBrokerLoad", in, out, opts...)
  68. if err != nil {
  69. return nil, err
  70. }
  71. return out, nil
  72. }
  73. func (c *seaweedMessagingClient) FindTopicBrokers(ctx context.Context, in *FindTopicBrokersRequest, opts ...grpc.CallOption) (*FindTopicBrokersResponse, error) {
  74. out := new(FindTopicBrokersResponse)
  75. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/FindTopicBrokers", in, out, opts...)
  76. if err != nil {
  77. return nil, err
  78. }
  79. return out, nil
  80. }
  81. func (c *seaweedMessagingClient) RequestTopicPartitions(ctx context.Context, in *RequestTopicPartitionsRequest, opts ...grpc.CallOption) (*RequestTopicPartitionsResponse, error) {
  82. out := new(RequestTopicPartitionsResponse)
  83. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/RequestTopicPartitions", in, out, opts...)
  84. if err != nil {
  85. return nil, err
  86. }
  87. return out, nil
  88. }
  89. func (c *seaweedMessagingClient) AssignTopicPartitions(ctx context.Context, in *AssignTopicPartitionsRequest, opts ...grpc.CallOption) (*AssignTopicPartitionsResponse, error) {
  90. out := new(AssignTopicPartitionsResponse)
  91. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/AssignTopicPartitions", in, out, opts...)
  92. if err != nil {
  93. return nil, err
  94. }
  95. return out, nil
  96. }
  97. func (c *seaweedMessagingClient) CheckTopicPartitionsStatus(ctx context.Context, in *CheckTopicPartitionsStatusRequest, opts ...grpc.CallOption) (*CheckTopicPartitionsStatusResponse, error) {
  98. out := new(CheckTopicPartitionsStatusResponse)
  99. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/CheckTopicPartitionsStatus", in, out, opts...)
  100. if err != nil {
  101. return nil, err
  102. }
  103. return out, nil
  104. }
  105. func (c *seaweedMessagingClient) Publish(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_PublishClient, error) {
  106. stream, err := c.cc.NewStream(ctx, &SeaweedMessaging_ServiceDesc.Streams[0], "/messaging_pb.SeaweedMessaging/Publish", opts...)
  107. if err != nil {
  108. return nil, err
  109. }
  110. x := &seaweedMessagingPublishClient{stream}
  111. return x, nil
  112. }
  113. type SeaweedMessaging_PublishClient interface {
  114. Send(*PublishRequest) error
  115. Recv() (*PublishResponse, error)
  116. grpc.ClientStream
  117. }
  118. type seaweedMessagingPublishClient struct {
  119. grpc.ClientStream
  120. }
  121. func (x *seaweedMessagingPublishClient) Send(m *PublishRequest) error {
  122. return x.ClientStream.SendMsg(m)
  123. }
  124. func (x *seaweedMessagingPublishClient) Recv() (*PublishResponse, error) {
  125. m := new(PublishResponse)
  126. if err := x.ClientStream.RecvMsg(m); err != nil {
  127. return nil, err
  128. }
  129. return m, nil
  130. }
  131. // SeaweedMessagingServer is the server API for SeaweedMessaging service.
  132. // All implementations must embed UnimplementedSeaweedMessagingServer
  133. // for forward compatibility
  134. type SeaweedMessagingServer interface {
  135. // control plane
  136. FindBrokerLeader(context.Context, *FindBrokerLeaderRequest) (*FindBrokerLeaderResponse, error)
  137. AssignSegmentBrokers(context.Context, *AssignSegmentBrokersRequest) (*AssignSegmentBrokersResponse, error)
  138. CheckSegmentStatus(context.Context, *CheckSegmentStatusRequest) (*CheckSegmentStatusResponse, error)
  139. CheckBrokerLoad(context.Context, *CheckBrokerLoadRequest) (*CheckBrokerLoadResponse, error)
  140. // control plane for topic partitions
  141. FindTopicBrokers(context.Context, *FindTopicBrokersRequest) (*FindTopicBrokersResponse, error)
  142. // a pub client will call this to get the topic partitions assignment
  143. RequestTopicPartitions(context.Context, *RequestTopicPartitionsRequest) (*RequestTopicPartitionsResponse, error)
  144. AssignTopicPartitions(context.Context, *AssignTopicPartitionsRequest) (*AssignTopicPartitionsResponse, error)
  145. CheckTopicPartitionsStatus(context.Context, *CheckTopicPartitionsStatusRequest) (*CheckTopicPartitionsStatusResponse, error)
  146. // data plane
  147. Publish(SeaweedMessaging_PublishServer) error
  148. mustEmbedUnimplementedSeaweedMessagingServer()
  149. }
  150. // UnimplementedSeaweedMessagingServer must be embedded to have forward compatible implementations.
  151. type UnimplementedSeaweedMessagingServer struct {
  152. }
  153. func (UnimplementedSeaweedMessagingServer) FindBrokerLeader(context.Context, *FindBrokerLeaderRequest) (*FindBrokerLeaderResponse, error) {
  154. return nil, status.Errorf(codes.Unimplemented, "method FindBrokerLeader not implemented")
  155. }
  156. func (UnimplementedSeaweedMessagingServer) AssignSegmentBrokers(context.Context, *AssignSegmentBrokersRequest) (*AssignSegmentBrokersResponse, error) {
  157. return nil, status.Errorf(codes.Unimplemented, "method AssignSegmentBrokers not implemented")
  158. }
  159. func (UnimplementedSeaweedMessagingServer) CheckSegmentStatus(context.Context, *CheckSegmentStatusRequest) (*CheckSegmentStatusResponse, error) {
  160. return nil, status.Errorf(codes.Unimplemented, "method CheckSegmentStatus not implemented")
  161. }
  162. func (UnimplementedSeaweedMessagingServer) CheckBrokerLoad(context.Context, *CheckBrokerLoadRequest) (*CheckBrokerLoadResponse, error) {
  163. return nil, status.Errorf(codes.Unimplemented, "method CheckBrokerLoad not implemented")
  164. }
  165. func (UnimplementedSeaweedMessagingServer) FindTopicBrokers(context.Context, *FindTopicBrokersRequest) (*FindTopicBrokersResponse, error) {
  166. return nil, status.Errorf(codes.Unimplemented, "method FindTopicBrokers not implemented")
  167. }
  168. func (UnimplementedSeaweedMessagingServer) RequestTopicPartitions(context.Context, *RequestTopicPartitionsRequest) (*RequestTopicPartitionsResponse, error) {
  169. return nil, status.Errorf(codes.Unimplemented, "method RequestTopicPartitions not implemented")
  170. }
  171. func (UnimplementedSeaweedMessagingServer) AssignTopicPartitions(context.Context, *AssignTopicPartitionsRequest) (*AssignTopicPartitionsResponse, error) {
  172. return nil, status.Errorf(codes.Unimplemented, "method AssignTopicPartitions not implemented")
  173. }
  174. func (UnimplementedSeaweedMessagingServer) CheckTopicPartitionsStatus(context.Context, *CheckTopicPartitionsStatusRequest) (*CheckTopicPartitionsStatusResponse, error) {
  175. return nil, status.Errorf(codes.Unimplemented, "method CheckTopicPartitionsStatus not implemented")
  176. }
  177. func (UnimplementedSeaweedMessagingServer) Publish(SeaweedMessaging_PublishServer) error {
  178. return status.Errorf(codes.Unimplemented, "method Publish not implemented")
  179. }
  180. func (UnimplementedSeaweedMessagingServer) mustEmbedUnimplementedSeaweedMessagingServer() {}
  181. // UnsafeSeaweedMessagingServer may be embedded to opt out of forward compatibility for this service.
  182. // Use of this interface is not recommended, as added methods to SeaweedMessagingServer will
  183. // result in compilation errors.
  184. type UnsafeSeaweedMessagingServer interface {
  185. mustEmbedUnimplementedSeaweedMessagingServer()
  186. }
  187. func RegisterSeaweedMessagingServer(s grpc.ServiceRegistrar, srv SeaweedMessagingServer) {
  188. s.RegisterService(&SeaweedMessaging_ServiceDesc, srv)
  189. }
  190. func _SeaweedMessaging_FindBrokerLeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  191. in := new(FindBrokerLeaderRequest)
  192. if err := dec(in); err != nil {
  193. return nil, err
  194. }
  195. if interceptor == nil {
  196. return srv.(SeaweedMessagingServer).FindBrokerLeader(ctx, in)
  197. }
  198. info := &grpc.UnaryServerInfo{
  199. Server: srv,
  200. FullMethod: "/messaging_pb.SeaweedMessaging/FindBrokerLeader",
  201. }
  202. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  203. return srv.(SeaweedMessagingServer).FindBrokerLeader(ctx, req.(*FindBrokerLeaderRequest))
  204. }
  205. return interceptor(ctx, in, info, handler)
  206. }
  207. func _SeaweedMessaging_AssignSegmentBrokers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  208. in := new(AssignSegmentBrokersRequest)
  209. if err := dec(in); err != nil {
  210. return nil, err
  211. }
  212. if interceptor == nil {
  213. return srv.(SeaweedMessagingServer).AssignSegmentBrokers(ctx, in)
  214. }
  215. info := &grpc.UnaryServerInfo{
  216. Server: srv,
  217. FullMethod: "/messaging_pb.SeaweedMessaging/AssignSegmentBrokers",
  218. }
  219. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  220. return srv.(SeaweedMessagingServer).AssignSegmentBrokers(ctx, req.(*AssignSegmentBrokersRequest))
  221. }
  222. return interceptor(ctx, in, info, handler)
  223. }
  224. func _SeaweedMessaging_CheckSegmentStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  225. in := new(CheckSegmentStatusRequest)
  226. if err := dec(in); err != nil {
  227. return nil, err
  228. }
  229. if interceptor == nil {
  230. return srv.(SeaweedMessagingServer).CheckSegmentStatus(ctx, in)
  231. }
  232. info := &grpc.UnaryServerInfo{
  233. Server: srv,
  234. FullMethod: "/messaging_pb.SeaweedMessaging/CheckSegmentStatus",
  235. }
  236. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  237. return srv.(SeaweedMessagingServer).CheckSegmentStatus(ctx, req.(*CheckSegmentStatusRequest))
  238. }
  239. return interceptor(ctx, in, info, handler)
  240. }
  241. func _SeaweedMessaging_CheckBrokerLoad_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  242. in := new(CheckBrokerLoadRequest)
  243. if err := dec(in); err != nil {
  244. return nil, err
  245. }
  246. if interceptor == nil {
  247. return srv.(SeaweedMessagingServer).CheckBrokerLoad(ctx, in)
  248. }
  249. info := &grpc.UnaryServerInfo{
  250. Server: srv,
  251. FullMethod: "/messaging_pb.SeaweedMessaging/CheckBrokerLoad",
  252. }
  253. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  254. return srv.(SeaweedMessagingServer).CheckBrokerLoad(ctx, req.(*CheckBrokerLoadRequest))
  255. }
  256. return interceptor(ctx, in, info, handler)
  257. }
  258. func _SeaweedMessaging_FindTopicBrokers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  259. in := new(FindTopicBrokersRequest)
  260. if err := dec(in); err != nil {
  261. return nil, err
  262. }
  263. if interceptor == nil {
  264. return srv.(SeaweedMessagingServer).FindTopicBrokers(ctx, in)
  265. }
  266. info := &grpc.UnaryServerInfo{
  267. Server: srv,
  268. FullMethod: "/messaging_pb.SeaweedMessaging/FindTopicBrokers",
  269. }
  270. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  271. return srv.(SeaweedMessagingServer).FindTopicBrokers(ctx, req.(*FindTopicBrokersRequest))
  272. }
  273. return interceptor(ctx, in, info, handler)
  274. }
  275. func _SeaweedMessaging_RequestTopicPartitions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  276. in := new(RequestTopicPartitionsRequest)
  277. if err := dec(in); err != nil {
  278. return nil, err
  279. }
  280. if interceptor == nil {
  281. return srv.(SeaweedMessagingServer).RequestTopicPartitions(ctx, in)
  282. }
  283. info := &grpc.UnaryServerInfo{
  284. Server: srv,
  285. FullMethod: "/messaging_pb.SeaweedMessaging/RequestTopicPartitions",
  286. }
  287. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  288. return srv.(SeaweedMessagingServer).RequestTopicPartitions(ctx, req.(*RequestTopicPartitionsRequest))
  289. }
  290. return interceptor(ctx, in, info, handler)
  291. }
  292. func _SeaweedMessaging_AssignTopicPartitions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  293. in := new(AssignTopicPartitionsRequest)
  294. if err := dec(in); err != nil {
  295. return nil, err
  296. }
  297. if interceptor == nil {
  298. return srv.(SeaweedMessagingServer).AssignTopicPartitions(ctx, in)
  299. }
  300. info := &grpc.UnaryServerInfo{
  301. Server: srv,
  302. FullMethod: "/messaging_pb.SeaweedMessaging/AssignTopicPartitions",
  303. }
  304. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  305. return srv.(SeaweedMessagingServer).AssignTopicPartitions(ctx, req.(*AssignTopicPartitionsRequest))
  306. }
  307. return interceptor(ctx, in, info, handler)
  308. }
  309. func _SeaweedMessaging_CheckTopicPartitionsStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  310. in := new(CheckTopicPartitionsStatusRequest)
  311. if err := dec(in); err != nil {
  312. return nil, err
  313. }
  314. if interceptor == nil {
  315. return srv.(SeaweedMessagingServer).CheckTopicPartitionsStatus(ctx, in)
  316. }
  317. info := &grpc.UnaryServerInfo{
  318. Server: srv,
  319. FullMethod: "/messaging_pb.SeaweedMessaging/CheckTopicPartitionsStatus",
  320. }
  321. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  322. return srv.(SeaweedMessagingServer).CheckTopicPartitionsStatus(ctx, req.(*CheckTopicPartitionsStatusRequest))
  323. }
  324. return interceptor(ctx, in, info, handler)
  325. }
  326. func _SeaweedMessaging_Publish_Handler(srv interface{}, stream grpc.ServerStream) error {
  327. return srv.(SeaweedMessagingServer).Publish(&seaweedMessagingPublishServer{stream})
  328. }
  329. type SeaweedMessaging_PublishServer interface {
  330. Send(*PublishResponse) error
  331. Recv() (*PublishRequest, error)
  332. grpc.ServerStream
  333. }
  334. type seaweedMessagingPublishServer struct {
  335. grpc.ServerStream
  336. }
  337. func (x *seaweedMessagingPublishServer) Send(m *PublishResponse) error {
  338. return x.ServerStream.SendMsg(m)
  339. }
  340. func (x *seaweedMessagingPublishServer) Recv() (*PublishRequest, error) {
  341. m := new(PublishRequest)
  342. if err := x.ServerStream.RecvMsg(m); err != nil {
  343. return nil, err
  344. }
  345. return m, nil
  346. }
  347. // SeaweedMessaging_ServiceDesc is the grpc.ServiceDesc for SeaweedMessaging service.
  348. // It's only intended for direct use with grpc.RegisterService,
  349. // and not to be introspected or modified (even as a copy)
  350. var SeaweedMessaging_ServiceDesc = grpc.ServiceDesc{
  351. ServiceName: "messaging_pb.SeaweedMessaging",
  352. HandlerType: (*SeaweedMessagingServer)(nil),
  353. Methods: []grpc.MethodDesc{
  354. {
  355. MethodName: "FindBrokerLeader",
  356. Handler: _SeaweedMessaging_FindBrokerLeader_Handler,
  357. },
  358. {
  359. MethodName: "AssignSegmentBrokers",
  360. Handler: _SeaweedMessaging_AssignSegmentBrokers_Handler,
  361. },
  362. {
  363. MethodName: "CheckSegmentStatus",
  364. Handler: _SeaweedMessaging_CheckSegmentStatus_Handler,
  365. },
  366. {
  367. MethodName: "CheckBrokerLoad",
  368. Handler: _SeaweedMessaging_CheckBrokerLoad_Handler,
  369. },
  370. {
  371. MethodName: "FindTopicBrokers",
  372. Handler: _SeaweedMessaging_FindTopicBrokers_Handler,
  373. },
  374. {
  375. MethodName: "RequestTopicPartitions",
  376. Handler: _SeaweedMessaging_RequestTopicPartitions_Handler,
  377. },
  378. {
  379. MethodName: "AssignTopicPartitions",
  380. Handler: _SeaweedMessaging_AssignTopicPartitions_Handler,
  381. },
  382. {
  383. MethodName: "CheckTopicPartitionsStatus",
  384. Handler: _SeaweedMessaging_CheckTopicPartitionsStatus_Handler,
  385. },
  386. },
  387. Streams: []grpc.StreamDesc{
  388. {
  389. StreamName: "Publish",
  390. Handler: _SeaweedMessaging_Publish_Handler,
  391. ServerStreams: true,
  392. ClientStreams: true,
  393. },
  394. },
  395. Metadata: "mq.proto",
  396. }