License Build Status Coverage Status

gsblookup-rs

Rust interface to Google Safe Browsing Lookup API

Documentation

Usage

Available on crates.io

Add this to your Cargo.toml

toml [dependencies] gsbrs = "*"

Example

Looking up a single URL.

```rust let key: String = "AIzaSyCOZpLyGR3gMKqrb5A9lGSsVKtr7".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 _ => unreachable!(), } } } ```

See examples/ for more.