pub mod errors;
pub mod common;
pub mod models;
pub mod ip_geolocation;
pub mod whois;
pub mod hosteddomains;
use crate::common::Config;
pub use ip_geolocation::IpGeolocation;
pub use whois::Whois;
pub use hosteddomains::HostedDomains;
pub struct Client {
config: Config,
}
impl Client {
pub fn new(api_key: Option<String>) -> Self {
Self {
config: Config::new(api_key),
}
}
pub fn ip_geolocation(&self) -> IpGeolocation<'_> {
IpGeolocation { config: &self.config }
}
pub fn whois(&self) -> Whois<'_> {
Whois { config: &self.config }
}
pub fn hosted_domains(&self) -> HostedDomains<'_> {
HostedDomains { config: &self.config }
}
}