isURLOrHostPort returns true if s looks like a URL, or a hostname, i.e it starts with a scheme and/or it contains a period or a colon.
(s string)
| 163 | |
| 164 | // isURLOrHostPort returns true if s looks like a URL, or a hostname, i.e it starts with a scheme and/or it contains a period or a colon. |
| 165 | func isURLOrHostPort(s string) bool { |
| 166 | return strings.HasPrefix(s, "http://") || |
| 167 | strings.HasPrefix(s, "https://") || |
| 168 | strings.Contains(s, ".") || strings.Contains(s, ":") |
| 169 | } |
| 170 | |
| 171 | // convertToMultiServers takes an old style single-server client configuration and maps it to new a multi-servers configuration that is returned. |
| 172 | func convertToMultiServers(conf jsonconfig.Obj) (jsonconfig.Obj, error) { |
no test coverage detected