mod ask;
mod catalog;
mod copy;
mod entry;
mod follow;
mod forward;
mod handover;
mod judge;
mod links;
mod log;
mod message;
mod node;
mod pack;
mod promote;
mod queue;
mod serve;
mod snapshot;
mod status;
mod transport;
mod verify;
mod witness;
use std::fmt;
pub use ask::served_by;
pub(crate) use copy::is_copy;
#[cfg(feature = "blobs")]
pub(crate) use forward::BLOBS;
#[cfg(feature = "jobs")]
pub(crate) use forward::JOBS;
#[cfg(feature = "kv")]
pub(crate) use forward::KV;
#[cfg(feature = "search")]
pub(crate) use forward::SEARCH;
#[cfg(feature = "sql")]
pub(crate) use forward::SQL;
pub(crate) use forward::{Lenders, database_file, database_of, enqueue, make_in, pass_on, queued, tag_of};
pub use handover::{Moved, move_home};
pub use links::{Follower, Links, links};
pub(crate) use log::Notify;
pub(crate) use message::{In, Out};
pub(crate) use node::{Claimed, State};
pub use promote::{Demoted, Promoted, demote, promote};
pub use status::{FileStatus, status};
pub use verify::verify;
#[derive(Clone, Default)]
pub struct Node {
pub from: Vec<String>,
pub serve: Option<String>,
pub files: Option<Vec<String>>,
pub token: Option<String>,
pub synchronous: bool,
pub synchronous_with: Vec<String>,
pub tls: Option<NodeTls>,
pub catalog: bool,
pub advertise: Option<String>,
pub failover: Option<String>,
pub witness: bool,
pub insecure: bool,
}
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct NodeTls {
pub cert: Option<std::path::PathBuf>,
pub key: Option<std::path::PathBuf>,
pub roots: Option<std::path::PathBuf>,
}
impl fmt::Debug for Node {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Node")
.field("from", &self.from)
.field("serve", &self.serve)
.field("files", &self.files)
.field("token", &self.token.as_ref().map(|_| "hidden"))
.field("synchronous", &self.synchronous)
.field("synchronous_with", &self.synchronous_with)
.field("tls", &self.tls)
.field("catalog", &self.catalog)
.field("advertise", &self.advertise)
.field("failover", &self.failover)
.field("witness", &self.witness)
.field("insecure", &self.insecure)
.finish()
}
}
pub(crate) const NODE_LOCAL: [&str; 2] = ["records.db", "metrics.db"];
pub(crate) const DIR: &str = "log";
pub(crate) use log::Bounds;
#[cfg(test)]
pub(crate) use log::Log;
#[cfg(test)]
#[path = "log_tests.rs"]
mod tests;
#[cfg(all(
test,
feature = "jobs",
feature = "sql",
feature = "search",
feature = "blobs",
feature = "records",
feature = "metrics"
))]
#[path = "node_tests.rs"]
mod node_tests;
#[cfg(all(
test,
feature = "jobs",
feature = "sql",
feature = "search",
feature = "blobs",
feature = "records",
feature = "metrics"
))]
#[path = "copy_tests.rs"]
mod copy_tests;
#[cfg(all(
test,
feature = "jobs",
feature = "sql",
feature = "search",
feature = "blobs",
feature = "records",
feature = "metrics"
))]
#[path = "link_tests.rs"]
mod link_tests;
#[cfg(all(
test,
feature = "jobs",
feature = "sql",
feature = "search",
feature = "blobs",
feature = "records",
feature = "metrics"
))]
#[path = "stress_tests.rs"]
mod stress_tests;