CryBase::CouchBase::Client
Inherits CryBase::Interfaces::Client < Reference < Object
Cluster-level client that enumerates and probes every Couchbase service interface (KV, Query, Search, Analytics, Index, Eventing, Views, Management) for the configured hosts, over either plaintext or TLS ports.
No protocol handshake is performed at this layer — connect only
validates TCP reachability so callers can confirm the cluster's
network surface before driving a service-specific protocol (for
example CryBase::CouchBase::Services::KV::Client).
client = CryBase::CouchBase::Client.connect("couchbase://node1,node2")
kv_eps = client.endpoints_for(CryBase::CouchBase::Service::KV)
client.close
Constructors
Builds the client and immediately calls connect. Equivalent to
new(...).tap(&.connect).
client = CryBase::CouchBase::Client.connect(
"couchbases://node1,node2",
username: "Administrator",
password: "s3cret",
)
Parses uri and pre-computes the full endpoints matrix
(one per host × service). No network activity yet.
Instance methods
Marks the client as no longer connected?. This layer holds no
persistent sockets, so this is purely a state flip.
Probes every endpoint over TCP and returns the reachable subset.
Marks the client as connected? if at least one endpoint
responded; otherwise raises IO::Error.
reachable = client.connect # => [Endpoint, Endpoint, ...]
Returns every Endpoint for the given service, in host order.
client.endpoints_for(CryBase::CouchBase::Service::KV).map(&.host)
# => ["node1", "node2"]