cadi-registry
CADI registry client for chunk storage, retrieval and distribution.
About CADI
CADI is a universal build and distribution system where all artifacts are content-addressed chunks. The registry system enables:
- Distributed storage: Store chunks across multiple registries
- Federation: Trust policies and cross-registry replication
- Deduplication: Automatic detection and reuse of identical content
- Authentication: Token-based access control
- Namespace isolation: Organize chunks by namespace/project
Features
- HTTP-based distribution: Standard REST API for chunk operations
- Batch operations: Publish multiple chunks efficiently
- Rate limiting: Configurable request throttling
- Async/await: Tokio-based concurrent registry operations
- Authentication: Bearer token and API key support
- Error handling: Comprehensive error types with context
Installation
Add this to your Cargo.toml:
[]
= "1.0"
Basic Usage
use RegistryClient;
use Chunk;
async
Registry API
Publish Chunks
client.publish_chunk.await?;
client.publish_batch.await?;
Retrieve Chunks
let chunk = client.get_chunk.await?;
let chunks = client.get_chunks.await?;
Query Chunks
let results = client.search.await?;
let namespace_chunks = client.list_chunks.await?;
Configuration
From Environment Variables
Programmatically
let config = RegistryConfig ;
let client = from_config;
Error Handling
use ;
match client.publish_chunk.await
Integration
- Uses cadi-core for chunk types
- Works with cadi-builder to distribute built artifacts
- Integrates with cadi-scraper for publishing scraped chunks
Documentation
Full API documentation at docs.rs/cadi-registry
License
MIT License