Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Download2Buffer ¶ added in v1.1.1
Download2Buffer : download a url object to bytes buffer uri -- url string for instance
uri -> https://example.com/1.jpg name -> 1.jpg data -> binary data err -> error return when failed
func Download2Path ¶ added in v1.1.1
Download2Path : download a url object then save it to file uri -- url string dir -- current file dir for instance
uri -> https://example.com/1.jpg dir -> /home/pics would download file then save as /home/pics/1.jpg
Types ¶
type HTTPObj ¶ added in v1.1.1
func DownloadObj ¶ added in v1.1.1
DownloadObj : download a url object, return http.Response and object name. Warning: Call "defer HTTPObj.Resp.Body.Close()" at the beginning. uri -- url string for instance
uri -> https://example.com/1.jpg HTTPObj.Resp -> http.Response HTTPObj.Name -> 1.jpg err -> error return when failed
Click to show internal directories.
Click to hide internal directories.