Documentation ¶
Overview ¶
Package books contains book-related logic, and provides functions to search for books in a datastore. books also serves to expose an API to be used by servers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Book ¶
type Book struct { ID int // A different number for each book. Title string // Book's title. Authors string // Book's authors. AverageRating float32 // Average rating (out of 5.) ISBN string // 10 digit ISBN. ISBN13 string // 13 digit ISBN. LanguageCode string // 3-character language code. Pages int // Number of book's pages. RatingsCount int // Number of ratings (out of 5.) ReviewsCount int // Number of text reviews. }
Book represents a searchable book object.
type SearchBy ¶
type SearchBy struct { TitleHas string // A sub-string that must exist in the title. Authors []string // Must have at least one of these authors. Ignored if nil or empty. LanguageCode []string // Must be in at least one of these languages. Ignored if nil or empty. ISBN string // 10 digit ISBN. ISBN13 string // 13 digit ISBN. RatingCeil float32 // Rating must be less than or equal. RatingFloor float32 // Rating must be higher than. PagesCeil int // Number of pages must be less than or equal. PagesFloor int // Number of pages must be higher than. RatingsCountCeil int // Number of ratings must be less than or equal. RatingsCountFloor int // Number of ratings must be higher than. ReviewsCountCeil int // Number of reviews must be less than or equal. ReviewsCountFloor int // Number of reviews must be higher than. }
SearchBy is a set of parameters to use when searching for books in a datastore. Not all fields have to be specifed, a search can be performed using only a sub-set of the fields. To ignore a string field when searching, leave it empty, to ignore a number set it to < 0. For floor/ceil values floor is exclusive, ceil is inclusive.
Click to show internal directories.
Click to hide internal directories.