Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Addr ¶
type Addr struct { // Specified by the caller DefaultScheme string DefaultPort int AllowPrefix bool // Provided will be true if Set is invoked Provided bool // Value is the exact value provided on the flag Value string // URL represents the user input. The Host field is guaranteed // to be set if Provided is true URL *url.URL // Host is the hostname or IP portion of the user input Host string // IPv6Host is true if the hostname appears to be an IPv6 input IPv6Host bool // Port is the port portion of the user input. Will be 0 if no port was found // and no default port could be established. Port int }
Addr is a flag type that attempts to load a host, IP, host:port, or URL value from a string argument. It tracks whether the value was set and allows the caller to provide defaults for the scheme and port.
func (*Addr) HostPort ¶
HostPort returns the host and port joined together. If no port is set :0 will be appended.
Click to show internal directories.
Click to hide internal directories.