nebhale / client-ruby

Service Bindings for Kubernetes Ruby Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

client-ruby

Tests codecov

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

Example

require "bindings"
require "pg"

b = Bindings.from_service_binding_root
b = Bindings.filter(b, "postgresql")
raise "Incorrect number of PostgreSQL bindings: #{b.length}" if b.length != 1

u = b[0].get("url")
raise "No URL in binding" if url.nil?

conn = PG.connect(u)

# ...

License

Apache License v2.0: see LICENSE for details.

About

Service Bindings for Kubernetes Ruby Client

License:Apache License 2.0


Languages

Language:Ruby 100.0%