Expand description
domain_status library: core URL scanning functionality
This library provides high-level APIs for scanning URLs and capturing comprehensive metadata including HTTP status, TLS certificates, DNS information, technology fingerprints, and more.
§Example
use domain_status::{Config, run_scan};
use tokio;
let config = Config {
file: std::path::PathBuf::from("urls.txt"),
max_concurrency: 50,
rate_limit_rps: 20,
..Default::default()
};
let report = run_scan(config).await?;
println!("Processed {} URLs: {} succeeded, {} failed",
report.total_urls, report.successful, report.failed);§Requirements
This library requires a Tokio runtime. Use #[tokio::main] in your application
or ensure you’re calling library functions within an async context.
§Stability and API guarantees
- Stable: Exit codes (see project docs),
Configvalidation rules, and public function signatures and types followSemVer. - May change: Exact wording of error messages, the internal error chain and downcasting behavior, and default config values (e.g. timeouts, limits) may change in patch or minor releases to improve safety or diagnostics.
Re-exports§
pub use cli::evaluate_exit_code;pub use config::Config;pub use config::FailOn;pub use config::LogFormat;pub use config::LogLevel;pub use config::ScanDependencyOverrides;pub use exit_codes::EXIT_NO_URLS_PCT;pub use exit_codes::EXIT_POLICY_FAILURE;pub use exit_codes::EXIT_RUNTIME_ERROR;pub use exit_codes::EXIT_SUCCESS;pub use whois::lookup_whois;pub use whois::WhoisResult;
Modules§
- cli
- CLI parsing and command execution.
- config
- Application configuration and constants.
- exit_
codes - Named exit codes for the
domain_statusbinary. - export
- Export functionality for
domain_statusdata. - initialization
- Application initialization and resource setup.
- whois
- WHOIS/RDAP domain lookup using whois-service crate
Structs§
- GeoIp
Service - Owned
GeoIPservice that can be instantiated in tests without relying on process-global state. - RunSummary
- Summary of a completed run, suitable for displaying run history.
- Scan
Report - Results of a URL scanning run.
- UrlRecord
- Represents a complete URL status record for database insertion.
- UrlRecord
Insert Params - Parameters for inserting a URL record.
Enums§
- Database
Error - Error types for database operations.
- Fingerprint
Error - Error types for technology fingerprinting operations.
- KeyAlgorithm
- Public key algorithm used in a TLS certificate.
- RunScan
Error - Error returned by
run_scan: either during setup (startup) or during the main loop (runtime). - Startup
Error - Errors that occur before or during scan setup (config, init, bind).
- TlsVersion
- TLS protocol version negotiated during an HTTPS connection.
Traits§
- Error
Ext - Extension trait for errors that formats the full error chain.
- Reqwest
Error Ext - Extension trait for
reqwest::Errorproviding categorization and retriability.
Functions§
- init_
db_ pool_ with_ path - Initializes and returns a database connection pool with an explicit path.
- insert_
url_ record - Inserts a
UrlRecordinto the database with retry logic for transient errors. - log_
error_ chain - Logs each cause in an error chain with
log::error!. - print_
io_ error_ hint_ if_ applicable - If the error chain contains an IO or path-related error, prints a short hint to stderr.
- query_
run_ history - Query run history from the database.
- run_
migrations - Runs
SQLxmigrations embedded in the binary. - run_
scan - Runs a URL scan with the provided configuration.