Documentation ¶
Overview ¶
Package goodreads provides a REST client for the public goodreads.com API.
Index ¶
- type APIClient
- type Client
- func (c *Client) AuthorBooks(authorID string, page int) (*responses.Author, error)
- func (c *Client) AuthorShow(authorID string) (*responses.Author, error)
- func (c *Client) BookReviewCounts(isbns []string) ([]responses.ReviewCounts, error)
- func (c *Client) ReviewList(userID, shelf, sort, search, order string, page, perPage int) ([]responses.Review, error)
- func (c *Client) SearchBooks(query string, page int, field SearchField) ([]work.Work, error)
- func (c *Client) ShelvesList(userID string) ([]responses.UserShelf, error)
- func (c *Client) UserShow(id string) (*responses.User, error)
- type SearchField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient interface {
Get(string, func([]byte, interface{}) error, url.Values, interface{}) error
}
APIClient defines a client that can perform an action against a Goodreads API function, with parameters, and decode the response to a local struct.
type Client ¶
type Client struct { APIKey string // contains filtered or unexported fields }
Client wraps the public Goodreads API.
func (*Client) AuthorBooks ¶
AuthorBooks returns a list of books by a particular author. https://www.goodreads.com/api/index#author.books
func (*Client) AuthorShow ¶
AuthorShow returns the full details of an author. https://www.goodreads.com/api/index#author.show
func (*Client) BookReviewCounts ¶
func (c *Client) BookReviewCounts(isbns []string) ([]responses.ReviewCounts, error)
BookReviewCounts returns the review statistics for a given list of ISBNs. https://www.goodreads.com/api/index#book.review_counts
func (*Client) ReviewList ¶
func (c *Client) ReviewList(userID, shelf, sort, search, order string, page, perPage int) ([]responses.Review, error)
ReviewList returns the books on a members shelf. https://www.goodreads.com/api/index#reviews.list
func (*Client) SearchBooks ¶
SearchBooks returns a list of books based on a query string by title, author, or ISBN. https://www.goodreads.com/api/index#search.books
func (*Client) ShelvesList ¶
ShelvesList returns the list of shelves belonging to a user. https://www.goodreads.com/api/index#shelves.list
type SearchField ¶
type SearchField string
SearchField defines the field types within which you can search. Defaults to AllFields.
const ( // AuthorField lets you specify that you want to search author names only. AuthorField SearchField = "author" // TitleField lets you specify that you want to only search through book titles. TitleField SearchField = "title" // AllFields (the default) lets you search over everything. AllFields SearchField = "all" )