ext/libcouchbase/src/connspec.h in libcouchbase-0.0.7 vs ext/libcouchbase/src/connspec.h in libcouchbase-0.0.8

- old
+ new

@@ -71,20 +71,34 @@ return !m_transports.empty() || (m_flags & LCB_CONNSPEC_F_FILEONLY); } bool is_bs_http() const { return has_bsmode(LCB_CONFIG_TRANSPORT_HTTP); } bool is_bs_cccp() const { return has_bsmode(LCB_CONFIG_TRANSPORT_CCCP); } bool is_bs_file() const { return m_flags & LCB_CONNSPEC_F_FILEONLY; } + + /** + * Whether a DNS SRV lookup can be performed on this connection string. + * @return true if a DNS SRV lookup is possible, or false if there is + * a parameter or format of the connection string preventing a lookup + */ + bool can_dnssrv() const; + + /** + * Whether the explicit `couchbase{s}+dnssrv` internal scheme is used + */ + bool is_explicit_dnssrv() const; uint16_t default_port() const { return m_implicit_port; } const std::vector<Spechost>& hosts() const { return m_hosts; } const std::string& bucket() const { return m_bucket; } const std::string& username() const { return m_username; } const std::string& password() const { return m_password; } const std::string& certpath() const { return m_certpath; } unsigned sslopts() const { return m_sslopts; } const Options& options() const { return m_ctlopts; } unsigned loglevel() const { return m_loglevel; } const std::string& connstr() const { return m_connstr; } + void clear_hosts() { m_hosts.clear(); } + void add_host(const Spechost& host) { m_hosts.push_back(host); } private: Options m_ctlopts; std::string m_bucket; std::string m_username; std::string m_password; @@ -108,10 +122,13 @@ #define LCB_SPECSCHEME_MCD "couchbase://" #define LCB_SPECSCHEME_MCD_SSL "couchbases://" #define LCB_SPECSCHEME_HTTP "http://" #define LCB_SPECSCHEME_HTTP_SSL "https-internal://" #define LCB_SPECSCHEME_MCCOMPAT "memcached://" +#define LCB_SPECSCHEME_SRV "couchbase+dnssrv://" +#define LCB_SPECSCHEME_SRV_SSL "couchbases+dnssrv://" } // namespace + #endif #ifdef _MSC_VER #pragma warning(pop) #endif