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.

304 lines
15 KiB

  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.5.1
  4. // - protoc v5.28.1
  5. // source: mq_agent.proto
  6. package mq_agent_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.64.0 or later.
  16. const _ = grpc.SupportPackageIsVersion9
  17. const (
  18. SeaweedMessagingAgent_StartPublishSession_FullMethodName = "/messaging_pb.SeaweedMessagingAgent/StartPublishSession"
  19. SeaweedMessagingAgent_ClosePublishSession_FullMethodName = "/messaging_pb.SeaweedMessagingAgent/ClosePublishSession"
  20. SeaweedMessagingAgent_PublishRecord_FullMethodName = "/messaging_pb.SeaweedMessagingAgent/PublishRecord"
  21. SeaweedMessagingAgent_StartSubscribeSession_FullMethodName = "/messaging_pb.SeaweedMessagingAgent/StartSubscribeSession"
  22. SeaweedMessagingAgent_CloseSubscribeSession_FullMethodName = "/messaging_pb.SeaweedMessagingAgent/CloseSubscribeSession"
  23. SeaweedMessagingAgent_SubscribeRecord_FullMethodName = "/messaging_pb.SeaweedMessagingAgent/SubscribeRecord"
  24. )
  25. // SeaweedMessagingAgentClient is the client API for SeaweedMessagingAgent service.
  26. //
  27. // 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.
  28. type SeaweedMessagingAgentClient interface {
  29. // Publishing
  30. StartPublishSession(ctx context.Context, in *StartPublishSessionRequest, opts ...grpc.CallOption) (*StartPublishSessionResponse, error)
  31. ClosePublishSession(ctx context.Context, in *ClosePublishSessionRequest, opts ...grpc.CallOption) (*ClosePublishSessionResponse, error)
  32. PublishRecord(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[PublishRecordRequest, PublishRecordResponse], error)
  33. // Subscribing
  34. StartSubscribeSession(ctx context.Context, in *StartSubscribeSessionRequest, opts ...grpc.CallOption) (*StartSubscribeSessionResponse, error)
  35. CloseSubscribeSession(ctx context.Context, in *CloseSubscribeSessionRequest, opts ...grpc.CallOption) (*CloseSubscribeSessionResponse, error)
  36. SubscribeRecord(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SubscribeRecordRequest, SubscribeRecordResponse], error)
  37. }
  38. type seaweedMessagingAgentClient struct {
  39. cc grpc.ClientConnInterface
  40. }
  41. func NewSeaweedMessagingAgentClient(cc grpc.ClientConnInterface) SeaweedMessagingAgentClient {
  42. return &seaweedMessagingAgentClient{cc}
  43. }
  44. func (c *seaweedMessagingAgentClient) StartPublishSession(ctx context.Context, in *StartPublishSessionRequest, opts ...grpc.CallOption) (*StartPublishSessionResponse, error) {
  45. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  46. out := new(StartPublishSessionResponse)
  47. err := c.cc.Invoke(ctx, SeaweedMessagingAgent_StartPublishSession_FullMethodName, in, out, cOpts...)
  48. if err != nil {
  49. return nil, err
  50. }
  51. return out, nil
  52. }
  53. func (c *seaweedMessagingAgentClient) ClosePublishSession(ctx context.Context, in *ClosePublishSessionRequest, opts ...grpc.CallOption) (*ClosePublishSessionResponse, error) {
  54. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  55. out := new(ClosePublishSessionResponse)
  56. err := c.cc.Invoke(ctx, SeaweedMessagingAgent_ClosePublishSession_FullMethodName, in, out, cOpts...)
  57. if err != nil {
  58. return nil, err
  59. }
  60. return out, nil
  61. }
  62. func (c *seaweedMessagingAgentClient) PublishRecord(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[PublishRecordRequest, PublishRecordResponse], error) {
  63. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  64. stream, err := c.cc.NewStream(ctx, &SeaweedMessagingAgent_ServiceDesc.Streams[0], SeaweedMessagingAgent_PublishRecord_FullMethodName, cOpts...)
  65. if err != nil {
  66. return nil, err
  67. }
  68. x := &grpc.GenericClientStream[PublishRecordRequest, PublishRecordResponse]{ClientStream: stream}
  69. return x, nil
  70. }
  71. // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
  72. type SeaweedMessagingAgent_PublishRecordClient = grpc.BidiStreamingClient[PublishRecordRequest, PublishRecordResponse]
  73. func (c *seaweedMessagingAgentClient) StartSubscribeSession(ctx context.Context, in *StartSubscribeSessionRequest, opts ...grpc.CallOption) (*StartSubscribeSessionResponse, error) {
  74. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  75. out := new(StartSubscribeSessionResponse)
  76. err := c.cc.Invoke(ctx, SeaweedMessagingAgent_StartSubscribeSession_FullMethodName, in, out, cOpts...)
  77. if err != nil {
  78. return nil, err
  79. }
  80. return out, nil
  81. }
  82. func (c *seaweedMessagingAgentClient) CloseSubscribeSession(ctx context.Context, in *CloseSubscribeSessionRequest, opts ...grpc.CallOption) (*CloseSubscribeSessionResponse, error) {
  83. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  84. out := new(CloseSubscribeSessionResponse)
  85. err := c.cc.Invoke(ctx, SeaweedMessagingAgent_CloseSubscribeSession_FullMethodName, in, out, cOpts...)
  86. if err != nil {
  87. return nil, err
  88. }
  89. return out, nil
  90. }
  91. func (c *seaweedMessagingAgentClient) SubscribeRecord(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SubscribeRecordRequest, SubscribeRecordResponse], error) {
  92. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  93. stream, err := c.cc.NewStream(ctx, &SeaweedMessagingAgent_ServiceDesc.Streams[1], SeaweedMessagingAgent_SubscribeRecord_FullMethodName, cOpts...)
  94. if err != nil {
  95. return nil, err
  96. }
  97. x := &grpc.GenericClientStream[SubscribeRecordRequest, SubscribeRecordResponse]{ClientStream: stream}
  98. return x, nil
  99. }
  100. // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
  101. type SeaweedMessagingAgent_SubscribeRecordClient = grpc.BidiStreamingClient[SubscribeRecordRequest, SubscribeRecordResponse]
  102. // SeaweedMessagingAgentServer is the server API for SeaweedMessagingAgent service.
  103. // All implementations must embed UnimplementedSeaweedMessagingAgentServer
  104. // for forward compatibility.
  105. type SeaweedMessagingAgentServer interface {
  106. // Publishing
  107. StartPublishSession(context.Context, *StartPublishSessionRequest) (*StartPublishSessionResponse, error)
  108. ClosePublishSession(context.Context, *ClosePublishSessionRequest) (*ClosePublishSessionResponse, error)
  109. PublishRecord(grpc.BidiStreamingServer[PublishRecordRequest, PublishRecordResponse]) error
  110. // Subscribing
  111. StartSubscribeSession(context.Context, *StartSubscribeSessionRequest) (*StartSubscribeSessionResponse, error)
  112. CloseSubscribeSession(context.Context, *CloseSubscribeSessionRequest) (*CloseSubscribeSessionResponse, error)
  113. SubscribeRecord(grpc.BidiStreamingServer[SubscribeRecordRequest, SubscribeRecordResponse]) error
  114. mustEmbedUnimplementedSeaweedMessagingAgentServer()
  115. }
  116. // UnimplementedSeaweedMessagingAgentServer must be embedded to have
  117. // forward compatible implementations.
  118. //
  119. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  120. // pointer dereference when methods are called.
  121. type UnimplementedSeaweedMessagingAgentServer struct{}
  122. func (UnimplementedSeaweedMessagingAgentServer) StartPublishSession(context.Context, *StartPublishSessionRequest) (*StartPublishSessionResponse, error) {
  123. return nil, status.Errorf(codes.Unimplemented, "method StartPublishSession not implemented")
  124. }
  125. func (UnimplementedSeaweedMessagingAgentServer) ClosePublishSession(context.Context, *ClosePublishSessionRequest) (*ClosePublishSessionResponse, error) {
  126. return nil, status.Errorf(codes.Unimplemented, "method ClosePublishSession not implemented")
  127. }
  128. func (UnimplementedSeaweedMessagingAgentServer) PublishRecord(grpc.BidiStreamingServer[PublishRecordRequest, PublishRecordResponse]) error {
  129. return status.Errorf(codes.Unimplemented, "method PublishRecord not implemented")
  130. }
  131. func (UnimplementedSeaweedMessagingAgentServer) StartSubscribeSession(context.Context, *StartSubscribeSessionRequest) (*StartSubscribeSessionResponse, error) {
  132. return nil, status.Errorf(codes.Unimplemented, "method StartSubscribeSession not implemented")
  133. }
  134. func (UnimplementedSeaweedMessagingAgentServer) CloseSubscribeSession(context.Context, *CloseSubscribeSessionRequest) (*CloseSubscribeSessionResponse, error) {
  135. return nil, status.Errorf(codes.Unimplemented, "method CloseSubscribeSession not implemented")
  136. }
  137. func (UnimplementedSeaweedMessagingAgentServer) SubscribeRecord(grpc.BidiStreamingServer[SubscribeRecordRequest, SubscribeRecordResponse]) error {
  138. return status.Errorf(codes.Unimplemented, "method SubscribeRecord not implemented")
  139. }
  140. func (UnimplementedSeaweedMessagingAgentServer) mustEmbedUnimplementedSeaweedMessagingAgentServer() {}
  141. func (UnimplementedSeaweedMessagingAgentServer) testEmbeddedByValue() {}
  142. // UnsafeSeaweedMessagingAgentServer may be embedded to opt out of forward compatibility for this service.
  143. // Use of this interface is not recommended, as added methods to SeaweedMessagingAgentServer will
  144. // result in compilation errors.
  145. type UnsafeSeaweedMessagingAgentServer interface {
  146. mustEmbedUnimplementedSeaweedMessagingAgentServer()
  147. }
  148. func RegisterSeaweedMessagingAgentServer(s grpc.ServiceRegistrar, srv SeaweedMessagingAgentServer) {
  149. // If the following call pancis, it indicates UnimplementedSeaweedMessagingAgentServer was
  150. // embedded by pointer and is nil. This will cause panics if an
  151. // unimplemented method is ever invoked, so we test this at initialization
  152. // time to prevent it from happening at runtime later due to I/O.
  153. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  154. t.testEmbeddedByValue()
  155. }
  156. s.RegisterService(&SeaweedMessagingAgent_ServiceDesc, srv)
  157. }
  158. func _SeaweedMessagingAgent_StartPublishSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  159. in := new(StartPublishSessionRequest)
  160. if err := dec(in); err != nil {
  161. return nil, err
  162. }
  163. if interceptor == nil {
  164. return srv.(SeaweedMessagingAgentServer).StartPublishSession(ctx, in)
  165. }
  166. info := &grpc.UnaryServerInfo{
  167. Server: srv,
  168. FullMethod: SeaweedMessagingAgent_StartPublishSession_FullMethodName,
  169. }
  170. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  171. return srv.(SeaweedMessagingAgentServer).StartPublishSession(ctx, req.(*StartPublishSessionRequest))
  172. }
  173. return interceptor(ctx, in, info, handler)
  174. }
  175. func _SeaweedMessagingAgent_ClosePublishSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  176. in := new(ClosePublishSessionRequest)
  177. if err := dec(in); err != nil {
  178. return nil, err
  179. }
  180. if interceptor == nil {
  181. return srv.(SeaweedMessagingAgentServer).ClosePublishSession(ctx, in)
  182. }
  183. info := &grpc.UnaryServerInfo{
  184. Server: srv,
  185. FullMethod: SeaweedMessagingAgent_ClosePublishSession_FullMethodName,
  186. }
  187. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  188. return srv.(SeaweedMessagingAgentServer).ClosePublishSession(ctx, req.(*ClosePublishSessionRequest))
  189. }
  190. return interceptor(ctx, in, info, handler)
  191. }
  192. func _SeaweedMessagingAgent_PublishRecord_Handler(srv interface{}, stream grpc.ServerStream) error {
  193. return srv.(SeaweedMessagingAgentServer).PublishRecord(&grpc.GenericServerStream[PublishRecordRequest, PublishRecordResponse]{ServerStream: stream})
  194. }
  195. // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
  196. type SeaweedMessagingAgent_PublishRecordServer = grpc.BidiStreamingServer[PublishRecordRequest, PublishRecordResponse]
  197. func _SeaweedMessagingAgent_StartSubscribeSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  198. in := new(StartSubscribeSessionRequest)
  199. if err := dec(in); err != nil {
  200. return nil, err
  201. }
  202. if interceptor == nil {
  203. return srv.(SeaweedMessagingAgentServer).StartSubscribeSession(ctx, in)
  204. }
  205. info := &grpc.UnaryServerInfo{
  206. Server: srv,
  207. FullMethod: SeaweedMessagingAgent_StartSubscribeSession_FullMethodName,
  208. }
  209. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  210. return srv.(SeaweedMessagingAgentServer).StartSubscribeSession(ctx, req.(*StartSubscribeSessionRequest))
  211. }
  212. return interceptor(ctx, in, info, handler)
  213. }
  214. func _SeaweedMessagingAgent_CloseSubscribeSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  215. in := new(CloseSubscribeSessionRequest)
  216. if err := dec(in); err != nil {
  217. return nil, err
  218. }
  219. if interceptor == nil {
  220. return srv.(SeaweedMessagingAgentServer).CloseSubscribeSession(ctx, in)
  221. }
  222. info := &grpc.UnaryServerInfo{
  223. Server: srv,
  224. FullMethod: SeaweedMessagingAgent_CloseSubscribeSession_FullMethodName,
  225. }
  226. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  227. return srv.(SeaweedMessagingAgentServer).CloseSubscribeSession(ctx, req.(*CloseSubscribeSessionRequest))
  228. }
  229. return interceptor(ctx, in, info, handler)
  230. }
  231. func _SeaweedMessagingAgent_SubscribeRecord_Handler(srv interface{}, stream grpc.ServerStream) error {
  232. return srv.(SeaweedMessagingAgentServer).SubscribeRecord(&grpc.GenericServerStream[SubscribeRecordRequest, SubscribeRecordResponse]{ServerStream: stream})
  233. }
  234. // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
  235. type SeaweedMessagingAgent_SubscribeRecordServer = grpc.BidiStreamingServer[SubscribeRecordRequest, SubscribeRecordResponse]
  236. // SeaweedMessagingAgent_ServiceDesc is the grpc.ServiceDesc for SeaweedMessagingAgent service.
  237. // It's only intended for direct use with grpc.RegisterService,
  238. // and not to be introspected or modified (even as a copy)
  239. var SeaweedMessagingAgent_ServiceDesc = grpc.ServiceDesc{
  240. ServiceName: "messaging_pb.SeaweedMessagingAgent",
  241. HandlerType: (*SeaweedMessagingAgentServer)(nil),
  242. Methods: []grpc.MethodDesc{
  243. {
  244. MethodName: "StartPublishSession",
  245. Handler: _SeaweedMessagingAgent_StartPublishSession_Handler,
  246. },
  247. {
  248. MethodName: "ClosePublishSession",
  249. Handler: _SeaweedMessagingAgent_ClosePublishSession_Handler,
  250. },
  251. {
  252. MethodName: "StartSubscribeSession",
  253. Handler: _SeaweedMessagingAgent_StartSubscribeSession_Handler,
  254. },
  255. {
  256. MethodName: "CloseSubscribeSession",
  257. Handler: _SeaweedMessagingAgent_CloseSubscribeSession_Handler,
  258. },
  259. },
  260. Streams: []grpc.StreamDesc{
  261. {
  262. StreamName: "PublishRecord",
  263. Handler: _SeaweedMessagingAgent_PublishRecord_Handler,
  264. ServerStreams: true,
  265. ClientStreams: true,
  266. },
  267. {
  268. StreamName: "SubscribeRecord",
  269. Handler: _SeaweedMessagingAgent_SubscribeRecord_Handler,
  270. ServerStreams: true,
  271. ClientStreams: true,
  272. },
  273. },
  274. Metadata: "mq_agent.proto",
  275. }