26#ifndef URI_ROUTING_INCLUDED
27#define URI_ROUTING_INCLUDED
47using URIQuery = std::map<std::string, std::string>;
55 URIError(
const char *msg,
const std::string &uri,
size_t position);
57 :
std::runtime_error(what_arg) {}
73 static const char query_delimiter =
'&';
83 URI(
const std::string &uri,
bool allow_path_rootless =
true)
93 allow_path_rootless_(allow_path_rootless) {
103 std::string
str()
const;
112 void set_uri(
const std::string &uri) { init_from_uri(uri); }
140 void init_from_uri(
const std::string &uri);
153 static URI parse(
const std::string &uri,
bool allow_path_rootless =
true);
154 static URI parse_shorthand_uri(
const std::string &uri,
155 bool allow_path_rootless =
true,
156 const std::string &default_scheme =
"mysql");
Exception when URI was not valid.
Definition: uri.h:53
URIError(const char *msg, const std::string &uri, size_t position)
Definition: uri.cc:62
URIError(const std::string &what_arg)
Definition: uri.h:56
Parse and create URIs according to RFC3986.
Definition: uri.h:70
std::string username
Username part found in the Authority.
Definition: uri.h:121
std::string scheme
Scheme of the URI.
Definition: uri.h:115
std::string password
Password part found in the Authority.
Definition: uri.h:123
void set_uri(const std::string &uri)
Sets URI using the given URI string.
Definition: uri.h:112
bool allow_path_rootless_
all URIs like mail:foo@example.org which don't have a authority
Definition: uri.h:146
std::string uri_
Copy of the original given URI.
Definition: uri.h:143
uint16_t port
Port found in the Authority.
Definition: uri.h:119
URIQuery query
Query part of the URI.
Definition: uri.h:127
URI()
overload
Definition: uri.h:106
URI(const std::string &uri, bool allow_path_rootless=true)
Default constructor.
Definition: uri.h:83
std::string fragment
Fragment part of the URI.
Definition: uri.h:129
URIPath path
Path part of the URI.
Definition: uri.h:125
std::string host
Host part found in the Authority.
Definition: uri.h:117
bool operator!=(const my_thread_handle &a, const my_thread_handle &b)
Definition: my_thread.h:158
bool operator==(const my_thread_handle &a, const my_thread_handle &b)
Definition: my_thread.h:151
static char * query
Definition: myisam_ftdump.cc:45
static char * password
Definition: mysql_secure_installation.cc:56
const char * host
Definition: mysqladmin.cc:59
static char * path
Definition: mysqldump.cc:137
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1052
std::vector< std::string > URIPath
Definition: uri.h:46
std::ostream & operator<<(std::ostream &strm, const URI &uri)
Definition: uri.cc:1166
std::tuple< std::string, uint16_t, std::string, std::string > URIAuthority
Definition: uri.h:45
std::map< std::string, std::string > URIQuery
Definition: uri.h:47
bool parse(MYSQL_THD thd, const string &query, bool is_prepared, Condition_handler *handler)
Definition: services.cc:81
Definition: gcs_xcom_synode.h:64
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:33
#define ROUTER_LIB_EXPORT
Definition: router_export.h:15