talos/
lib.rs

1//! Talos - A secure licensing system for Rust applications
2//!
3//! # Features
4//!
5//! Talos uses feature flags to allow you to include only what you need:
6//!
7//! - `server` - Server components (handlers, database). Enabled by default.
8//! - `sqlite` - SQLite database backend. Enabled by default.
9//! - `postgres` - PostgreSQL database backend.
10//!
11//! # Example
12//!
13//! ```toml
14//! # Use defaults (server + sqlite)
15//! talos = { git = "https://github.com/dmriding/talos" }
16//!
17//! # Client-only (no server components)
18//! talos = { git = "https://github.com/dmriding/talos", default-features = false }
19//!
20//! # Server with PostgreSQL
21//! talos = { git = "https://github.com/dmriding/talos", features = ["server", "postgres"] }
22//! ```
23
24// Core modules (always available)
25pub mod config;
26pub mod encryption;
27pub mod errors;
28pub mod hardware;
29pub mod license_key;
30pub mod tiers;
31
32// Client-related modules (always available)
33pub mod client {
34    pub mod cache;
35    pub mod encrypted_storage;
36    pub mod errors;
37    pub mod heartbeat;
38    pub mod key_generation;
39    pub mod license;
40    pub mod responses;
41    pub mod storage;
42
43    // Re-export main types at client module level
44    pub use cache::CachedValidation;
45    pub use errors::{ClientApiError, ClientErrorCode};
46    pub use license::License;
47    pub use responses::{BindResult, FeatureResult, HeartbeatResult, ValidationResult};
48    pub use storage::StorageKey;
49
50    // Re-export for backwards compatibility
51    pub use license as client;
52}
53
54// Server-related modules (requires "server" feature)
55#[cfg(feature = "server")]
56#[path = "server/mod.rs"]
57pub mod server;
58
59// Background jobs (requires "background-jobs" feature)
60#[cfg(feature = "background-jobs")]
61pub mod jobs;