messaging_grpc.pb.go 12 KB

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