Allow inspecting more domains
This commit is contained in:
parent
f8756e1359
commit
bde4a7e5e2
|
@ -15,7 +15,10 @@ use std::path::PathBuf;
|
||||||
use quickpeep_raker::config;
|
use quickpeep_raker::config;
|
||||||
|
|
||||||
use quickpeep_raker::storage::mdbx_helper_types::MdbxBare;
|
use quickpeep_raker::storage::mdbx_helper_types::MdbxBare;
|
||||||
use quickpeep_raker::storage::records::AllowedDomainRecord;
|
use quickpeep_raker::storage::records::{
|
||||||
|
ActiveDomainRecord, AllowedDomainRecord, BackingOffDomainRecord, OnHoldUrlRecord,
|
||||||
|
QueueUrlRecord, UrlVisitedRecord, WeedDomainRecord,
|
||||||
|
};
|
||||||
use quickpeep_raker::storage::{RakerStore, RakerTxn};
|
use quickpeep_raker::storage::{RakerStore, RakerTxn};
|
||||||
|
|
||||||
/// Seeds a raker's queue with URLs
|
/// Seeds a raker's queue with URLs
|
||||||
|
@ -60,6 +63,54 @@ pub async fn main() -> anyhow::Result<()> {
|
||||||
|
|
||||||
let txn = store.ro_txn()?;
|
let txn = store.ro_txn()?;
|
||||||
match opts.table.as_ref() {
|
match opts.table.as_ref() {
|
||||||
|
"queue_urls" | "urls_queue" => {
|
||||||
|
inspect::<MdbxBare<QueueUrlRecord>>(
|
||||||
|
opts.key_name.as_ref(),
|
||||||
|
opts.prefix,
|
||||||
|
&txn.mdbx.borrow_dbs().queue_urls,
|
||||||
|
&txn,
|
||||||
|
)?;
|
||||||
|
}
|
||||||
|
"active_domains" => {
|
||||||
|
inspect::<MdbxBare<ActiveDomainRecord>>(
|
||||||
|
opts.key_name.as_ref(),
|
||||||
|
opts.prefix,
|
||||||
|
&txn.mdbx.borrow_dbs().active_domains,
|
||||||
|
&txn,
|
||||||
|
)?;
|
||||||
|
}
|
||||||
|
"active_domains_raffle" => {
|
||||||
|
inspect::<MdbxBare<String>>(
|
||||||
|
opts.key_name.as_ref(),
|
||||||
|
opts.prefix,
|
||||||
|
&txn.mdbx.borrow_dbs().active_domain_raffle,
|
||||||
|
&txn,
|
||||||
|
)?;
|
||||||
|
}
|
||||||
|
"backing_off_reinstatements" => {
|
||||||
|
inspect::<MdbxBare<String>>(
|
||||||
|
opts.key_name.as_ref(),
|
||||||
|
opts.prefix,
|
||||||
|
&txn.mdbx.borrow_dbs().backing_off_reinstatements,
|
||||||
|
&txn,
|
||||||
|
)?;
|
||||||
|
}
|
||||||
|
"backing_off_domains" => {
|
||||||
|
inspect::<MdbxBare<BackingOffDomainRecord>>(
|
||||||
|
opts.key_name.as_ref(),
|
||||||
|
opts.prefix,
|
||||||
|
&txn.mdbx.borrow_dbs().backing_off_domains,
|
||||||
|
&txn,
|
||||||
|
)?;
|
||||||
|
}
|
||||||
|
"visited_urls" => {
|
||||||
|
inspect::<MdbxBare<UrlVisitedRecord>>(
|
||||||
|
opts.key_name.as_ref(),
|
||||||
|
opts.prefix,
|
||||||
|
&txn.mdbx.borrow_dbs().visited_urls,
|
||||||
|
&txn,
|
||||||
|
)?;
|
||||||
|
}
|
||||||
"allowed_domains" => {
|
"allowed_domains" => {
|
||||||
inspect::<MdbxBare<AllowedDomainRecord>>(
|
inspect::<MdbxBare<AllowedDomainRecord>>(
|
||||||
opts.key_name.as_ref(),
|
opts.key_name.as_ref(),
|
||||||
|
@ -68,6 +119,22 @@ pub async fn main() -> anyhow::Result<()> {
|
||||||
&txn,
|
&txn,
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
|
"urls_on_hold" => {
|
||||||
|
inspect::<MdbxBare<OnHoldUrlRecord>>(
|
||||||
|
opts.key_name.as_ref(),
|
||||||
|
opts.prefix,
|
||||||
|
&txn.mdbx.borrow_dbs().urls_on_hold,
|
||||||
|
&txn,
|
||||||
|
)?;
|
||||||
|
}
|
||||||
|
"weed_domains" => {
|
||||||
|
inspect::<MdbxBare<WeedDomainRecord>>(
|
||||||
|
opts.key_name.as_ref(),
|
||||||
|
opts.prefix,
|
||||||
|
&txn.mdbx.borrow_dbs().weed_domains,
|
||||||
|
&txn,
|
||||||
|
)?;
|
||||||
|
}
|
||||||
other => {
|
other => {
|
||||||
dark_yellow_ln!("Unknown database {:?}", other);
|
dark_yellow_ln!("Unknown database {:?}", other);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue