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.

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