Skip to main content

boatramp_types/
lib.rs

1//! Shared, **wasm-clean** boatramp types: the serde wire models + the pure
2//! routing/config logic, with no IO, async, or backend dependencies. The
3//! server, the CLI, and the edge Worker all depend on this crate, so the wire
4//! format and the routing decisions can't drift between them — and it compiles
5//! to `wasm32-unknown-unknown` (the edge target) where the full `boatramp-core`
6//! (Storage/KV/wasmtime) cannot.
7//!
8//! `boatramp-core` re-exports every module here (`boatramp_core::config`,
9//! `::route`, …), so existing `boatramp_core::*` paths are unchanged.
10
11pub mod access;
12pub mod authz;
13pub mod blob_notify;
14pub mod cert;
15pub mod compute;
16pub mod config;
17pub mod cron;
18pub mod daemon_config;
19pub mod deploy;
20pub mod dns_managed;
21pub mod domain_verify;
22pub mod error;
23pub mod file;
24pub mod function;
25pub mod gateway;
26pub mod geo;
27pub mod host;
28pub mod logs;
29pub mod manifest;
30pub mod matcher;
31pub mod predicate;
32pub mod project;
33pub mod route;
34pub mod security;
35pub mod site;
36pub mod waf;
37pub mod workflow;
38
39pub use error::ConfigError;
40
41/// Schema version stamped on every persisted boatramp document (manifests,
42/// deploy/site configs, and KV records).
43///
44/// Pre-release this is **pinned at 1 and never bumped**: the discriminant is
45/// present from the start so a future release can dispatch on it, but while
46/// unreleased we change formats freely *under* v1 — no migration code, and every
47/// reader assumes v1. The first release freezes v1's
48/// meaning; only then do bumps + migrations begin.
49pub const SCHEMA_VERSION: u32 = 1;
50
51/// serde `default` for the `version` field on schema types, so documents
52/// written before the field existed (or by hand) still read as v1.
53pub fn schema_version() -> u32 {
54    SCHEMA_VERSION
55}