mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-19 11:32:53 +00:00
- Add module-level documentation to lib.rs with usage example - Document Claims and AuthConfig structs with examples in auth.rs - Add ChargingEngine struct documentation with initialization example - Document ChargingRule, SubscriberAccount, AccountStatus, UsageEvent, UsageType, and RatingPlan with examples in types.rs - Add CircuitState, CircuitBreakerError, and CircuitBreaker documentation with examples in circuit_breaker.rs
44 lines
1.0 KiB
Rust
44 lines
1.0 KiB
Rust
//! # Charging Engine
|
|
//!
|
|
//! A high-performance telecom charging engine for real-time usage-based billing.
|
|
//!
|
|
//! ## Features
|
|
//!
|
|
//! - Real-time rating and billing
|
|
//! - Circuit breaker for fault tolerance
|
|
//! - Rate limiting for API protection
|
|
//! - Comprehensive monitoring and metrics
|
|
//!
|
|
//! ## Example
|
|
//!
|
|
//! ```rust,no_run
|
|
//! use charging_engine::ChargingEngine;
|
|
//! use charging_engine::charging::types::UsageEvent;
|
|
//!
|
|
//! #[tokio::main]
|
|
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
//! let engine = ChargingEngine::new("redis://localhost").await?;
|
|
//!
|
|
//! let event = UsageEvent {
|
|
//! imsi: "1234567890".to_string(),
|
|
//! volume: 1000,
|
|
//! timestamp: chrono::Utc::now(),
|
|
//! };
|
|
//!
|
|
//! let cost = engine.calculate_cost(&event).await?;
|
|
//! println!("Cost: {}", cost);
|
|
//!
|
|
//! Ok(())
|
|
//! }
|
|
//! ```
|
|
|
|
pub mod auth;
|
|
pub mod charging;
|
|
pub mod circuit_breaker;
|
|
pub mod errors;
|
|
// pub mod rate_limit;
|
|
pub mod handlers;
|
|
pub mod routes;
|
|
pub mod models;
|
|
pub mod monitoring;
|