nebucloud-xds 0.1.0

Production-ready xDS control plane library for Rust
Documentation

nebucloud-xds

Production-ready xDS control plane library for Rust.

This is the facade crate — it re-exports the four internal crates (xds-core, xds-cache, xds-server, xds-types) under a single dep line and a convenient prelude.

[dependencies]
nebucloud-xds = "0.1"

Enable TLS with the tls feature:

nebucloud-xds = { version = "0.1", features = ["tls"] }

Other opt-in features: reflection (on by default), metrics (on by default), serde, full (all of the above).

Example

use std::sync::Arc;
use nebucloud_xds::prelude::*;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let cache = Arc::new(ShardedCache::new());

    let snapshot = Snapshot::builder()
        .version("v1")
        .resources(TypeUrl::new(TypeUrl::CLUSTER), vec![])
        .build();

    cache.set_snapshot(NodeHash::from_id("my-envoy"), snapshot);

    let server = XdsServer::builder()
        .cache(cache)
        .enable_sotw()
        .enable_delta()
        .build()?;

    server.serve("[::]:18000".parse()?).await?;
    Ok(())
}

Documentation

License

Apache-2.0 OR MIT (dual-licensed).