schemas_v1_api_index - OmniCloudOrg/OmniOrchestrator GitHub Wiki

index (src/schemas/v1/api)

Path: src/schemas/v1/api/index.rs

Table of Contents

Public Items

struct RouteInfo

Definition

pub struct RouteInfo {
    /// Path of the route
    path: String,
    /// HTTP methods supported by the route
    methods: Vec<String>,
}

Documentation

Route information structure for API documentation

struct RoutesResponse

Definition

pub struct RoutesResponse {
    /// List of all available routes and their methods
    routes: Vec<RouteInfo>,
}

Documentation

Response structure for routes listing endpoint

struct RoutesCollection

Definition

pub struct RoutesCollection {
    routes: Vec<RouteInfo>,
}

Documentation

Routes collection that will be populated during startup

fn new

Definition

    pub fn new() -> Self {
        Self { routes: Vec::new() }
    }

    pub fn add_route(&mut self, path: String, method: String) {
    // ... function body
}

fn add_route

Definition

    pub fn add_route(&mut self, path: String, method: String) {
        // Check if the route already exists
        if let Some(route) = self.routes.iter_mut().find(|r| r.path == path) {
    // ... function body
}

fn get_routes

Definition

    pub fn get_routes(&self) -> Vec<RouteInfo> {
        self.routes.clone()
    }
}

/// Global singleton instance of the routes collection
/// Stores information about all registered API routes
lazy_static! {
    // ... function body
}

fn collect_routes

Definition

pub fn collect_routes(rocket: &Rocket<Build>) {
    let mut routes_collection = ROUTES_COLLECTION.lock().unwrap();

fn routes_ui

Definition

pub fn routes_ui() -> content::RawHtml<String> {
    let routes_collection = ROUTES_COLLECTION.lock().unwrap();

Documentation

Routes listing endpoint providing HTML representation of routes

⚠️ **GitHub.com Fallback** ⚠️