Documentation ¶
Overview ¶
Pakage imgdl provides functions to download one or multiple image asynchronousely.
Index ¶
Constants ¶
View Source
const (
// This constant specifies timeout (in second) downloading one image.
TIMEOUT_SEC = 30
)
Variables ¶
This section is empty.
Functions ¶
func DownloadImagesZip ¶
DownloadImagesZip asychronously donwloads multiple images at once and write to a zip file. This function will spawn a go routine for each url so caller must ensure not too many runs at a time since it can lead to network error.
func DownloadImgage ¶
DownloadImgage downloads a single image and save to path. Unexist parent folder will be created and image extension is guess from MIME type.
func DownloadImgages ¶
DownloadImages asychronously donwloads multiple images at once and write to a folder.
func GetImageData ¶
func GetImageData(url string) (string, *io.ReadCloser, error)
GetImageData downloads a single image, returns its extension and a ReadCloser which holds image data.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.