| Crates.io | armature-discovery |
| lib.rs | armature-discovery |
| version | 0.1.0 |
| created_at | 2025-12-26 18:47:27.369657+00 |
| updated_at | 2025-12-26 18:47:27.369657+00 |
| description | Service discovery for Armature microservices |
| homepage | https://pegasusheavy.github.io/armature |
| repository | https://github.com/pegasusheavy/armature |
| max_upload_size | |
| id | 2006078 |
| size | 82,690 |
Service discovery for the Armature framework.
[dependencies]
armature-discovery = "0.1"
use armature_discovery::{Discovery, ConsulBackend};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let discovery = Discovery::consul("http://localhost:8500").await?;
// Register this service
discovery.register("my-service", "http://localhost:3000").await?;
// Discover other services
let instances = discovery.discover("user-service").await?;
// Get one instance (load balanced)
let instance = discovery.get_instance("user-service").await?;
Ok(())
}
let discovery = Discovery::consul("http://localhost:8500").await?;
let discovery = Discovery::etcd("http://localhost:2379").await?;
let discovery = Discovery::kubernetes().await?;
MIT OR Apache-2.0