Documentation
¶
Overview ¶
Package domain contains some nifty tools for manipulating domains and domain names.
Index ¶
- func AddProtocol(url string) string
- func HasProtocol(url string) bool
- func IsLocalhost(hostname string) bool
- func IsValidHostname(hostname string) bool
- func NameOnly(host string) string
- func NotLocalhost(hostname string) bool
- func NotValidHostname(hostname string) bool
- func Protocol(hostname string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddProtocol ¶
AddProtocol adds a protocol to a URL if it does not already exist. Local domains use http:// and all other domains use https://
func HasProtocol ¶ added in v0.0.2
HasProtocol returns TRUE if the provided URL includes a protocol string
func IsLocalhost ¶
IsLocalhost returns TRUE if the hostname is a local domain
func IsValidHostname ¶ added in v0.2.0
func NotLocalhost ¶ added in v0.1.0
NotLocalhost returns TRUE if the hostname is NOT a local domain
func NotValidHostname ¶ added in v0.2.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.