Documentation ¶
Index ¶
Constants ¶
View Source
const ( ImageTypeAll = "all" ImageTypePhoto = "photo" ImageTypeIllustration = "illustration" ImageTypeVector = "vector" )
Constants for ImageType attribute
View Source
const ( ResponseGroupImageDetails = "image_details" ResponseGroupHighResolution = "high_resolution" )
Constants for ResponseGroup attribute
View Source
const ( OrientationAll = "all" OrientationHorizontal = "horizontal" OrientationVertical = "vertical" )
Constants for Orientation attribute
View Source
const ( CategoryFashion = "fashion" CategoryNature = "nature" CategoryBackgrounds = "backgrounds" CategoryScience = "science" CategoryEducation = "education" CategoryPeople = "people" CategoryFeelings = "feelings" CategoryReligion = "religion" CategoryHealth = "health" CategoryPlaces = "places" CategoryAnimals = "animals" CategoryIndustry = "industry" CategoryFood = "food" CategoryComputer = "computer" CategorySports = "sports" CategoryTransportation = "transportation" CategoryTravel = "travel" CategoryBuildings = "buildings" CategoryBusiness = "business" CategoryMusic = "music" )
Constants for Category attribute
View Source
const ( OrderPopular = "popular" OrderLatest = "latest" )
Constants for Order attibute
View Source
const APIURL = "https://pixabay.com/api/"
API constant
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseResponse ¶
type HighResolutionResponse ¶
type HighResolutionResponse struct { BaseResponse Hits []*HighResolutionHitResponse `json:"hits"` }
func QueryHighResolution ¶
func QueryHighResolution(req *Request) (*HighResolutionResponse, error)
type ImageDetailsHitResponse ¶
type ImageDetailsHitResponse struct { ID int `json:"id"` Favorites int `json:"favorites"` Likes int `json:"likes"` Comments int `json:"comments"` Views int `json:"views"` Tags string `json:"tags"` Downloads int `json:"downloads"` PageURL string `json:"pageURL"` // contains filtered or unexported fields }
type ImageDetailsResponse ¶
type ImageDetailsResponse struct { BaseResponse Hits []*ImageDetailsHitResponse `json:"hits"` }
func QueryImageDetails ¶
func QueryImageDetails(req *Request) (*ImageDetailsResponse, error)
type Request ¶
type Request struct { Key string `url:"key"` ResponseGroup string `url:"response_group"` ID string `url:"id"` Query string `url:"q"` Lang string `url:"lang"` ImageType string `url:"image_type"` Orientation string `url:"orientation"` Category string `url:"category"` MinWidth int `url:"min_width"` MinHeight int `url:"min_height"` EditorsChoice bool `url:"editors_choice"` SafeSearch bool `url:"safesearch"` Order string `url:"order"` Page int `url:"page"` PerPage int `url:"per_page"` Callback string `url:"callback"` Pretty bool `url:"pretty"` }
Request payload
Click to show internal directories.
Click to hide internal directories.