- Add Kubernetes cluster management and operations - Include pod, service, and deployment management - Implement pattern-based resource deletion - Support namespace creation and management - Provide Rhai scripting wrappers for all functions - Include production safety features (timeouts, retries, rate limiting)
68 lines
1.6 KiB
Rust
68 lines
1.6 KiB
Rust
//! # System Abstraction Layer (SAL)
|
|
//!
|
|
//! `sal` is a library that provides a unified interface for interacting with
|
|
//! operating system features across different platforms. It abstracts away the
|
|
//! platform-specific details, allowing developers to write cross-platform code
|
|
//! with ease.
|
|
//!
|
|
//! ## Features
|
|
//!
|
|
//! - File system operations
|
|
//! - Process management
|
|
//! - System information
|
|
//! - Network operations
|
|
//! - Environment variables
|
|
//! - Cryptographic operations
|
|
|
|
use std::io;
|
|
use thiserror::Error;
|
|
|
|
/// Error types for the SAL library
|
|
#[derive(Error, Debug)]
|
|
pub enum Error {
|
|
/// An error occurred during an I/O operation
|
|
#[error("I/O error: {0}")]
|
|
Io(#[from] io::Error),
|
|
|
|
/// An error specific to the SAL library
|
|
#[error("SAL error: {0}")]
|
|
Sal(String),
|
|
|
|
/// An error that occurred in a platform-specific operation
|
|
#[error("Platform-specific error: {0}")]
|
|
Platform(String),
|
|
}
|
|
|
|
/// Result type for SAL operations
|
|
pub type Result<T> = std::result::Result<T, Error>;
|
|
|
|
// Re-export modules
|
|
pub use sal_git as git;
|
|
pub use sal_mycelium as mycelium;
|
|
pub use sal_net as net;
|
|
pub use sal_os as os;
|
|
pub use sal_postgresclient as postgresclient;
|
|
pub use sal_process as process;
|
|
pub use sal_redisclient as redisclient;
|
|
pub use sal_rhai as rhai;
|
|
pub use sal_text as text;
|
|
pub use sal_vault as vault;
|
|
pub use sal_virt as virt;
|
|
pub use sal_zinit_client as zinit_client;
|
|
|
|
// Version information
|
|
/// Returns the version of the SAL library
|
|
pub fn version() -> &'static str {
|
|
env!("CARGO_PKG_VERSION")
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
use super::*;
|
|
|
|
#[test]
|
|
fn test_version() {
|
|
assert!(!version().is_empty());
|
|
}
|
|
}
|