Crates.io | gsbrs |
lib.rs | gsbrs |
version | 0.7.1 |
source | src |
created_at | 2015-10-20 21:40:35.512657 |
updated_at | 2018-04-06 03:17:21.030618 |
description | Provides a client for the Google Safe Browsing Lookup API |
homepage | |
repository | https://github.com/insanitybit/gsblookup-rs |
max_upload_size | |
id | 3272 |
size | 35,837 |
Rust interface to Google Safe Browsing Lookup API
Available on crates.io
Add this to your Cargo.toml
[dependencies]
gsbrs = "0.6.0"
Looking up a single URL.
let key: String = "AIzaSyCOZpyGR3gMKqrb5A9lGSsVKtr7".into();
let gsb = GSBClient::new(key);
let statuses = gsb.lookup("https://google.com").unwrap();
if statuses.is_empty() {
println!("Ok");
} else {
for status in statuses {
match status {
Status::Phishing => println!("Phishing"),
Status::Malware => println!("Malware"),
Status::Unwanted => println!("Unwanted"),
// lookup only ever returns the above 3 statuses
// lookup_all can return Status::Ok as well
_ => unreachable!(),
}
}
}
See examples/ for more.
This library does not use any 'unsafe' blocks.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.