Documentation
¶
Overview ¶
Package gol implements an easy interface to make calls to the OpenLibrary API
gol uses the WorkAPI, the EditionAPI, and the CoverAPI
Index ¶
- func Cover(c HasCovers, size string) string
- func GetAuthorCoverURL(key string, value string, size string) string
- func GetBookCoverURL(key string, value string, size string) string
- func GetCoverURL(coverType string, key string, value string, size string) string
- func HasError(data Container) error
- type Author
- type Book
- func (b Book) Authors() ([]Author, error)
- func (b Book) Cover(size string) string
- func (b Book) FirstCoverKey() string
- func (b Book) GoodReads() (string, error)
- func (b *Book) Isbn10() (string, error)
- func (b *Book) KeyAuthors() ([]string, error)
- func (b *Book) KeyCovers() ([]string, error)
- func (b *Book) Load()
- func (b *Book) NumberOfPages() (int, error)
- func (b *Book) Publishers() ([]string, error)
- func (b *Book) Subjects() ([]string, error)
- func (b *Book) Title() (string, error)
- func (b *Book) WorkKeys() ([]string, error)
- type Container
- func MakeAuthorRequest(id string) (Container, error)
- func MakeBookRequest(id string) (Container, error)
- func MakeDetailedSubjectRequest(subject string) (Container, error)
- func MakeISBNRequest(isbn string) (Container, error)
- func MakeRequest(api string, id string, params ...string) (Container, error)
- func MakeSubjectRequest(subject string) (Container, error)
- func MakeWorkRequest(work string) (Container, error)
- func Query(url string) (Container, error)
- func Request(url string) (Container, error)
- func Search(s string) (Container, error)
- type HasCovers
- type IKeyAuthors
- type QueryURL
- type SearchURL
- type Subject
- type Work
- func (w Work) Authors() (a []Author, err error)
- func (w Work) Cover(size string) string
- func (w *Work) Desc() (string, error)
- func (w *Work) Editions() ([]Book, error)
- func (w Work) FirstCoverKey() string
- func (w *Work) Key() (string, error)
- func (w *Work) KeyAuthors() ([]string, error)
- func (w *Work) KeyCovers() ([]string, error)
- func (w *Work) Load()
- func (w *Work) Subjects() ([]string, error)
- func (w *Work) Title() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAuthorCoverURL ¶
GetAuthorCoverURL returns the url of author cover (picture) from an identifier. The size can be specified (S, M, or L)
func GetBookCoverURL ¶
GetBookCoverURL returns the url to book cover from an identifier. The size can be specified (S, M, or L)
func GetCoverURL ¶
GetCoverURL returns the url of the requested cover GetCoverURL accepts the cover type i.e b(book), a(author), the key of the book i.e ISBN, OCLC, LCCN, OLID and ID, the value of the key, and the size of the cover (S, M, or L)
Types ¶
type Author ¶
func Authors ¶
func Authors(i IKeyAuthors) (as []Author, err error)
func (Author) FirstCoverKey ¶
type Book ¶
type Book struct {
Container
// contains filtered or unexported fields
}
func GetEdition ¶
GetEdition returns a book from its open library id
func GetEditionISBN ¶
GetEditionISBN returns a book from its isbnid
func (Book) FirstCoverKey ¶
FirstCoverKey returns the first cover if it exists
func (*Book) KeyAuthors ¶
KeyAuthors returns array of all authors keys
func (*Book) NumberOfPages ¶
func (*Book) Publishers ¶
returns the publishers of the book
type Container ¶
func MakeAuthorRequest ¶
func MakeBookRequest ¶
func MakeISBNRequest ¶
func MakeSubjectRequest ¶
func MakeWorkRequest ¶
type IKeyAuthors ¶
type QueryURL ¶
type QueryURL struct {
// contains filtered or unexported fields
}
func QueryUrl ¶
func QueryUrl() QueryURL
QueryURL returns QueryURL type that holds OpenLibrary Query URL
type SearchURL ¶
type SearchURL struct {
// contains filtered or unexported fields
}
SearchURL holds information about the Search URL
type Subject ¶
type Subject struct {
Container
// contains filtered or unexported fields
}
func GetSubject ¶
GetSubject returns the chosen subject's information
func GetSubjectDetails ¶
GetSubject returns the chosen subject's information with more details
type Work ¶
func GetWork ¶
GetWork returns the work from the workID After making the request, the fields are loaded with Load
func (Work) Cover ¶
Cover returns the cover url to the "first" edition. It takes size as an argument; it can be (S, M, or L)
func (Work) FirstCoverKey ¶
FirstCoverKey return the first cover key (if it exists)