#![warn(missing_docs)]
#![forbid(unsafe_code)]
#![cfg_attr(docsrs, feature(doc_cfg))]
pub mod auth;
#[cfg(feature = "chat")]
#[cfg_attr(docsrs, doc(cfg(feature = "chat")))]
pub mod chat;
pub mod cli;
pub mod command;
pub mod config;
pub mod db;
pub mod error;
pub mod hooks;
pub mod http;
pub mod mail;
pub mod migrate;
pub mod module;
pub mod rate_limit;
pub mod shutdown;
pub mod state;
#[cfg(feature = "storage")]
#[cfg_attr(docsrs, doc(cfg(feature = "storage")))]
pub mod storage;
pub mod ws;
mod app;
mod metrics;
mod openapi;
mod serve;
pub use app::{NetBackendServer, PreparedServer, ASYNCAPI_PATH};
pub use auth::{Auth, AuthContext, AuthService, Authenticator};
pub use config::{Config, SecretString};
pub use db::{Db, DbError, DbTx, Dialect};
pub use error::{AppError, Error};
pub use hooks::{Decision, Event, HookCtx, Hooks};
pub use http::{ApiJson, ClientIp, Ext, RequestId};
pub use migrate::Migration;
pub use module::Module;
pub use state::{AppState, Clock, ManualClock, SystemClock};
pub use net_backend_protocol as protocol;
pub use axum;
pub use sea_query;
pub use sqlx;
pub use utoipa;
pub use utoipa_axum;
#[cfg(all(doctest, feature = "storage", feature = "chat"))]
#[doc = include_str!("../README.md")]
struct ReadmeDoctests;
#[cfg(test)]
pub(crate) mod test_support {
use std::path::PathBuf;
#[allow(dead_code)]
pub(crate) fn temp_dir(name: &str) -> PathBuf {
use std::sync::atomic::{AtomicU32, Ordering};
static N: AtomicU32 = AtomicU32::new(0);
let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("target").join("tmp").join("unit").join(format!(
"{name}-{}-{}",
std::process::id(),
N.fetch_add(1, Ordering::Relaxed)
));
let _ = std::fs::remove_dir_all(&dir);
let _ = std::fs::create_dir_all(&dir);
dir
}
}