Documentation ¶
Index ¶
Constants ¶
View Source
const ( IstockSearchAPI = "https://www.istockphoto.com/search/2/image" ColorSimilarityAssetid = "colorsimilarityassetid" MaxPages = 20 MinPages = 1 DefaultBackend = "istock_dataset" MaxPower = 32 MinPower = 1 Content = "content" Color = "color" )
View Source
const ( Photo = "photography" Illustrations = "illustration" Vectors = "illustration&assetfiletype=eps" Square = "square" Vertical = "vertical" Horizontal = "horizontal" PanoramicVertical = "panoramicvertical" PanoramicHorizontal = "panoramichorizontal" NoPeople = "none" OnePerson = "one" TwoPeople = "two" GroupOfPeople = "group" UNDEFINED = "undefined" )
Variables ¶
View Source
var ( MediaType = &filterMediaType{ Photo: Photo, Illustrations: Illustrations, Vectors: Vectors, Undefined: UNDEFINED, optional: []string{Photo, Illustrations, Vectors, UNDEFINED}, } Orientations = &filterOrientations{ Square: Square, Vertical: Vertical, Horizontal: Horizontal, PanoramicVertical: PanoramicVertical, PanoramicHorizontal: PanoramicHorizontal, Undefined: UNDEFINED, optional: []string{Square, Vertical, Horizontal, PanoramicVertical, PanoramicHorizontal, UNDEFINED}, } NumberOfPeople = &filterNumberOfPeople{ NoPeople: NoPeople, OnePerson: OnePerson, TwoPeople: TwoPeople, GroupOfPeople: GroupOfPeople, Undefined: UNDEFINED, optional: []string{NoPeople, OnePerson, TwoPeople, GroupOfPeople, UNDEFINED}, } )
Functions ¶
func RefactorInvalidQueryType ¶
RefactorInvalidQueryType Automatically correct deviated parameters back to default values during parameter checking
Types ¶
type Downloader ¶
type Downloader struct { // Pages is the size of the data that needs to be collected // For demonstration purposes, don't let Pages exceed MinPages and MaxPages // During initialization, invalid Pages values will be automatically corrected Pages int // MediaType defaults to Photo, options can be viewed in typing Mediatype string // NumberOfPeople defaults to NoPeople, options can be viewed in typing NumberOfPeople string // Orientations defaults to Square, options can be viewed in typing Orientations string // Backend is the root directory of the image cache // the default value is DefaultBackend Backend string // Flag is the name of the parent directory where images are stored, // and its default value is the keyword you specify, namely Phrase Flag string Similar string ProxyURL string // contains filtered or unexported fields }
func NewDownloader ¶
func NewDownloader(phrase string) *Downloader
NewDownloader Initialize the downloader object
func (*Downloader) CloseFilter ¶
func (d *Downloader) CloseFilter()
func (*Downloader) MoreLikeThis ¶
func (d *Downloader) MoreLikeThis(istockID int) *Downloader
MoreLikeThis Similarity search
Click to show internal directories.
Click to hide internal directories.