MCPcopy
hub / github.com/perkeep/perkeep / isURLOrHostPort

Function isURLOrHostPort

pkg/client/config.go:165–169  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
165func 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.
172func convertToMultiServers(conf jsonconfig.Obj) (jsonconfig.Obj, error) {

Callers 4

parseConfigMethod · 0.85
cleanServerFunction · 0.85
getServerFunction · 0.85
NewFunction · 0.85

Calls 2

HasPrefixMethod · 0.80
ContainsMethod · 0.80

Tested by

no test coverage detected