gsbrs 0.6.0

Provides a client for the Google Safe Browsing Lookup API
docs.rs failed to build gsbrs-0.6.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: gsbrs-0.7.1

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

[dependencies]
gsbrs = "0.5.0"

Example

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.