flowsrv_grpc.pb.go 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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: pb/flowsrv.proto
  6. package 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. // FlowsrvClient is the client API for Flowsrv 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 FlowsrvClient interface {
  21. Connect(ctx context.Context, in *CommandReq, opts ...grpc.CallOption) (Flowsrv_ConnectClient, error)
  22. Disconnect(ctx context.Context, in *CommandReq, opts ...grpc.CallOption) (*CommandResp, error)
  23. }
  24. type flowsrvClient struct {
  25. cc grpc.ClientConnInterface
  26. }
  27. func NewFlowsrvClient(cc grpc.ClientConnInterface) FlowsrvClient {
  28. return &flowsrvClient{cc}
  29. }
  30. func (c *flowsrvClient) Connect(ctx context.Context, in *CommandReq, opts ...grpc.CallOption) (Flowsrv_ConnectClient, error) {
  31. stream, err := c.cc.NewStream(ctx, &Flowsrv_ServiceDesc.Streams[0], "/pb.Flowsrv/connect", opts...)
  32. if err != nil {
  33. return nil, err
  34. }
  35. x := &flowsrvConnectClient{stream}
  36. if err := x.ClientStream.SendMsg(in); err != nil {
  37. return nil, err
  38. }
  39. if err := x.ClientStream.CloseSend(); err != nil {
  40. return nil, err
  41. }
  42. return x, nil
  43. }
  44. type Flowsrv_ConnectClient interface {
  45. Recv() (*CommandResp, error)
  46. grpc.ClientStream
  47. }
  48. type flowsrvConnectClient struct {
  49. grpc.ClientStream
  50. }
  51. func (x *flowsrvConnectClient) Recv() (*CommandResp, error) {
  52. m := new(CommandResp)
  53. if err := x.ClientStream.RecvMsg(m); err != nil {
  54. return nil, err
  55. }
  56. return m, nil
  57. }
  58. func (c *flowsrvClient) Disconnect(ctx context.Context, in *CommandReq, opts ...grpc.CallOption) (*CommandResp, error) {
  59. out := new(CommandResp)
  60. err := c.cc.Invoke(ctx, "/pb.Flowsrv/disconnect", in, out, opts...)
  61. if err != nil {
  62. return nil, err
  63. }
  64. return out, nil
  65. }
  66. // FlowsrvServer is the server API for Flowsrv service.
  67. // All implementations must embed UnimplementedFlowsrvServer
  68. // for forward compatibility
  69. type FlowsrvServer interface {
  70. Connect(*CommandReq, Flowsrv_ConnectServer) error
  71. Disconnect(context.Context, *CommandReq) (*CommandResp, error)
  72. mustEmbedUnimplementedFlowsrvServer()
  73. }
  74. // UnimplementedFlowsrvServer must be embedded to have forward compatible implementations.
  75. type UnimplementedFlowsrvServer struct {
  76. }
  77. func (UnimplementedFlowsrvServer) Connect(*CommandReq, Flowsrv_ConnectServer) error {
  78. return status.Errorf(codes.Unimplemented, "method Connect not implemented")
  79. }
  80. func (UnimplementedFlowsrvServer) Disconnect(context.Context, *CommandReq) (*CommandResp, error) {
  81. return nil, status.Errorf(codes.Unimplemented, "method Disconnect not implemented")
  82. }
  83. func (UnimplementedFlowsrvServer) mustEmbedUnimplementedFlowsrvServer() {}
  84. // UnsafeFlowsrvServer may be embedded to opt out of forward compatibility for this service.
  85. // Use of this interface is not recommended, as added methods to FlowsrvServer will
  86. // result in compilation errors.
  87. type UnsafeFlowsrvServer interface {
  88. mustEmbedUnimplementedFlowsrvServer()
  89. }
  90. func RegisterFlowsrvServer(s grpc.ServiceRegistrar, srv FlowsrvServer) {
  91. s.RegisterService(&Flowsrv_ServiceDesc, srv)
  92. }
  93. func _Flowsrv_Connect_Handler(srv interface{}, stream grpc.ServerStream) error {
  94. m := new(CommandReq)
  95. if err := stream.RecvMsg(m); err != nil {
  96. return err
  97. }
  98. return srv.(FlowsrvServer).Connect(m, &flowsrvConnectServer{stream})
  99. }
  100. type Flowsrv_ConnectServer interface {
  101. Send(*CommandResp) error
  102. grpc.ServerStream
  103. }
  104. type flowsrvConnectServer struct {
  105. grpc.ServerStream
  106. }
  107. func (x *flowsrvConnectServer) Send(m *CommandResp) error {
  108. return x.ServerStream.SendMsg(m)
  109. }
  110. func _Flowsrv_Disconnect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  111. in := new(CommandReq)
  112. if err := dec(in); err != nil {
  113. return nil, err
  114. }
  115. if interceptor == nil {
  116. return srv.(FlowsrvServer).Disconnect(ctx, in)
  117. }
  118. info := &grpc.UnaryServerInfo{
  119. Server: srv,
  120. FullMethod: "/pb.Flowsrv/disconnect",
  121. }
  122. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  123. return srv.(FlowsrvServer).Disconnect(ctx, req.(*CommandReq))
  124. }
  125. return interceptor(ctx, in, info, handler)
  126. }
  127. // Flowsrv_ServiceDesc is the grpc.ServiceDesc for Flowsrv service.
  128. // It's only intended for direct use with grpc.RegisterService,
  129. // and not to be introspected or modified (even as a copy)
  130. var Flowsrv_ServiceDesc = grpc.ServiceDesc{
  131. ServiceName: "pb.Flowsrv",
  132. HandlerType: (*FlowsrvServer)(nil),
  133. Methods: []grpc.MethodDesc{
  134. {
  135. MethodName: "disconnect",
  136. Handler: _Flowsrv_Disconnect_Handler,
  137. },
  138. },
  139. Streams: []grpc.StreamDesc{
  140. {
  141. StreamName: "connect",
  142. Handler: _Flowsrv_Connect_Handler,
  143. ServerStreams: true,
  144. },
  145. },
  146. Metadata: "pb/flowsrv.proto",
  147. }