client_grpc.pb.go 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.2.0
  4. // - protoc v3.19.4
  5. // source: protos/client.proto
  6. package client
  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. // PaintClientClient is the client API for PaintClient service.
  18. //
  19. // 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.
  20. type PaintClientClient interface {
  21. // Sends a greeting
  22. Paint(ctx context.Context, in *PaintRequest, opts ...grpc.CallOption) (*PaintReply, error)
  23. Monitor(ctx context.Context, in *MonitorSub, opts ...grpc.CallOption) (PaintClient_MonitorClient, error)
  24. RequestRTC(ctx context.Context, opts ...grpc.CallOption) (PaintClient_RequestRTCClient, error)
  25. }
  26. type paintClientClient struct {
  27. cc grpc.ClientConnInterface
  28. }
  29. func NewPaintClientClient(cc grpc.ClientConnInterface) PaintClientClient {
  30. return &paintClientClient{cc}
  31. }
  32. func (c *paintClientClient) Paint(ctx context.Context, in *PaintRequest, opts ...grpc.CallOption) (*PaintReply, error) {
  33. out := new(PaintReply)
  34. err := c.cc.Invoke(ctx, "/PaintClient/Paint", in, out, opts...)
  35. if err != nil {
  36. return nil, err
  37. }
  38. return out, nil
  39. }
  40. func (c *paintClientClient) Monitor(ctx context.Context, in *MonitorSub, opts ...grpc.CallOption) (PaintClient_MonitorClient, error) {
  41. stream, err := c.cc.NewStream(ctx, &PaintClient_ServiceDesc.Streams[0], "/PaintClient/Monitor", opts...)
  42. if err != nil {
  43. return nil, err
  44. }
  45. x := &paintClientMonitorClient{stream}
  46. if err := x.ClientStream.SendMsg(in); err != nil {
  47. return nil, err
  48. }
  49. if err := x.ClientStream.CloseSend(); err != nil {
  50. return nil, err
  51. }
  52. return x, nil
  53. }
  54. type PaintClient_MonitorClient interface {
  55. Recv() (*MonitorReply, error)
  56. grpc.ClientStream
  57. }
  58. type paintClientMonitorClient struct {
  59. grpc.ClientStream
  60. }
  61. func (x *paintClientMonitorClient) Recv() (*MonitorReply, error) {
  62. m := new(MonitorReply)
  63. if err := x.ClientStream.RecvMsg(m); err != nil {
  64. return nil, err
  65. }
  66. return m, nil
  67. }
  68. func (c *paintClientClient) RequestRTC(ctx context.Context, opts ...grpc.CallOption) (PaintClient_RequestRTCClient, error) {
  69. stream, err := c.cc.NewStream(ctx, &PaintClient_ServiceDesc.Streams[1], "/PaintClient/RequestRTC", opts...)
  70. if err != nil {
  71. return nil, err
  72. }
  73. x := &paintClientRequestRTCClient{stream}
  74. return x, nil
  75. }
  76. type PaintClient_RequestRTCClient interface {
  77. Send(*RTCData) error
  78. Recv() (*RTCData, error)
  79. grpc.ClientStream
  80. }
  81. type paintClientRequestRTCClient struct {
  82. grpc.ClientStream
  83. }
  84. func (x *paintClientRequestRTCClient) Send(m *RTCData) error {
  85. return x.ClientStream.SendMsg(m)
  86. }
  87. func (x *paintClientRequestRTCClient) Recv() (*RTCData, error) {
  88. m := new(RTCData)
  89. if err := x.ClientStream.RecvMsg(m); err != nil {
  90. return nil, err
  91. }
  92. return m, nil
  93. }
  94. // PaintClientServer is the server API for PaintClient service.
  95. // All implementations must embed UnimplementedPaintClientServer
  96. // for forward compatibility
  97. type PaintClientServer interface {
  98. // Sends a greeting
  99. Paint(context.Context, *PaintRequest) (*PaintReply, error)
  100. Monitor(*MonitorSub, PaintClient_MonitorServer) error
  101. RequestRTC(PaintClient_RequestRTCServer) error
  102. mustEmbedUnimplementedPaintClientServer()
  103. }
  104. // UnimplementedPaintClientServer must be embedded to have forward compatible implementations.
  105. type UnimplementedPaintClientServer struct {
  106. }
  107. func (UnimplementedPaintClientServer) Paint(context.Context, *PaintRequest) (*PaintReply, error) {
  108. return nil, status.Errorf(codes.Unimplemented, "method Paint not implemented")
  109. }
  110. func (UnimplementedPaintClientServer) Monitor(*MonitorSub, PaintClient_MonitorServer) error {
  111. return status.Errorf(codes.Unimplemented, "method Monitor not implemented")
  112. }
  113. func (UnimplementedPaintClientServer) RequestRTC(PaintClient_RequestRTCServer) error {
  114. return status.Errorf(codes.Unimplemented, "method RequestRTC not implemented")
  115. }
  116. func (UnimplementedPaintClientServer) mustEmbedUnimplementedPaintClientServer() {}
  117. // UnsafePaintClientServer may be embedded to opt out of forward compatibility for this service.
  118. // Use of this interface is not recommended, as added methods to PaintClientServer will
  119. // result in compilation errors.
  120. type UnsafePaintClientServer interface {
  121. mustEmbedUnimplementedPaintClientServer()
  122. }
  123. func RegisterPaintClientServer(s grpc.ServiceRegistrar, srv PaintClientServer) {
  124. s.RegisterService(&PaintClient_ServiceDesc, srv)
  125. }
  126. func _PaintClient_Paint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  127. in := new(PaintRequest)
  128. if err := dec(in); err != nil {
  129. return nil, err
  130. }
  131. if interceptor == nil {
  132. return srv.(PaintClientServer).Paint(ctx, in)
  133. }
  134. info := &grpc.UnaryServerInfo{
  135. Server: srv,
  136. FullMethod: "/PaintClient/Paint",
  137. }
  138. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  139. return srv.(PaintClientServer).Paint(ctx, req.(*PaintRequest))
  140. }
  141. return interceptor(ctx, in, info, handler)
  142. }
  143. func _PaintClient_Monitor_Handler(srv interface{}, stream grpc.ServerStream) error {
  144. m := new(MonitorSub)
  145. if err := stream.RecvMsg(m); err != nil {
  146. return err
  147. }
  148. return srv.(PaintClientServer).Monitor(m, &paintClientMonitorServer{stream})
  149. }
  150. type PaintClient_MonitorServer interface {
  151. Send(*MonitorReply) error
  152. grpc.ServerStream
  153. }
  154. type paintClientMonitorServer struct {
  155. grpc.ServerStream
  156. }
  157. func (x *paintClientMonitorServer) Send(m *MonitorReply) error {
  158. return x.ServerStream.SendMsg(m)
  159. }
  160. func _PaintClient_RequestRTC_Handler(srv interface{}, stream grpc.ServerStream) error {
  161. return srv.(PaintClientServer).RequestRTC(&paintClientRequestRTCServer{stream})
  162. }
  163. type PaintClient_RequestRTCServer interface {
  164. Send(*RTCData) error
  165. Recv() (*RTCData, error)
  166. grpc.ServerStream
  167. }
  168. type paintClientRequestRTCServer struct {
  169. grpc.ServerStream
  170. }
  171. func (x *paintClientRequestRTCServer) Send(m *RTCData) error {
  172. return x.ServerStream.SendMsg(m)
  173. }
  174. func (x *paintClientRequestRTCServer) Recv() (*RTCData, error) {
  175. m := new(RTCData)
  176. if err := x.ServerStream.RecvMsg(m); err != nil {
  177. return nil, err
  178. }
  179. return m, nil
  180. }
  181. // PaintClient_ServiceDesc is the grpc.ServiceDesc for PaintClient service.
  182. // It's only intended for direct use with grpc.RegisterService,
  183. // and not to be introspected or modified (even as a copy)
  184. var PaintClient_ServiceDesc = grpc.ServiceDesc{
  185. ServiceName: "PaintClient",
  186. HandlerType: (*PaintClientServer)(nil),
  187. Methods: []grpc.MethodDesc{
  188. {
  189. MethodName: "Paint",
  190. Handler: _PaintClient_Paint_Handler,
  191. },
  192. },
  193. Streams: []grpc.StreamDesc{
  194. {
  195. StreamName: "Monitor",
  196. Handler: _PaintClient_Monitor_Handler,
  197. ServerStreams: true,
  198. },
  199. {
  200. StreamName: "RequestRTC",
  201. Handler: _PaintClient_RequestRTC_Handler,
  202. ServerStreams: true,
  203. ClientStreams: true,
  204. },
  205. },
  206. Metadata: "protos/client.proto",
  207. }