Skip to main content

cairn_mod/
lib.rs

1//! Cairn — lightweight Rust-native ATProto labeler.
2//!
3//! This crate is a library surface (`cairn_mod`) plus a binary
4//! (`cairn`) for running a standalone labeler. The library modules
5//! mirror the §10 architecture of the [design doc][cairn-design]:
6//! storage, writer (single-writer task pattern, §F5), signing
7//! (§6.2), auth (§5.2), HTTP routers (§F3/F4/F11/F12), and CLI.
8//!
9//! Start points:
10//! - [`server::router`] for the subscribeLabels + queryLabels
11//!   public surface.
12//! - [`admin_router`] for the `tools.cairn.admin.*` endpoints.
13//! - [`serve::run`] for the full binary lifecycle.
14//!
15//! [cairn-design]: https://github.com/skydeval/cairn-mod/blob/main/cairn-design.md
16
17#![forbid(unsafe_code)]
18#![warn(missing_docs)]
19
20pub mod auth;
21pub mod cli;
22pub mod config;
23pub mod credential_file;
24pub mod error;
25pub mod label;
26pub mod moderators;
27pub mod report;
28pub mod serve;
29pub mod server;
30pub mod service_record;
31pub mod signing;
32pub mod signing_key;
33pub mod storage;
34pub mod writer;
35
36pub use auth::{AuthConfig, AuthContext, AuthError, VerifiedCaller};
37pub use config::Config;
38pub use error::{Error, Result};
39pub use label::Label;
40pub use server::{
41    AdminConfig, CreateReportConfig, RetentionConfig, SubscribeConfig, admin_router,
42    create_report_router, current_retention_floor, did_document_router, health_router,
43    router as subscribe_router, serve, wellknown_router,
44};
45pub use signing::{canonical_bytes, label_to_lex_value_with_sig, sign_label, verify_label};
46pub use signing_key::SigningKey;
47pub use writer::{
48    ApplyLabelRequest, LabelEvent, NegateLabelRequest, SweepBatchResult, SweepRequest, SweepResult,
49    WriterHandle, spawn as spawn_writer,
50};