Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.
/ airkorea-rs Public archive

Limitless Airkorea API wrapper

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

pbzweihander/airkorea-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

airkorea-rs

circleci badge crates.io badge docs.rs badge MIT License badge Apache License badge

Airkorea Crawler written in Rust.

Usage

use {airkorea, futures::prelude::*, tokio::runtime::Runtime};

let mut rt = Runtime::new();

let status = rt.block_on(airkorea::search(lng, lat))?;

println!("Station address: {}", status.station_address);
println!("Time: {}", status.time);
for pollutant in status {
    println!("{}", pollutant);
}

Testing

You can override Airkorea Url for mock testing. If you want to write unit tests for some functions using airkorea, just set AIRKOREA_URL environment variable to desired mock server.

spawn_server("localhost:1234");

std::env::set_var("AIRKOREA_URL", "http://localhost:1234");

let status = rt.block_on(airkorea::search(123.123, 456.456)).unwrap();

assert_eq!(&status.station_address, "Foobar Station");

About

Limitless Airkorea API wrapper

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages