Skip to main content

Crate ninja

Crate ninja 

Source
Expand description

§Ninja Core Library

The core library for Ninja, a service orchestration and management framework. This library provides the foundational components for managing Shurikens (services) including configuration, scripting, installation, and lifecycle management.

§Main Components

  • manager: Main orchestrator for Shuriken management (ShurikenManager)
  • shuriken: Shuriken service representation and operations
  • common: Core types, configuration, and error handling
  • scripting: Lua-based DSL and script execution engine
  • utils: Utility functions for file operations, downloads, and system integration
  • backup: Backup and restore functionality

§Quick Start

use ninja_core::manager::ShurikenManager;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // Initialize the manager
    let manager = ShurikenManager::new().await?;

    // List all available Shurikens
    let shurikens = manager.list(false).await?;

    // Start a specific Shuriken
    manager.start(\"my-service\").await?;

    // Configure it
    manager.configure(\"my-service\").await?;

    Ok(())
}

Modules§

backup
Backup and restore functionality for Shurikens Backup and restore functionality for Ninja projects.
common
Core types, configuration, and error definitions\npub mod common; Common types, configuration, and error handling.
manager
Main orchestrator for managing Shuriken services\npub mod manager;
scripting
Lua scripting engine and DSL support\npub mod scripting; Lua scripting engine and DSL support.
shuriken
Individual Shuriken service representation and operations\npub mod shuriken;
utils
Utility functions for common operations\npub mod utils; Utility functions for common operations.

Constants§

VERSION
Version string from Cargo.toml\npub const VERSION: &str = env!("CARGO_PKG_VERSION");