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.

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