Documentation ¶
Index ¶
- func GetHostFromURL(url string) string
- func GetMultiRegionHost(overrideHost string, region string) (string, error)
- func GetSchemaDefinition(definitions map[string]spec.Schema, ref string) (*spec.Schema, error)
- func IsMultiRegionHost(overrideHost string) (bool, *regexp.Regexp)
- func StringExtensionExists(extensions spec.Extensions, key string) (string, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHostFromURL ¶ added in v0.1.5
GetHostFromURL returns the fqdn of a given string (localhost including port number is also handled). Example domains that would match: - http://domain.com/ - domain.com/parameter - domain.com?anything - example.domain.com - example.domain-hyphen.com - www.domain.com - localhost - localhost:8080 Example domains that would not match: - http://domain.com:8080 (this use case is not support at the moment, it is assumed that actual domains will use standard ports)
func GetMultiRegionHost ¶ added in v0.9.0
GetMultiRegionHost builds a final fqdn based on the given host that is parametrised (${1}%s$4) and injects the given region in it
func GetSchemaDefinition ¶ added in v0.3.1
GetSchemaDefinition queries the definitions and tries to find the schema definition for the given ref. If the schema definition the ref value is pointing at does not exist and error is returned. Otherwise, the corresponding schema definition is returned.
func IsMultiRegionHost ¶ added in v0.9.0
IsMultiRegionHost checks whether the override host is parametrised following the format expected
func StringExtensionExists ¶ added in v0.3.0
func StringExtensionExists(extensions spec.Extensions, key string) (string, bool)
StringExtensionExists tries to find a match using the built-in extensions GetString method and if there is no match it will try to find a match without converting the key lower case (as done behind the scenes by GetString method). Context: The Extensions look up methods tweaks the given key making it lower case and then trying to match against the keys in the map. However this may not always work as the Extensions might have been added without going through the Add method which lower cases the key, though in situations where the struct was un-marshaled directly instead this translation would not have happened and therefore the look up queiry will not find matches
Types ¶
This section is empty.