Crate garnix_insights

Source
Expand description

§Garnix Insights Library

A Rust library for analyzing build status information from Garnix.io. This library provides functionality to query Garnix build status, format results, and interact with the Garnix API through various interfaces including CLI, HTTP server, and Model Context Protocol (MCP) server.

§Features

  • HTTP Client: Fetch build status from Garnix.io API
  • Multiple Output Formats: JSON and human-readable formatting
  • CLI Interface: Command-line tool with multiple commands
  • HTTP Server: REST API server for build status queries
  • MCP Server: Model Context Protocol server for AI agents
  • Error Handling: Comprehensive error types and handling
  • Testing: Full test coverage with mocks and integration tests

§Quick Start

use garnix_insights::{get_garnix_data, format_build_summary};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let response = get_garnix_data("your-jwt-token", "commit-sha").await?;
    let summary = format_build_summary(&response);
    println!("{}", summary);
    Ok(())
}

Re-exports§

pub use client::GarnixClient;
pub use error::GarnixError;
pub use error::GarnixResult;
pub use types::Build;
pub use types::GarnixRequest;
pub use types::GarnixResponse;
pub use types::Summary;

Modules§

cli
Command-line interface for Garnix Insights
client
HTTP client for interacting with the Garnix.io API
error
Error types for the Garnix Fetcher library
mcp
Model Context Protocol (MCP) server implementation for Garnix Insights
server
HTTP server implementation for Garnix Fetcher
types
Type definitions for Garnix API responses and requests

Functions§

format_build_details
Format build details as a human-readable string
format_build_summary
Format a build summary as a human-readable string
get_garnix_data
The main function to fetch Garnix data for a given commit