Versions in this module Expand all Collapse all v1 v1.0.1 Dec 31, 2024 Changes in this version + var RULES_SINA = Rule + var RULE_DOUYIN = Rule + type Rule []string + func (r Rule) Check(rawURL string) bool v1.0.0 Nov 7, 2024 Changes in this version + var ErrConnectionFailed = errors.New("connection failed") + var ErrContentChecksumMismatch = errors.New("content checksum mismatch") + var ErrContentTooLarge = errors.New("content size exceeds limit") + var ErrDataDecodingFailed = errors.New("failed to decode data") + var ErrDirectoryNotWritable = errors.New("target directory not writable") + var ErrDiskSpaceInsufficient = errors.New("insufficient disk space") + var ErrDownloadFailed = errors.New("failed to download image") + var ErrFileAlreadyExists = errors.New("file already exists") + var ErrFileCreationFailed = errors.New("file creation failed") + var ErrFilePermissionDenied = errors.New("file permission denied") + var ErrFileWriteFailed = errors.New("file write failed") + var ErrHostUnreachable = errors.New("host unreachable") + var ErrInvalidTargetPath = errors.New("invalid target path") + var ErrInvalidURL = errors.New("invalid URL") + var ErrMaxRetryExceeded = errors.New("maximum retry attempts exceeded") + var ErrReadFailed = errors.New("failed to read data from source") + var ErrTimeout = errors.New("connection timeout") + var ErrUnsupportedFileType = errors.New("unsupported file type") + func GenerateUUID() (string, error) + func Max[T Element](x, y T) T + func Min[T Element](x, y T) T + func NewGoogleCapture() + type BaiduCapture struct + func (bc *BaiduCapture) RangeImages(keyword string, callBack func([]string) bool, opts ...Option) error + func (bc *BaiduCapture) SearchImages(keyword string, maxNumber int, opts ...Option) ([]string, error) + type BingCapture struct + func (bc *BingCapture) RangeImages(keyword string, callBack func([]string) bool, opts ...Option) error + func (bc *BingCapture) SearchImages(keyword string, maxNumber int, opts ...Option) ([]string, error) + type BingFormat struct + Murl string + Turl string + type Capture interface + RangeImages func(keyword string, callBack func(urls []string) bool, opts ...Option) error + SearchImages func(keyword string, maxNumber int, opts ...Option) ([]string, error) + func NewBaiduCapture(routineSize int) Capture + func NewBingCapture(routineSize int) Capture + type Downloader interface + BatchDownload func(urls []string, dir string, useMd5Naming bool) ([]string, error) + Download func(url, filename string, writer io.Writer) (string, error) + type Element interface + type GoogleCapture struct + func (GoogleCapture) BatchDownload(urls []string, dir string, useMd5Naming bool) ([]string, error) + func (GoogleCapture) Download(url, filename string, writer io.Writer) error + func (GoogleCapture) SearchImages(keywords string, maxNumber int, opts ...Option) ([]string, error) + type ImageReader struct + func NewImageReader(reader io.Reader, needMd5 bool) (*ImageReader, error) + func (ir ImageReader) Md5() string + func (ir ImageReader) Read(p []byte) (n int, err error) + func (ir ImageReader) Type() string + type ImageSize uint + const ImageSize_ENORMOUS + const ImageSize_LARGE + const ImageSize_MEDIUM + const ImageSize_SMALL + type Option func(*query) + func WithCopyright() Option + func WithGif() Option + func WithHd() Option + func WithImageSize(size ImageSize) Option + func WithLatest() Option