Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nebhale/client-rust
Service Bindings for Kubernetes Rust Client
https://github.com/nebhale/client-rust
Last synced: 4 days ago
JSON representation
Service Bindings for Kubernetes Rust Client
- Host: GitHub
- URL: https://github.com/nebhale/client-rust
- Owner: nebhale
- License: apache-2.0
- Created: 2021-08-28T00:48:19.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-17T21:49:01.000Z (about 2 months ago)
- Last Synced: 2024-09-18T02:36:20.220Z (about 2 months ago)
- Language: Rust
- Size: 66.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# client-rust
[![Tests](https://github.com/nebhale/client-rust/workflows/Tests/badge.svg?branch=main)](https://github.com/nebhale/client-rust/actions/workflows/tests.yaml)
[![codecov](https://codecov.io/gh/nebhale/client-rust/branch/main/graph/badge.svg)](https://codecov.io/gh/nebhale/client-rust)`client-rust` is a library to access [Service Binding Specification for Kubernetes](https://k8s-service-bindings.github.io/spec/) conformant Service Binding [Workload Projections](https://k8s-service-bindings.github.io/spec/#workload-projection).
## Example
```rust
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](./LICENSE) for details.