Skip to content

About

Service Bindings for Kubernetes Rust Client

Resources

Code of conduct

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

59 Commits

Folders and files

Repository files navigation

client-rust

Tests codecov

client-rust is a library to access Service Binding Specification for Kubernetes conformant Service Binding Workload Projections.

Example

use postgres::{Client, NoTls};

use service_bindings::binding::Binding;
use service_bindings::bindings;

fn main() {
    let b = bindings::from_service_binding_root();
    let c = bindings::filter(b, "postgresql");

    if c.len() != 1 {
        panic!("Incorrect number of PostgreSQL bindings: {}", c.len())
    }

    let u = c[0].get("url");
    let conn = match u {
        None => panic!("No URL in binding"),
        Some(u) => Client::connect(u, NoTls),
    };

    // ...
}

License

Apache License v2.0: see LICENSE for details.

About

Service Bindings for Kubernetes Rust Client

Resources

Code of conduct

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages