Expand description
§Backstage Client Library
A Rust client library for interacting with the Backstage Catalog API. This library provides type-safe access to Backstage entities and supports filtering, querying, and retrieving various entity types.
§Features
- Type-safe entities: Strongly typed representations of all Backstage entity kinds
- Async support: Built on tokio and reqwest for modern async operations
- Filtering: Support for complex entity filtering using query parameters
- Error handling: Comprehensive error types with detailed error information
- Authentication: Bearer token authentication support
§Quick Start
use backstage_client::{BackstageClient, entities::Entity};
use std::collections::HashMap;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = BackstageClient::new("https://backstage.example.com", "your-token")?;
// Fetch all entities
let entities = client.fetch_entities::<Entity>(None).await?;
println!("Found {} entities", entities.len());
// Fetch only components
let mut filters = HashMap::new();
filters.insert("kind".to_string(), "Component".to_string());
let components = client.fetch_entities::<Entity>(Some(filters)).await?;
println!("Found {} components", components.len());
Ok(())
}
§Supported Entity Types
Component
- Software componentsApiEntity
- API definitionsResourceEntity
- Infrastructure resourcesSystemEntity
- System definitionsGroupEntity
- User groupsUserEntity
- Individual usersLocationEntity
- Entity locationsDomainEntity
- Business domainsTemplateEntity
- Software templates
Re-exports§
pub use client::BackstageClient;
pub use error::ClientError;
pub use error::Result;
pub use entities::ApiEntity;
pub use entities::Component;
pub use entities::DomainEntity;
pub use entities::Entity;
pub use entities::GroupEntity;
pub use entities::LocationEntity;
pub use entities::Metadata;
pub use entities::ResourceEntity;
pub use entities::SystemEntity;
pub use entities::TemplateEntity;
pub use entities::UserEntity;
pub use entities::common::Relation;
pub use entities::common::Target;