nytimes

package
v0.0.0-...-3b05dd8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BestSellerRes

type BestSellerRes struct {
	Status       string   `json:"status"`
	Copyright    string   `json:"copyright"`
	NumResults   int64    `json:"num_results"`
	LastModified string   `json:"last_modified"`
	Results      []Result `json:"results"`
}

type BookCoverURL

type BookCoverURL struct {
	URL string `json:"url"`
}

type BookDetail

type BookDetail struct {
	Title           string `json:"title"`
	Description     string `json:"description"`
	Contributor     string `json:"contributor"`
	Author          string `json:"author"`
	ContributorNote string `json:"contributor_note"`
	Price           string `json:"price"`
	AgeGroup        string `json:"age_group"`
	Publisher       string `json:"publisher"`
	PrimaryIsbn13   string `json:"primary_isbn13"`
	PrimaryIsbn10   string `json:"primary_isbn10"`
}

type GoogleBookRes

type GoogleBookRes struct {
	Items []struct {
		VolumeInfo struct {
			ImageLinks struct {
				Thumbnail string `json:"thumbnail"`
			} `json:"imageLinks"`
		} `json:"volumeInfo"`
	} `json:"items"`
}

type HTTPClient

type HTTPClient interface {
	Get(url string) (resp *http.Response, err error)
	Do(req *http.Request) (resp *http.Response, err error)
}

type Isbn

type Isbn struct {
	Isbn10 string `json:"isbn10"`
	Isbn13 string `json:"isbn13"`
}

type RestClient

type RestClient struct {
	// contains filtered or unexported fields
}

func NewRestClient

func NewRestClient(bestSellerAPIKey, googleBookAPIKey string, httpClient HTTPClient) *RestClient

func (*RestClient) GetBookCoverURL

func (r *RestClient) GetBookCoverURL(isbn string) BookCoverURL

func (*RestClient) GetSimpleBestSellers

func (r *RestClient) GetSimpleBestSellers() []SimpleBook

type Result

type Result struct {
	ListName         string       `json:"list_name"`
	DisplayName      string       `json:"display_name"`
	BestsellersDate  string       `json:"bestsellers_date"`
	PublishedDate    string       `json:"published_date"`
	Rank             int64        `json:"rank"`
	RankLastWeek     int64        `json:"rank_last_week"`
	WeeksOnList      int64        `json:"weeks_on_list"`
	Asterisk         int64        `json:"asterisk"`
	Dagger           int64        `json:"dagger"`
	AmazonProductURL string       `json:"amazon_product_url"`
	Isbns            []Isbn       `json:"isbns"`
	BookDetails      []BookDetail `json:"book_details"`
	Reviews          []Review     `json:"reviews"`
}

type Review

type Review struct {
	BookReviewLink     string `json:"book_review_link"`
	FirstChapterLink   string `json:"first_chapter_link"`
	SundayReviewLink   string `json:"sunday_review_link"`
	ArticleChapterLink string `json:"article_chapter_link"`
}

type SimpleBook

type SimpleBook struct {
	LastWeekRank     int64  `json:"lastWeekRank"`
	WeeksOnList      int64  `json:"weeksOnList"`
	Rank             int64  `json:"rank"`
	AmazonProductURL string `json:"amazonProductUrl"`
	Publisher        string `json:"publisher"`
	Title            string `json:"title"`
	Author           string `json:"author"`
	Description      string `json:"description"`
	Isbn             string `json:"isbn"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL