Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParsePort ¶
parseTarget takes the user input target string and default port, returns formatted host and port info. If target doesn't specify a port, set the port to be the defaultPort. If target is in IPv6 format and host-name is enclosed in square brackets, brackets are stripped when setting the host. examples: target: "www.google.com" defaultPort: "443" returns host: "www.google.com", port: "443" target: "ipv4-host:80" defaultPort: "443" returns host: "ipv4-host", port: "80" target: "[ipv6-host]" defaultPort: "443" returns host: "ipv6-host", port: "443" target: ":80" defaultPort: "443" returns host: "localhost", port: "80"
Types ¶
type Target ¶
func ParseScheme ¶
ParseTarget splits target into a resolver.Target struct containing scheme, authority and endpoint.
If target is not a valid scheme://authority/endpoint, it returns {Endpoint: target}.