Exemplo n.º 1
0
 public FlightDetailsController(FlightPropertyClient properties, FlightClient flights, IOptions <AppSettings> settings, IMapper mapper)
 {
     _properties = properties;
     _flights    = flights;
     _settings   = settings;
     _mapper     = mapper;
 }
Exemplo n.º 2
0
 public FlightsController(DroneClient drones, LocationClient locations, OperatorClient operators, FlightClient flights, IMapper mapper)
 {
     _drones    = drones;
     _locations = locations;
     _operators = operators;
     _flights   = flights;
     _mapper    = mapper;
 }
Exemplo n.º 3
0
        public TransportBenchmarks()
        {
            AppContext.SetSwitch(
                "System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
            flightClient = new FlightClient(GrpcChannel.ForAddress("http://127.0.0.1:5016"));


            httpClient = new HttpClient();
            jsonUrl    = "http://127.0.0.1:5015/sql";

            jsonBaselineUrl = "http://127.0.0.1:5015/api/orders";

            legacyClient = new Grpc.KoraliumService.KoraliumServiceClient(GrpcChannel.ForAddress("http://127.0.0.1:5016"));
        }
Exemplo n.º 4
0
 public AddSightingWizard(LocationClient locations,
                          FlightClient flights,
                          AirlineClient airlines,
                          ManufacturerClient manufacturers,
                          ModelClient models,
                          AircraftClient aircraft,
                          SightingClient sightings,
                          IOptions <AppSettings> settings,
                          ICacheWrapper cache,
                          IMapper mapper)
 {
     _locations     = locations;
     _flights       = flights;
     _airlines      = airlines;
     _manufacturers = manufacturers;
     _models        = models;
     _aircraft      = aircraft;
     _sightings     = sightings;
     _settings      = settings;
     _cache         = cache;
     _mapper        = mapper;
 }
Exemplo n.º 5
0
 public FlightsController(AirlineClient airlines, FlightClient flights, IMapper mapper)
 {
     _airlines = airlines;
     _flights  = flights;
     _mapper   = mapper;
 }
Exemplo n.º 6
0
        public static async Task Main(string[] args)
        {
            string host = args.Length > 0 ? args[0] : "localhost";
            string port = args.Length > 1 ? args[1] : "5000";

            // Create client
            // (In production systems, you should use https not http)
            var address = $"http://{host}:{port}";

            Console.WriteLine($"Connecting to: {address}");
            var channel = GrpcChannel.ForAddress(address);
            var client  = new FlightClient(channel);

            var recordBatches = new RecordBatch[] {
                CreateTestBatch(0, 2000), CreateTestBatch(50, 9000)
            };

            // Particular flights are identified by a descriptor. This might be a name,
            // a SQL query, or a path. Here, just using the name "test".
            var descriptor = FlightDescriptor.CreateCommandDescriptor("test");

            // Upload data with StartPut
            var batchStreamingCall = client.StartPut(descriptor);

            foreach (var batch in recordBatches)
            {
                await batchStreamingCall.RequestStream.WriteAsync(batch);
            }
            // Signal we are done sending record batches
            await batchStreamingCall.RequestStream.CompleteAsync();

            // Retrieve final response
            await batchStreamingCall.ResponseStream.MoveNext();

            Console.WriteLine(batchStreamingCall.ResponseStream.Current.ApplicationMetadata.ToStringUtf8());
            Console.WriteLine($"Wrote {recordBatches.Length} batches to server.");

            // Request information:
            var schema = await client.GetSchema(descriptor).ResponseAsync;

            Console.WriteLine($"Schema saved as: \n {schema}");

            var info = await client.GetInfo(descriptor).ResponseAsync;

            Console.WriteLine($"Info provided: \n {info}");

            Console.WriteLine($"Available flights:");
            var flights_call = client.ListFlights();

            while (await flights_call.ResponseStream.MoveNext())
            {
                Console.WriteLine("  " + flights_call.ResponseStream.Current.ToString());
            }

            // Download data
            await foreach (var batch in StreamRecordBatches(info))
            {
                Console.WriteLine($"Read batch from flight server: \n {batch}");
            }

            // See available comands on this server
            var action_stream = client.ListActions();

            Console.WriteLine("Actions:");
            while (await action_stream.ResponseStream.MoveNext())
            {
                var action = action_stream.ResponseStream.Current;
                Console.WriteLine($"  {action.Type}: {action.Description}");
            }

            // Send clear command to drop all data from the server.
            var clear_result = client.DoAction(new FlightAction("clear"));
            await clear_result.ResponseStream.MoveNext(default);
Exemplo n.º 7
0
 public FlightTests()
 {
     _flightStore    = new FlightStore();
     _testWebFactory = new TestWebFactory(_flightStore);
     _flightClient   = new FlightClient(_testWebFactory.GetChannel());
 }
Exemplo n.º 8
0
 public void Setup()
 {
     testWebFactory = new TestWebFactory();
     client         = new Apache.Arrow.Flight.Client.FlightClient(testWebFactory.GetChannel());
 }
 public HomeController(ILogger <HomeController> logger, FlightClient flightsService, IConfiguration configuration)
 {
     _flightService = flightsService;
     _logger        = logger;
 }