Documentation
¶
Overview ¶
Package openlibrary provides an interface to the Open Library API. It is VERY barebones and was created to serve the needs of a handful of developers during a Hackathon. They are interested in improving it once they aren't under a tight time crunch.
Index ¶
Constants ¶
View Source
const ( // BaseURL is the hostname of the Open Library API BaseURL = "http://openlibrary.org" // SearchURL is the search url of the Open Library API SearchURL = BaseURL + "/search" // WorksURL is the url for works in the Open Library API WorksURL = BaseURL + "/works" // CoverURL is the hostname for the Open Library covers API CoverURL = "http://covers.openlibrary.org" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Doc ¶
type Doc struct { AuthorAlternativeName []string `json:"author_alternative_name"` AuthorKey []string `json:"author_key"` AuthorName []string `json:"author_name"` CoverEditionKey string `json:"cover_edition_key"` CoverID int `json:"cover_i"` EbookCount int `json:"ebook_count_i"` EditionCount int `json:"edition_count"` EditionKey []string `json:"edition_key"` FirstPublishYear int `json:"first_publish_year"` FullText bool `json:"has_fulltext"` IA []string `json:"ia"` IABoxID []string `json:"ia_box_id"` IACollectionS string `json:"ia_collection_s"` IALoadedID []string `json:"ia_loaded_id"` GoodreadsID []string `json:"id_goodreads"` GoogleID []string `json:"id_google"` LibraryThingID []string `json:"id_librarything"` OverdriveID []string `json:"id_overdrive"` ISBN []string `json:"isbn"` Key string `json:"key"` Language []string `json:"language"` LastModifiedID int `json:"last_modified_i"` LCCN []string `json:"lccn"` LendingEditionS string `json:"lending_edition_s"` LendingIDS string `json:"lending_identifier_s"` OCLC []string `json:"oclc"` PrintDisabledS string `json:"printdisabled_s"` PublicScanB bool `json:"public_scan_b"` PublishDate []string `json:"publish_date"` PublishPlace []string `json:"publish_place"` PublishYear []int `json:"publish_year"` Publisher []string `json:"publisher"` Seed []string `json:"seed"` Subject []string `json:"subject"` Text []string `json:"text"` Title string `json:"title"` TitleSuggest string `json:"title_suggest"` Type string `json:"type"` }
A Doc represents an item in the Open Library
func TitleSearch ¶
TitleSearch performs a title search and returns the results.
type Search ¶
type Search struct { Start int `json:"start"` Found int `json:"numFound"` Docs []Doc `json:"docs"` }
A Search represents the response body from a request.
type Work ¶
type Work struct { Description struct { Type string `json:"type"` Value string `json:"value"` } `json:"description"` Title string `json:"title"` Created struct { Type string `json:"type"` Value string `json:"value"` } `json:"created"` Covers []int `json:"covers"` LastModified struct { Type string `json:"type"` Value string `json:"value"` } `json:"last_modified"` LatestRevision int `json:"latest_revision"` Key string `json:"key"` Authors []struct { Type struct { Key string `json:"key"` } `json:"type"` Author struct { Key string `json:"key"` } `json:"author"` } `json:"authors"` Type struct { Key string `json:"key"` } `json:"type"` Subjects []string `json:"subjects"` Revision int `json:"revision"` }
A Work respresents a work response body from a request
func GetWorkByID ¶
GetWorkByID returns a work given an a Work ID
Click to show internal directories.
Click to hide internal directories.