mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-08 21:15:14 +00:00
refactor: Add comprehensive documentation with examples to charging-engine modules
- 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
This commit is contained in:
@@ -1,3 +1,37 @@
|
||||
//! # 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;
|
||||
|
||||
Reference in New Issue
Block a user