Documentation ¶
Overview ¶
Package net provides simple networking helper functions
Index ¶
- Constants
- func DirURL(uri string) (result string)
- func DisableProxy(proxy *url.URL)
- func DownloadFile(url, dst string, perms ...uint32) (result string, err error)
- func EnableProxy(proxy *url.URL)
- func JoinURL(elems ...string) (result string)
- func NormalizeURL(uri string) (result string)
- func Ping(proto, addr string, timeout ...int) (err error)
- func SplitURL(uri string) (pieces []string)
Constants ¶
View Source
const ( // TCP is a protocol string constant TCP = "tcp" // UDP is a protocol string constant UDP = "udp" )
Variables ¶
This section is empty.
Functions ¶
func DisableProxy ¶
DisableProxy unsets the http_proxy env var and sets the http.DefaultTransport to not use a proxy
func DownloadFile ¶
DownloadFile from the given URL to the given destination returning the full path to the resulting downloaded file
func EnableProxy ¶
EnableProxy sets the http_proxy env var and sets the http.DefaultTransport to use a proxy
func JoinURL ¶
JoinURL will join and append the given paths to the first element which is assumed will be the schema of the URL. Will also normalize the schema.
func NormalizeURL ¶
NormalizeURL parses the URL and corrects case and other oddities. 1. properly formats the schema
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.