struct
CryBase::CouchBase::Endpoint
- CryBase::CouchBase::Endpoint
- CryBase::Interfaces::Endpoint
- Struct
- Value
- Object
Overview
A single addressable Couchbase service interface — the combination
of a host, a port, the Service running on that port, and whether
the connection should be TLS.
ep = CryBase::CouchBase::Endpoint.new("h1", 11210, CryBase::CouchBase::Service::KV, false)
ep.scheme # => "couchbase"
ep.address # => "couchbase://h1:11210"
ep.to_s # => "Data (KV) couchbase://h1:11210"
Defined in:
crybase/couchbase/endpoint.crConstructors
-
.from_string(input : String, service : Service | Nil = nil) : Endpoint
Parses a connection string and returns one concrete endpoint for the first host.
- .new(host : String, port : Int32, service : Service, tls : Bool)
Instance Method Summary
-
#address : String
Full
scheme://host:portstring for this endpoint. - #host : String
- #port : Int32
-
#scheme : String
The URI scheme appropriate for this endpoint: *
"couchbase"/"couchbases"for the KV service *"http"/"https"for every other service - #service : Service
- #tls? : Bool
-
#to_s(io : IO) : Nil
Renders the endpoint as
"<service display name> <address>".
Instance methods inherited from struct CryBase::Interfaces::Endpoint
host : String
host,
initialize
initialize,
port : Int32
port,
tls? : Bool
tls?
Constructor methods inherited from struct CryBase::Interfaces::Endpoint
new
new
Constructor Detail
Parses a connection string and returns one concrete endpoint for the first host.
Pass service to choose a specific Couchbase service. When omitted,
couchbase:// and couchbases:// strings produce a KV endpoint,
while http:// and https:// strings produce a Management endpoint.
An explicit port in the string overrides the selected service's
default port.
Endpoint.from_string("couchbase://node1").address # => "couchbase://node1:11210"
Endpoint.from_string("couchbases://node1:11217").port # => 11217
Endpoint.from_string("https://node1:18091").service # => Service::Management
Endpoint.from_string("couchbase://node1", Service::Query).port # => 8093
Instance Method Detail
Full scheme://host:port string for this endpoint.
Endpoint.new("host", 11210, Service::KV, false).address # => "couchbase://host:11210"
The URI scheme appropriate for this endpoint:
"couchbase"/"couchbases"for the KV service"http"/"https"for every other service
Endpoint.new("host", 11210, Service::KV, false).scheme # => "couchbase"
Endpoint.new("host", 11207, Service::KV, true).scheme # => "couchbases"
Endpoint.new("host", 8093, Service::Query, false).scheme # => "http"
Renders the endpoint as "<service display name> <address>".
Endpoint.new("host", 11210, Service::KV, false).to_s # => "Data (KV) couchbase://host:11210"