Documentation
¶
Index ¶
- type HttpUrl
- func (u *HttpUrl) Clean()
- func (u *HttpUrl) Host(forcePort bool) string
- func (u *HttpUrl) HostPathConcat() string
- func (u *HttpUrl) HostPathConcatStrict() string
- func (u *HttpUrl) Hostname() string
- func (u *HttpUrl) IsEmpty() bool
- func (u *HttpUrl) MarshalText() (text []byte, err error)
- func (u *HttpUrl) Path() string
- func (u *HttpUrl) String() string
- func (u *HttpUrl) UnmarshalText(text []byte) error
- func (u *HttpUrl) Validate() error
- type SshUrl
- func (u *SshUrl) Clean()
- func (u *SshUrl) HostPathConcat() string
- func (u *SshUrl) HostPathConcatStrict() string
- func (u *SshUrl) Hostname() string
- func (u *SshUrl) IsEmpty() bool
- func (u *SshUrl) MarshalText() (text []byte, err error)
- func (u *SshUrl) Path() string
- func (u *SshUrl) String() string
- func (u *SshUrl) UnmarshalText(text []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpUrl ¶
type HttpUrl struct {
/*
HostnameS contains the domain name or ip address.
*/
HostnameS string
/*
Port contains the host's port.
*/
Port int
/*
PathS contains any further information encoded in the url path.
*/
PathS string
/*
Secure is a flag that defines whether this HttpUrl should be treated as an encrypted connection.
*/
Secure bool
}
HttpUrl represents a regular http url.
func HttpUrlFromString ¶
HttpUrlFromString creates a HttpUrl from a string, returning an error if validation fails.
func (*HttpUrl) HostPathConcat ¶
HostPathConcat returns the url without the protocol.
func (*HttpUrl) HostPathConcatStrict ¶
HostPathConcatStrict returns the url forcing Port to be concatenated as well.
func (*HttpUrl) IsEmpty ¶
IsEmpty returns whether HostnameS is empty or not. It calls Clean() beforehand.
func (*HttpUrl) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*HttpUrl) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type SshUrl ¶
type SshUrl struct {
/*
HostnameS contains the domain name or ip address.
*/
HostnameS string
/*
User contains the username that want to connect to the host.
*/
User string
/*
PathS contains anything else specifying the connection.
*/
PathS string
}
SshUrl represents a regular ssh url.
func SshUrlFromString ¶
SshUrlFromString creates a SshUrl from a string, returning an error if validation fails.
func (*SshUrl) HostPathConcat ¶
HostPathConcat returns the url without the protocol.
func (*SshUrl) HostPathConcatStrict ¶
HostPathConcatStrict returns the url forcing Port to be concatenated as well.
func (*SshUrl) IsEmpty ¶
IsEmpty returns whether HostnameS or User is empty or not. It calls Clean() beforehand.
func (*SshUrl) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*SshUrl) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.