yahoo_shopping

package
v0.0.0-...-7c4a8a6 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CategoryFurnitureID = 2506

Variables

View Source
var Done = errors.New("DONE")

Functions

This section is empty.

Types

type Category

type Category struct {
	ID       int         `xml:"Id"`
	ParentID *int        `xml:"ParentId"`
	URL      string      `xml:"Url"`
	Title    string      `xml:"Title>Short"`
	IsAdult  int         `xml:"IsAdult"`
	Children []*Category `xml:"Children>Child"`
}

type CategoryItemCursor

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

func (*CategoryItemCursor) CurMinPrice

func (g *CategoryItemCursor) CurMinPrice() int

func (*CategoryItemCursor) CurPage

func (g *CategoryItemCursor) CurPage() int

func (*CategoryItemCursor) Next

type Client

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

func NewClient

func NewClient(appIDs []string) *Client

func (*Client) ApplicationIDNum

func (c *Client) ApplicationIDNum() int

func (*Client) GetCategoryWithAllChildren

func (c *Client) GetCategoryWithAllChildren(ctx context.Context, categoryID int) (*Category, error)

GetCategoryWithAllChildren gets genre with all lower hierarchy genre

func (*Client) NewCategoryItemCursor

func (c *Client) NewCategoryItemCursor(categoryID int, minPrice int, maxPrice int) *CategoryItemCursor

type GetCategoryResponse

type GetCategoryResponse struct {
	Result struct {
		Categories struct {
			Current  *Category   `xml:"Current"`
			Children []*Category `xml:"Children>Child"`
		} `xml:"Categories"`
	} `xml:"Result"`
}

type Item

type Item struct {
	Index       int    `json:"index"`
	Name        string `json:"name"`
	Description string `json:"description"`
	HeadLine    string `json:"headLine"`
	Url         string `json:"url"`
	InStock     bool   `json:"inStock"`
	Code        string `json:"code"`
	Condition   string `json:"condition"`
	ImageId     string `json:"imageId"`
	Image       struct {
		Small  string `json:"small"`
		Medium string `json:"medium"`
	} `json:"image"`
	Review struct {
		Rate  float64 `json:"rate"`
		Count int     `json:"count"`
		Url   string  `json:"url"`
	} `json:"review"`
	AffiliateRate       float64 `json:"affiliateRate"`
	Price               int     `json:"price"`
	PremiumPrice        int     `json:"premiumPrice"`
	PremiumPriceStatus  bool    `json:"premiumPriceStatus"`
	PremiumDiscountType *string `json:"premiumDiscountType,omitempty"`
	PremiumDiscountRate *int    `json:"premiumDiscountRate,omitempty"`
	PriceLabel          struct {
		Taxable         bool `json:"taxable"`
		DefaultPrice    int  `json:"defaultPrice"`
		DiscountedPrice *int `json:"discountedPrice,omitempty"`
		FixedPrice      *int `json:"fixedPrice,omitempty"`
		PremiumPrice    *int `json:"premiumPrice,omitempty"`
		PeriodStart     *int `json:"periodStart,omitempty"`
		PeriodEnd       *int `json:"periodEnd,omitempty"`
	} `json:"priceLabel"`
	Point struct {
		Amount        int `json:"amount"`
		Times         int `json:"times"`
		PremiumAmount int `json:"premiumAmount"`
		PremiumTimes  int `json:"premiumTimes"`
	} `json:"point"`
	Shipping struct {
		Code int    `json:"code"`
		Name string `json:"name"`
	} `json:"shipping"`
	GenreCategory struct {
		Id    int    `json:"id"`
		Name  string `json:"name"`
		Depth int    `json:"depth"`
	} `json:"genreCategory"`
	ParentGenreCategories []struct {
		Depth int    `json:"depth"`
		Id    int    `json:"id"`
		Name  string `json:"name"`
	} `json:"parentGenreCategories"`
	Brand struct {
		Id   int    `json:"id"`
		Name string `json:"name"`
	} `json:"brand"`
	ParentBrands []struct {
		Id   int    `json:"id"`
		Name string `json:"name"`
	} `json:"parentBrands"`
	JanCode     string `json:"janCode"`
	ReleaseDate *int   `json:"releaseDate,omitempty"`
	Seller      struct {
		SellerId      string `json:"sellerId"`
		Name          string `json:"name"`
		Url           string `json:"url"`
		IsBestSeller  bool   `json:"isBestSeller"`
		IsPMallSeller bool   `json:"isPMallSeller"`
		Review        struct {
			Rate  float64 `json:"rate"`
			Count int     `json:"count"`
		} `json:"review"`
		ImageId string `json:"imageId"`
	} `json:"seller"`
	Delivery struct {
		Area     string `json:"area"`
		DeadLine *int   `json:"deadLine,omitempty"`
		Day      *int   `json:"day,omitempty"`
	} `json:"delivery"`
	Payment string `json:"payment"`
}

type SearchItemParams

type SearchItemParams struct {
	Query      string
	CategoryID int
	PriceFrom  int
	PriceTo    int
	Page       int
	SortType   SearchItemSortType
}

type SearchItemResponse

type SearchItemResponse struct {
	TotalResultsAvailable int     `json:"totalResultsAvailable"`
	TotalResultsReturned  int     `json:"totalResultsReturned"`
	FirstResultPosition   int     `json:"firstResultPosition"`
	Hits                  []*Item `json:"hits"`
}

func (*SearchItemResponse) NoMoreHits

func (s *SearchItemResponse) NoMoreHits() bool

type SearchItemSortType

type SearchItemSortType string
const (
	SearchItemSortTypeScoreDesc       SearchItemSortType = "-score"
	SearchItemSortTypePriceAsc        SearchItemSortType = "+price"
	SearchItemSortTypePriceDesc       SearchItemSortType = "-price"
	SearchItemSortTypeReviewCountDesc SearchItemSortType = "-review_count"
)

Jump to

Keyboard shortcuts

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