Documentation ¶
Index ¶
Constants ¶
const HostUrl = "https://www.goodreads.com/"
Variables ¶
var EbookFormats = []string{"ebook", "Kindle Edition"} // EbooksFormats contains all formats that represent a form a ebook on goodreads.
Functions ¶
This section is empty.
Types ¶
type Book ¶
type Book struct { Title string // Title of book. Author string // Author of book. Isbn string // Isbn of this book. Note: remove as only edition isbn is relevant? WorkUrl string // This is the url to the work on goodreads. EditionsUrl string // This is the url to all editions of the work. Editions []Edition // This contains all editions that belong to the work. }
Book represents a book on a goodread list. It can be a work or an edition.
type Edition ¶
Edition represents an edition of a work.
func GetEditions ¶
func GetEditions(hostUrl, editionsUrl string, formats []string, languages []string) ([]Edition, error)
GetEditions takes an url to editions on goodreads, the required formats and languages. It returns all editions that belong to that work, adhere to the parameters and have a ISBN. Example expected url: "/work/editions/94024291"
type Library ¶
type Library struct { ListUrl string Shelf string Formats []string Languages []string Books []Book // contains filtered or unexported fields }
func NewLibrary ¶
NewLibrary takes all parameters for the url (host, list and shelf), the required book formats and languages. It returns an empty library with all parameters.
func (*Library) Get ¶
Get connects to the host with all parameters that are specified in the type. It retrieves all books, get the editions not yet present, updates the library and returns an error.
func (*Library) GetAll ¶
GetAll connects to the host with all parameters that are specified in the type. It retrieves all books, retrieves the corresponding editions and updates the library. It returns an error.
func (*Library) UpdateConfig ¶
UpdateConfig takes the library parameters and updates them.