Documentation ¶
Overview ¶
Package clevelandart provides types and functions for working with the Cleveland Museum of Art's Open Access API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artwork ¶
type Artwork struct { Id int `json:"id"` AccessionNumber string `json:"accession_number"` Tombstone string `json:"tombstone,omitempty"` CurrentLocation string `json:"current_location,omitempty"` Title string `json:"title,omitempty"` TitleInOriginalLanguage string `json:"title_in_original_language,omitempty"` Series string `json:"series,omitempty"` SeriesInOriginalLanguage string `json:"series_in_original_language,omitempty"` CreationDate string `json:"creation_date,omitempty"` CreationDateEarliest int `json:"creation_date_earliest,omitempty"` CreationDateLatest int `json:"creation_date_latest,omitempty"` ArtistsTags []string `json:"artists_tags,omitempty"` Creators []struct { Description string `json:"description,omitempty"` Role string `json:"role,omitempty"` Biography string `json:"biography,omitempty"` } `json:"creators,omitempty"` Culture []string `json:"culture,omitempty"` Technique string `json:"technique,omitempty"` Department string `json:"department,omitempty"` Collection string `json:"collection,omitempty"` Type string `json:"type,omitempty"` Measurements string `json:"measurements,omitempty"` Description string `json:"description,omitempty"` Url string `json:"url,omitempty"` Images struct { Web struct { Url string `json:"url,omitempty"` Filename string `json:"filename,omitempty"` Filesize string `json:"filesize,omitempty"` Width string `json:"width,omitempty"` Height string `json:"height,omitempty"` } `json:"web,omitempty"` Print struct { Url string `json:"url,omitempty"` Filename string `json:"filename,omitempty"` Filesize string `json:"filesize,omitempty"` Width string `json:"width,omitempty"` Height string `json:"height,omitempty"` } `json:"print,omitempty"` Full struct { Url string `json:"url,omitempty"` Filename string `json:"filename,omitempty"` Filesize string `json:"filesize,omitempty"` Width string `json:"width,omitempty"` Height string `json:"height,omitempty"` } `json:"full,omitempty"` } `json:"images,omitempty"` JSON string }
An Artwork represents a single object in the Cleveland Museum of Art's Open Access API.
func GetArtwork ¶ added in v0.0.2
GetArtwork retrieves an object from the Cleveland Museum of Art's Open Access API
func GetRandomArtwork ¶
GetRandomArtwork returns a random artwork from the Cleveland Museum of Art's Open Access API
type ArtworkInputParams ¶ added in v0.0.3
type ArtworkInputParams struct { Indent int `url:"indent"` Query string `url:"q"` Limit int `url:"limit"` Skip int `url:"skip"` HasImage int `url:"has_image"` }
An ArtworkInputParams is a struct representing the paramesters available to query artworks
type SearchResults ¶ added in v0.0.3
type SearchResults struct { Info struct { Total int `json:"total"` Parameters struct { Skip int `json:"skip"` Limit int `json:"limit"` Indent int `json:"indent"` Query string `json:"q"` Select string `json:"select"` Search string `json:"search"` } `json:"parameters"` } `json:"info"` Artworks []Artwork `json:"data"` }
A SearchResults represents the results of a search with query statistics
func SearchArtworks ¶
func SearchArtworks(params ArtworkInputParams) (*SearchResults, error)
SearchArtworks sends a search query to the API and retrieve an array of Artwork objects along with query statistics