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.

345 lines
12 KiB

  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. package messaging_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. Subscribe(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_SubscribeClient, error)
  17. Publish(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_PublishClient, error)
  18. DeleteTopic(ctx context.Context, in *DeleteTopicRequest, opts ...grpc.CallOption) (*DeleteTopicResponse, error)
  19. ConfigureTopic(ctx context.Context, in *ConfigureTopicRequest, opts ...grpc.CallOption) (*ConfigureTopicResponse, error)
  20. GetTopicConfiguration(ctx context.Context, in *GetTopicConfigurationRequest, opts ...grpc.CallOption) (*GetTopicConfigurationResponse, error)
  21. FindBroker(ctx context.Context, in *FindBrokerRequest, opts ...grpc.CallOption) (*FindBrokerResponse, error)
  22. }
  23. type seaweedMessagingClient struct {
  24. cc grpc.ClientConnInterface
  25. }
  26. func NewSeaweedMessagingClient(cc grpc.ClientConnInterface) SeaweedMessagingClient {
  27. return &seaweedMessagingClient{cc}
  28. }
  29. func (c *seaweedMessagingClient) Subscribe(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_SubscribeClient, error) {
  30. stream, err := c.cc.NewStream(ctx, &SeaweedMessaging_ServiceDesc.Streams[0], "/messaging_pb.SeaweedMessaging/Subscribe", opts...)
  31. if err != nil {
  32. return nil, err
  33. }
  34. x := &seaweedMessagingSubscribeClient{stream}
  35. return x, nil
  36. }
  37. type SeaweedMessaging_SubscribeClient interface {
  38. Send(*SubscriberMessage) error
  39. Recv() (*BrokerMessage, error)
  40. grpc.ClientStream
  41. }
  42. type seaweedMessagingSubscribeClient struct {
  43. grpc.ClientStream
  44. }
  45. func (x *seaweedMessagingSubscribeClient) Send(m *SubscriberMessage) error {
  46. return x.ClientStream.SendMsg(m)
  47. }
  48. func (x *seaweedMessagingSubscribeClient) Recv() (*BrokerMessage, error) {
  49. m := new(BrokerMessage)
  50. if err := x.ClientStream.RecvMsg(m); err != nil {
  51. return nil, err
  52. }
  53. return m, nil
  54. }
  55. func (c *seaweedMessagingClient) Publish(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_PublishClient, error) {
  56. stream, err := c.cc.NewStream(ctx, &SeaweedMessaging_ServiceDesc.Streams[1], "/messaging_pb.SeaweedMessaging/Publish", opts...)
  57. if err != nil {
  58. return nil, err
  59. }
  60. x := &seaweedMessagingPublishClient{stream}
  61. return x, nil
  62. }
  63. type SeaweedMessaging_PublishClient interface {
  64. Send(*PublishRequest) error
  65. Recv() (*PublishResponse, error)
  66. grpc.ClientStream
  67. }
  68. type seaweedMessagingPublishClient struct {
  69. grpc.ClientStream
  70. }
  71. func (x *seaweedMessagingPublishClient) Send(m *PublishRequest) error {
  72. return x.ClientStream.SendMsg(m)
  73. }
  74. func (x *seaweedMessagingPublishClient) Recv() (*PublishResponse, error) {
  75. m := new(PublishResponse)
  76. if err := x.ClientStream.RecvMsg(m); err != nil {
  77. return nil, err
  78. }
  79. return m, nil
  80. }
  81. func (c *seaweedMessagingClient) DeleteTopic(ctx context.Context, in *DeleteTopicRequest, opts ...grpc.CallOption) (*DeleteTopicResponse, error) {
  82. out := new(DeleteTopicResponse)
  83. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/DeleteTopic", in, out, opts...)
  84. if err != nil {
  85. return nil, err
  86. }
  87. return out, nil
  88. }
  89. func (c *seaweedMessagingClient) ConfigureTopic(ctx context.Context, in *ConfigureTopicRequest, opts ...grpc.CallOption) (*ConfigureTopicResponse, error) {
  90. out := new(ConfigureTopicResponse)
  91. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/ConfigureTopic", in, out, opts...)
  92. if err != nil {
  93. return nil, err
  94. }
  95. return out, nil
  96. }
  97. func (c *seaweedMessagingClient) GetTopicConfiguration(ctx context.Context, in *GetTopicConfigurationRequest, opts ...grpc.CallOption) (*GetTopicConfigurationResponse, error) {
  98. out := new(GetTopicConfigurationResponse)
  99. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/GetTopicConfiguration", in, out, opts...)
  100. if err != nil {
  101. return nil, err
  102. }
  103. return out, nil
  104. }
  105. func (c *seaweedMessagingClient) FindBroker(ctx context.Context, in *FindBrokerRequest, opts ...grpc.CallOption) (*FindBrokerResponse, error) {
  106. out := new(FindBrokerResponse)
  107. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/FindBroker", in, out, opts...)
  108. if err != nil {
  109. return nil, err
  110. }
  111. return out, nil
  112. }
  113. // SeaweedMessagingServer is the server API for SeaweedMessaging service.
  114. // All implementations must embed UnimplementedSeaweedMessagingServer
  115. // for forward compatibility
  116. type SeaweedMessagingServer interface {
  117. Subscribe(SeaweedMessaging_SubscribeServer) error
  118. Publish(SeaweedMessaging_PublishServer) error
  119. DeleteTopic(context.Context, *DeleteTopicRequest) (*DeleteTopicResponse, error)
  120. ConfigureTopic(context.Context, *ConfigureTopicRequest) (*ConfigureTopicResponse, error)
  121. GetTopicConfiguration(context.Context, *GetTopicConfigurationRequest) (*GetTopicConfigurationResponse, error)
  122. FindBroker(context.Context, *FindBrokerRequest) (*FindBrokerResponse, error)
  123. mustEmbedUnimplementedSeaweedMessagingServer()
  124. }
  125. // UnimplementedSeaweedMessagingServer must be embedded to have forward compatible implementations.
  126. type UnimplementedSeaweedMessagingServer struct {
  127. }
  128. func (UnimplementedSeaweedMessagingServer) Subscribe(SeaweedMessaging_SubscribeServer) error {
  129. return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
  130. }
  131. func (UnimplementedSeaweedMessagingServer) Publish(SeaweedMessaging_PublishServer) error {
  132. return status.Errorf(codes.Unimplemented, "method Publish not implemented")
  133. }
  134. func (UnimplementedSeaweedMessagingServer) DeleteTopic(context.Context, *DeleteTopicRequest) (*DeleteTopicResponse, error) {
  135. return nil, status.Errorf(codes.Unimplemented, "method DeleteTopic not implemented")
  136. }
  137. func (UnimplementedSeaweedMessagingServer) ConfigureTopic(context.Context, *ConfigureTopicRequest) (*ConfigureTopicResponse, error) {
  138. return nil, status.Errorf(codes.Unimplemented, "method ConfigureTopic not implemented")
  139. }
  140. func (UnimplementedSeaweedMessagingServer) GetTopicConfiguration(context.Context, *GetTopicConfigurationRequest) (*GetTopicConfigurationResponse, error) {
  141. return nil, status.Errorf(codes.Unimplemented, "method GetTopicConfiguration not implemented")
  142. }
  143. func (UnimplementedSeaweedMessagingServer) FindBroker(context.Context, *FindBrokerRequest) (*FindBrokerResponse, error) {
  144. return nil, status.Errorf(codes.Unimplemented, "method FindBroker not implemented")
  145. }
  146. func (UnimplementedSeaweedMessagingServer) mustEmbedUnimplementedSeaweedMessagingServer() {}
  147. // UnsafeSeaweedMessagingServer may be embedded to opt out of forward compatibility for this service.
  148. // Use of this interface is not recommended, as added methods to SeaweedMessagingServer will
  149. // result in compilation errors.
  150. type UnsafeSeaweedMessagingServer interface {
  151. mustEmbedUnimplementedSeaweedMessagingServer()
  152. }
  153. func RegisterSeaweedMessagingServer(s grpc.ServiceRegistrar, srv SeaweedMessagingServer) {
  154. s.RegisterService(&SeaweedMessaging_ServiceDesc, srv)
  155. }
  156. func _SeaweedMessaging_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
  157. return srv.(SeaweedMessagingServer).Subscribe(&seaweedMessagingSubscribeServer{stream})
  158. }
  159. type SeaweedMessaging_SubscribeServer interface {
  160. Send(*BrokerMessage) error
  161. Recv() (*SubscriberMessage, error)
  162. grpc.ServerStream
  163. }
  164. type seaweedMessagingSubscribeServer struct {
  165. grpc.ServerStream
  166. }
  167. func (x *seaweedMessagingSubscribeServer) Send(m *BrokerMessage) error {
  168. return x.ServerStream.SendMsg(m)
  169. }
  170. func (x *seaweedMessagingSubscribeServer) Recv() (*SubscriberMessage, error) {
  171. m := new(SubscriberMessage)
  172. if err := x.ServerStream.RecvMsg(m); err != nil {
  173. return nil, err
  174. }
  175. return m, nil
  176. }
  177. func _SeaweedMessaging_Publish_Handler(srv interface{}, stream grpc.ServerStream) error {
  178. return srv.(SeaweedMessagingServer).Publish(&seaweedMessagingPublishServer{stream})
  179. }
  180. type SeaweedMessaging_PublishServer interface {
  181. Send(*PublishResponse) error
  182. Recv() (*PublishRequest, error)
  183. grpc.ServerStream
  184. }
  185. type seaweedMessagingPublishServer struct {
  186. grpc.ServerStream
  187. }
  188. func (x *seaweedMessagingPublishServer) Send(m *PublishResponse) error {
  189. return x.ServerStream.SendMsg(m)
  190. }
  191. func (x *seaweedMessagingPublishServer) Recv() (*PublishRequest, error) {
  192. m := new(PublishRequest)
  193. if err := x.ServerStream.RecvMsg(m); err != nil {
  194. return nil, err
  195. }
  196. return m, nil
  197. }
  198. func _SeaweedMessaging_DeleteTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  199. in := new(DeleteTopicRequest)
  200. if err := dec(in); err != nil {
  201. return nil, err
  202. }
  203. if interceptor == nil {
  204. return srv.(SeaweedMessagingServer).DeleteTopic(ctx, in)
  205. }
  206. info := &grpc.UnaryServerInfo{
  207. Server: srv,
  208. FullMethod: "/messaging_pb.SeaweedMessaging/DeleteTopic",
  209. }
  210. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  211. return srv.(SeaweedMessagingServer).DeleteTopic(ctx, req.(*DeleteTopicRequest))
  212. }
  213. return interceptor(ctx, in, info, handler)
  214. }
  215. func _SeaweedMessaging_ConfigureTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  216. in := new(ConfigureTopicRequest)
  217. if err := dec(in); err != nil {
  218. return nil, err
  219. }
  220. if interceptor == nil {
  221. return srv.(SeaweedMessagingServer).ConfigureTopic(ctx, in)
  222. }
  223. info := &grpc.UnaryServerInfo{
  224. Server: srv,
  225. FullMethod: "/messaging_pb.SeaweedMessaging/ConfigureTopic",
  226. }
  227. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  228. return srv.(SeaweedMessagingServer).ConfigureTopic(ctx, req.(*ConfigureTopicRequest))
  229. }
  230. return interceptor(ctx, in, info, handler)
  231. }
  232. func _SeaweedMessaging_GetTopicConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  233. in := new(GetTopicConfigurationRequest)
  234. if err := dec(in); err != nil {
  235. return nil, err
  236. }
  237. if interceptor == nil {
  238. return srv.(SeaweedMessagingServer).GetTopicConfiguration(ctx, in)
  239. }
  240. info := &grpc.UnaryServerInfo{
  241. Server: srv,
  242. FullMethod: "/messaging_pb.SeaweedMessaging/GetTopicConfiguration",
  243. }
  244. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  245. return srv.(SeaweedMessagingServer).GetTopicConfiguration(ctx, req.(*GetTopicConfigurationRequest))
  246. }
  247. return interceptor(ctx, in, info, handler)
  248. }
  249. func _SeaweedMessaging_FindBroker_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  250. in := new(FindBrokerRequest)
  251. if err := dec(in); err != nil {
  252. return nil, err
  253. }
  254. if interceptor == nil {
  255. return srv.(SeaweedMessagingServer).FindBroker(ctx, in)
  256. }
  257. info := &grpc.UnaryServerInfo{
  258. Server: srv,
  259. FullMethod: "/messaging_pb.SeaweedMessaging/FindBroker",
  260. }
  261. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  262. return srv.(SeaweedMessagingServer).FindBroker(ctx, req.(*FindBrokerRequest))
  263. }
  264. return interceptor(ctx, in, info, handler)
  265. }
  266. // SeaweedMessaging_ServiceDesc is the grpc.ServiceDesc for SeaweedMessaging service.
  267. // It's only intended for direct use with grpc.RegisterService,
  268. // and not to be introspected or modified (even as a copy)
  269. var SeaweedMessaging_ServiceDesc = grpc.ServiceDesc{
  270. ServiceName: "messaging_pb.SeaweedMessaging",
  271. HandlerType: (*SeaweedMessagingServer)(nil),
  272. Methods: []grpc.MethodDesc{
  273. {
  274. MethodName: "DeleteTopic",
  275. Handler: _SeaweedMessaging_DeleteTopic_Handler,
  276. },
  277. {
  278. MethodName: "ConfigureTopic",
  279. Handler: _SeaweedMessaging_ConfigureTopic_Handler,
  280. },
  281. {
  282. MethodName: "GetTopicConfiguration",
  283. Handler: _SeaweedMessaging_GetTopicConfiguration_Handler,
  284. },
  285. {
  286. MethodName: "FindBroker",
  287. Handler: _SeaweedMessaging_FindBroker_Handler,
  288. },
  289. },
  290. Streams: []grpc.StreamDesc{
  291. {
  292. StreamName: "Subscribe",
  293. Handler: _SeaweedMessaging_Subscribe_Handler,
  294. ServerStreams: true,
  295. ClientStreams: true,
  296. },
  297. {
  298. StreamName: "Publish",
  299. Handler: _SeaweedMessaging_Publish_Handler,
  300. ServerStreams: true,
  301. ClientStreams: true,
  302. },
  303. },
  304. Metadata: "messaging.proto",
  305. }