2 个版本
0.1.3 | 2022年4月3日 |
---|---|
0.1.2 | 2021年6月28日 |
#7 in #WHOIS
11KB
83 行
whoisthere
WHOIS 解析 crate
用法
use whoisthere::parse_info;
let domain_name: &str = "somesite.co.uk";
let whois_response_file_path_string: String = format!("tests/_data_/{}.txt", &domain_name);
let whois_response_file_path: &Path = Path::new(&whois_response_file_path_string);
let whois_response: String = fs::read_to_string(whois_response_file_path.as_os_str())
.expect("Something went wrong reading the file");
let domain_props = parse_info(domain_name, &whois_response);
assert_eq!(domain_props.domain_name, "somesite.co.uk");
assert_eq!(domain_props.expiration_date, "2022-05-14T00:00:00Z");
assert_eq!(domain_props.is_registered, true);
assert_eq!(domain_props.is_under_grace_period, false);
许可证
在法律允许的范围内,作者已经将此软件的相关版权和邻近权专属于公共领域。此软件分发时不附带任何保证。
依赖项
~3–4.5MB
~71K SLoC