flowsrv_grpc.pb.go 3.8 KB

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