// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v3.19.4 // source: pb/flowsrv.proto package pb import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // FlowsrvClient is the client API for Flowsrv service. // // 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. type FlowsrvClient interface { Connect(ctx context.Context, in *CommandReq, opts ...grpc.CallOption) (Flowsrv_ConnectClient, error) Disconnect(ctx context.Context, in *CommandReq, opts ...grpc.CallOption) (*CommandResp, error) } type flowsrvClient struct { cc grpc.ClientConnInterface } func NewFlowsrvClient(cc grpc.ClientConnInterface) FlowsrvClient { return &flowsrvClient{cc} } func (c *flowsrvClient) Connect(ctx context.Context, in *CommandReq, opts ...grpc.CallOption) (Flowsrv_ConnectClient, error) { stream, err := c.cc.NewStream(ctx, &Flowsrv_ServiceDesc.Streams[0], "/pb.Flowsrv/connect", opts...) if err != nil { return nil, err } x := &flowsrvConnectClient{stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } if err := x.ClientStream.CloseSend(); err != nil { return nil, err } return x, nil } type Flowsrv_ConnectClient interface { Recv() (*CommandResp, error) grpc.ClientStream } type flowsrvConnectClient struct { grpc.ClientStream } func (x *flowsrvConnectClient) Recv() (*CommandResp, error) { m := new(CommandResp) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } func (c *flowsrvClient) Disconnect(ctx context.Context, in *CommandReq, opts ...grpc.CallOption) (*CommandResp, error) { out := new(CommandResp) err := c.cc.Invoke(ctx, "/pb.Flowsrv/disconnect", in, out, opts...) if err != nil { return nil, err } return out, nil } // FlowsrvServer is the server API for Flowsrv service. // All implementations must embed UnimplementedFlowsrvServer // for forward compatibility type FlowsrvServer interface { Connect(*CommandReq, Flowsrv_ConnectServer) error Disconnect(context.Context, *CommandReq) (*CommandResp, error) mustEmbedUnimplementedFlowsrvServer() } // UnimplementedFlowsrvServer must be embedded to have forward compatible implementations. type UnimplementedFlowsrvServer struct { } func (UnimplementedFlowsrvServer) Connect(*CommandReq, Flowsrv_ConnectServer) error { return status.Errorf(codes.Unimplemented, "method Connect not implemented") } func (UnimplementedFlowsrvServer) Disconnect(context.Context, *CommandReq) (*CommandResp, error) { return nil, status.Errorf(codes.Unimplemented, "method Disconnect not implemented") } func (UnimplementedFlowsrvServer) mustEmbedUnimplementedFlowsrvServer() {} // UnsafeFlowsrvServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to FlowsrvServer will // result in compilation errors. type UnsafeFlowsrvServer interface { mustEmbedUnimplementedFlowsrvServer() } func RegisterFlowsrvServer(s grpc.ServiceRegistrar, srv FlowsrvServer) { s.RegisterService(&Flowsrv_ServiceDesc, srv) } func _Flowsrv_Connect_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(CommandReq) if err := stream.RecvMsg(m); err != nil { return err } return srv.(FlowsrvServer).Connect(m, &flowsrvConnectServer{stream}) } type Flowsrv_ConnectServer interface { Send(*CommandResp) error grpc.ServerStream } type flowsrvConnectServer struct { grpc.ServerStream } func (x *flowsrvConnectServer) Send(m *CommandResp) error { return x.ServerStream.SendMsg(m) } func _Flowsrv_Disconnect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CommandReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(FlowsrvServer).Disconnect(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/pb.Flowsrv/disconnect", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FlowsrvServer).Disconnect(ctx, req.(*CommandReq)) } return interceptor(ctx, in, info, handler) } // Flowsrv_ServiceDesc is the grpc.ServiceDesc for Flowsrv service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Flowsrv_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pb.Flowsrv", HandlerType: (*FlowsrvServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "disconnect", Handler: _Flowsrv_Disconnect_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "connect", Handler: _Flowsrv_Connect_Handler, ServerStreams: true, }, }, Metadata: "pb/flowsrv.proto", }