Skip to content

Rust interface to Google Safe Browsing Lookup API

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

insanitybit/gsblookup-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.6.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.

License

Licensed under either of

at your option.

Contribution

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.

About

Rust interface to Google Safe Browsing Lookup API

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