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.

286 lines
11 KiB

3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 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. // data plane
  27. Publish(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_PublishClient, error)
  28. }
  29. type seaweedMessagingClient struct {
  30. cc grpc.ClientConnInterface
  31. }
  32. func NewSeaweedMessagingClient(cc grpc.ClientConnInterface) SeaweedMessagingClient {
  33. return &seaweedMessagingClient{cc}
  34. }
  35. func (c *seaweedMessagingClient) FindBrokerLeader(ctx context.Context, in *FindBrokerLeaderRequest, opts ...grpc.CallOption) (*FindBrokerLeaderResponse, error) {
  36. out := new(FindBrokerLeaderResponse)
  37. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/FindBrokerLeader", in, out, opts...)
  38. if err != nil {
  39. return nil, err
  40. }
  41. return out, nil
  42. }
  43. func (c *seaweedMessagingClient) AssignSegmentBrokers(ctx context.Context, in *AssignSegmentBrokersRequest, opts ...grpc.CallOption) (*AssignSegmentBrokersResponse, error) {
  44. out := new(AssignSegmentBrokersResponse)
  45. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/AssignSegmentBrokers", in, out, opts...)
  46. if err != nil {
  47. return nil, err
  48. }
  49. return out, nil
  50. }
  51. func (c *seaweedMessagingClient) CheckSegmentStatus(ctx context.Context, in *CheckSegmentStatusRequest, opts ...grpc.CallOption) (*CheckSegmentStatusResponse, error) {
  52. out := new(CheckSegmentStatusResponse)
  53. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/CheckSegmentStatus", in, out, opts...)
  54. if err != nil {
  55. return nil, err
  56. }
  57. return out, nil
  58. }
  59. func (c *seaweedMessagingClient) CheckBrokerLoad(ctx context.Context, in *CheckBrokerLoadRequest, opts ...grpc.CallOption) (*CheckBrokerLoadResponse, error) {
  60. out := new(CheckBrokerLoadResponse)
  61. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/CheckBrokerLoad", in, out, opts...)
  62. if err != nil {
  63. return nil, err
  64. }
  65. return out, nil
  66. }
  67. func (c *seaweedMessagingClient) Publish(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_PublishClient, error) {
  68. stream, err := c.cc.NewStream(ctx, &SeaweedMessaging_ServiceDesc.Streams[0], "/messaging_pb.SeaweedMessaging/Publish", opts...)
  69. if err != nil {
  70. return nil, err
  71. }
  72. x := &seaweedMessagingPublishClient{stream}
  73. return x, nil
  74. }
  75. type SeaweedMessaging_PublishClient interface {
  76. Send(*PublishRequest) error
  77. Recv() (*PublishResponse, error)
  78. grpc.ClientStream
  79. }
  80. type seaweedMessagingPublishClient struct {
  81. grpc.ClientStream
  82. }
  83. func (x *seaweedMessagingPublishClient) Send(m *PublishRequest) error {
  84. return x.ClientStream.SendMsg(m)
  85. }
  86. func (x *seaweedMessagingPublishClient) Recv() (*PublishResponse, error) {
  87. m := new(PublishResponse)
  88. if err := x.ClientStream.RecvMsg(m); err != nil {
  89. return nil, err
  90. }
  91. return m, nil
  92. }
  93. // SeaweedMessagingServer is the server API for SeaweedMessaging service.
  94. // All implementations must embed UnimplementedSeaweedMessagingServer
  95. // for forward compatibility
  96. type SeaweedMessagingServer interface {
  97. // control plane
  98. FindBrokerLeader(context.Context, *FindBrokerLeaderRequest) (*FindBrokerLeaderResponse, error)
  99. AssignSegmentBrokers(context.Context, *AssignSegmentBrokersRequest) (*AssignSegmentBrokersResponse, error)
  100. CheckSegmentStatus(context.Context, *CheckSegmentStatusRequest) (*CheckSegmentStatusResponse, error)
  101. CheckBrokerLoad(context.Context, *CheckBrokerLoadRequest) (*CheckBrokerLoadResponse, error)
  102. // data plane
  103. Publish(SeaweedMessaging_PublishServer) error
  104. mustEmbedUnimplementedSeaweedMessagingServer()
  105. }
  106. // UnimplementedSeaweedMessagingServer must be embedded to have forward compatible implementations.
  107. type UnimplementedSeaweedMessagingServer struct {
  108. }
  109. func (UnimplementedSeaweedMessagingServer) FindBrokerLeader(context.Context, *FindBrokerLeaderRequest) (*FindBrokerLeaderResponse, error) {
  110. return nil, status.Errorf(codes.Unimplemented, "method FindBrokerLeader not implemented")
  111. }
  112. func (UnimplementedSeaweedMessagingServer) AssignSegmentBrokers(context.Context, *AssignSegmentBrokersRequest) (*AssignSegmentBrokersResponse, error) {
  113. return nil, status.Errorf(codes.Unimplemented, "method AssignSegmentBrokers not implemented")
  114. }
  115. func (UnimplementedSeaweedMessagingServer) CheckSegmentStatus(context.Context, *CheckSegmentStatusRequest) (*CheckSegmentStatusResponse, error) {
  116. return nil, status.Errorf(codes.Unimplemented, "method CheckSegmentStatus not implemented")
  117. }
  118. func (UnimplementedSeaweedMessagingServer) CheckBrokerLoad(context.Context, *CheckBrokerLoadRequest) (*CheckBrokerLoadResponse, error) {
  119. return nil, status.Errorf(codes.Unimplemented, "method CheckBrokerLoad not implemented")
  120. }
  121. func (UnimplementedSeaweedMessagingServer) Publish(SeaweedMessaging_PublishServer) error {
  122. return status.Errorf(codes.Unimplemented, "method Publish not implemented")
  123. }
  124. func (UnimplementedSeaweedMessagingServer) mustEmbedUnimplementedSeaweedMessagingServer() {}
  125. // UnsafeSeaweedMessagingServer may be embedded to opt out of forward compatibility for this service.
  126. // Use of this interface is not recommended, as added methods to SeaweedMessagingServer will
  127. // result in compilation errors.
  128. type UnsafeSeaweedMessagingServer interface {
  129. mustEmbedUnimplementedSeaweedMessagingServer()
  130. }
  131. func RegisterSeaweedMessagingServer(s grpc.ServiceRegistrar, srv SeaweedMessagingServer) {
  132. s.RegisterService(&SeaweedMessaging_ServiceDesc, srv)
  133. }
  134. func _SeaweedMessaging_FindBrokerLeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  135. in := new(FindBrokerLeaderRequest)
  136. if err := dec(in); err != nil {
  137. return nil, err
  138. }
  139. if interceptor == nil {
  140. return srv.(SeaweedMessagingServer).FindBrokerLeader(ctx, in)
  141. }
  142. info := &grpc.UnaryServerInfo{
  143. Server: srv,
  144. FullMethod: "/messaging_pb.SeaweedMessaging/FindBrokerLeader",
  145. }
  146. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  147. return srv.(SeaweedMessagingServer).FindBrokerLeader(ctx, req.(*FindBrokerLeaderRequest))
  148. }
  149. return interceptor(ctx, in, info, handler)
  150. }
  151. func _SeaweedMessaging_AssignSegmentBrokers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  152. in := new(AssignSegmentBrokersRequest)
  153. if err := dec(in); err != nil {
  154. return nil, err
  155. }
  156. if interceptor == nil {
  157. return srv.(SeaweedMessagingServer).AssignSegmentBrokers(ctx, in)
  158. }
  159. info := &grpc.UnaryServerInfo{
  160. Server: srv,
  161. FullMethod: "/messaging_pb.SeaweedMessaging/AssignSegmentBrokers",
  162. }
  163. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  164. return srv.(SeaweedMessagingServer).AssignSegmentBrokers(ctx, req.(*AssignSegmentBrokersRequest))
  165. }
  166. return interceptor(ctx, in, info, handler)
  167. }
  168. func _SeaweedMessaging_CheckSegmentStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  169. in := new(CheckSegmentStatusRequest)
  170. if err := dec(in); err != nil {
  171. return nil, err
  172. }
  173. if interceptor == nil {
  174. return srv.(SeaweedMessagingServer).CheckSegmentStatus(ctx, in)
  175. }
  176. info := &grpc.UnaryServerInfo{
  177. Server: srv,
  178. FullMethod: "/messaging_pb.SeaweedMessaging/CheckSegmentStatus",
  179. }
  180. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  181. return srv.(SeaweedMessagingServer).CheckSegmentStatus(ctx, req.(*CheckSegmentStatusRequest))
  182. }
  183. return interceptor(ctx, in, info, handler)
  184. }
  185. func _SeaweedMessaging_CheckBrokerLoad_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  186. in := new(CheckBrokerLoadRequest)
  187. if err := dec(in); err != nil {
  188. return nil, err
  189. }
  190. if interceptor == nil {
  191. return srv.(SeaweedMessagingServer).CheckBrokerLoad(ctx, in)
  192. }
  193. info := &grpc.UnaryServerInfo{
  194. Server: srv,
  195. FullMethod: "/messaging_pb.SeaweedMessaging/CheckBrokerLoad",
  196. }
  197. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  198. return srv.(SeaweedMessagingServer).CheckBrokerLoad(ctx, req.(*CheckBrokerLoadRequest))
  199. }
  200. return interceptor(ctx, in, info, handler)
  201. }
  202. func _SeaweedMessaging_Publish_Handler(srv interface{}, stream grpc.ServerStream) error {
  203. return srv.(SeaweedMessagingServer).Publish(&seaweedMessagingPublishServer{stream})
  204. }
  205. type SeaweedMessaging_PublishServer interface {
  206. Send(*PublishResponse) error
  207. Recv() (*PublishRequest, error)
  208. grpc.ServerStream
  209. }
  210. type seaweedMessagingPublishServer struct {
  211. grpc.ServerStream
  212. }
  213. func (x *seaweedMessagingPublishServer) Send(m *PublishResponse) error {
  214. return x.ServerStream.SendMsg(m)
  215. }
  216. func (x *seaweedMessagingPublishServer) Recv() (*PublishRequest, error) {
  217. m := new(PublishRequest)
  218. if err := x.ServerStream.RecvMsg(m); err != nil {
  219. return nil, err
  220. }
  221. return m, nil
  222. }
  223. // SeaweedMessaging_ServiceDesc is the grpc.ServiceDesc for SeaweedMessaging service.
  224. // It's only intended for direct use with grpc.RegisterService,
  225. // and not to be introspected or modified (even as a copy)
  226. var SeaweedMessaging_ServiceDesc = grpc.ServiceDesc{
  227. ServiceName: "messaging_pb.SeaweedMessaging",
  228. HandlerType: (*SeaweedMessagingServer)(nil),
  229. Methods: []grpc.MethodDesc{
  230. {
  231. MethodName: "FindBrokerLeader",
  232. Handler: _SeaweedMessaging_FindBrokerLeader_Handler,
  233. },
  234. {
  235. MethodName: "AssignSegmentBrokers",
  236. Handler: _SeaweedMessaging_AssignSegmentBrokers_Handler,
  237. },
  238. {
  239. MethodName: "CheckSegmentStatus",
  240. Handler: _SeaweedMessaging_CheckSegmentStatus_Handler,
  241. },
  242. {
  243. MethodName: "CheckBrokerLoad",
  244. Handler: _SeaweedMessaging_CheckBrokerLoad_Handler,
  245. },
  246. },
  247. Streams: []grpc.StreamDesc{
  248. {
  249. StreamName: "Publish",
  250. Handler: _SeaweedMessaging_Publish_Handler,
  251. ServerStreams: true,
  252. ClientStreams: true,
  253. },
  254. },
  255. Metadata: "mq.proto",
  256. }