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.

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