shopping

package
v0.0.0-...-9b137ae Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppID = "<your App ID>"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	URL        *url.URL
	HTTPClient *http.Client
	AppID      string
	Logger     *log.Logger
}

func NewClient

func NewClient(logger *log.Logger) (*Client, error)

func (*Client) GetShoppingCategoryRanking

func (c *Client) GetShoppingCategoryRanking(categoryId string, offset int64) ([]Ranking, error)

func (*Client) GetShoppingItemInfo

func (c *Client) GetShoppingItemInfo(itemCode string) ([]InfoHit, error)

func (*Client) GetShoppingItemListBySearch

func (c *Client) GetShoppingItemListBySearch(keyword string) ([]Hit, error)

type Hit

type Hit struct {
	Index          int64               `xml:"index,attr"`
	Name           string              `xml:"Name,omitempty"`
	Description    string              `xml:"Description,omitempty"`
	Headline       string              `xml:"Headline,omitempty"`
	Url            string              `xml:"Url,omitempty"`
	Availability   string              `xml:"Availability,omitempty"`
	Code           string              `xml:"Code,omitempty"`
	Image          *SrchImage          `xml:"Image,omitempty"`
	ExImage        *SrchExtImage       `xml:"ExImage,omitempty"`
	Review         *SrchReview         `xml:"Review,omitempty"`
	Affiliate      *SrchAffiliate      `xml:"Affiliate,omitempty"`
	Price          *SrchPrice          `xml:"Price,omitempty"`
	PriceLabel     *SrchPriceLabel     `xml:"PriceLabel,omitempty"`
	Point          *SrchPoint          `xml:"Point,omitempty"`
	Shipping       *SrchShipping       `xml:"Shipping,omitempty"`
	Category       *SrchCategory       `xml:"Category,omitempty"`
	CategoryIdPath *SrchCategoryIdPath `xml:"CategoryIdPath,omitempty"`
	Brands         *SrchBrands         `xml:"Brands,omitempty"`
	JanCode        string              `xml:"JanCode,omitempty"`
	Model          string              `xml:"Model,omitempty"`
	IsbnCode       string              `xml:"IsbnCode,omitempty"`
	ReleaseDate    string              `xml:"ReleaseDate,omitempty"`
	Store          *SrchStore          `xml:"Store,omitempty"`
	IsAdult        int64               `xml:"IsAdult,omitempty"`
	Deliveryinfo   *SrchDeliveryinfo   `xml:"Deliveryinfo,omitempty"`
}

type InfoArea

type InfoArea struct {
	Code        string            `xml:"Code,omitempty"`
	Name        string            `xml:"Name,omitempty"`
	Prefectures []InfoPrefectures `xml:"Prefectures,omitempty"`
}

type InfoAreas

type InfoAreas struct {
	Area *InfoArea `xml:"Area,omitempty"`
}

type InfoCode

type InfoCode struct {
	Code string `xml:"Code"`
}

type InfoDelivery

type InfoDelivery struct {
	Areas      []InfoAreas `xml:"Areas,omitempty"`
	Deadline   string      `xml:"Deadline,omitempty"`
	Conditions string      `xml:"Conditions,omitempty"`
}

type InfoHit

type InfoHit struct {
	Code                  string               `xml:"Code,omitempty"`
	Name                  string               `xml:"Name,omitempty"`
	Url                   string               `xml:"Url,omitempty"`
	Condition             string               `xml:"Condition,omitempty"`
	Headline              string               `xml:"Headline,omitempty"`
	Caption               string               `xml:"Caption,omitempty"`
	Abstract              string               `xml:"Abstract,omitempty"`
	Additional1           string               `xml:"Additional1,omitempty"`
	Additional2           string               `xml:"Additional2,omitempty"`
	Additional3           string               `xml:"Additional3,omitempty"`
	SpAdditional          string               `xml:"SpAdditional,omitempty"`
	ProductCategory       *InfoProductCategory `xml:"ProductCategory,omitempty"`
	IsBargain             bool                 `xml:"IsBargain,omitempty"`
	OriginalPriceEvidence string               `xml:"OriginalPriceEvidence,omitempty"`
	Description           string               `xml:"Description,omitempty"`
	ReleaseDate           string               `xml:"ReleaseDate,omitempty"`
	JanCode               string               `xml:"JanCode,omitempty"`
	Image                 *InfoImage           `xml:"Image,omitempty"`
	RelatedImages         []InfoImage          `xml:"RelatedImages,omitempty"`
	Review                *InfoReview          `xml:"Review,omitempty"`
	Price                 *InfoPrice           `xml:"Price,omitempty"`
	PriceLabel            *InfoPriceLabel      `xml:"PriceLabel,omitempty"`
	ShipWeight            float64              `xml:"ShipWeight,omitempty"`
	SaleLimit             int64                `xml:"SaleLimit,omitempty"`
	Inventories           *InfoInventories     `xml:"Inventories,omitempty"`
	Point                 *InfoPoint           `xml:"Point,omitempty"`
	Payment               *InfoPayment         `xml:"Payment,omitempty"`
	Shipping              *InfoShipping        `xml:"Shipping,omitempty"`
	Store                 *InfoStore           `xml:"Store,omitempty"`
	Order                 string               `xml:"Order,omitempty"`
	IsAdult               int64                `xml:"IsAdult,omitempty"`
	IsCarBodySeller       int64                `xml:"IsCarBodySeller,omitempty"`
	Availability          string               `xml:"Availability,omitempty"`
}

type InfoImage

type InfoImage struct {
	Id     string `xml:"Id,omitempty"`
	Small  string `xml:"Small,omitempty"`
	Medium string `xml:"Medium,omitempty"`
}

type InfoInventories

type InfoInventories struct {
	Inventory []InfoInventory `xml:"Inventory"`
}

type InfoInventory

type InfoInventory struct {
	SubCode        string `xml:"SubCode"`
	Order          string `xml:"Order"`
	Availability   string `xml:"Availability"`
	Quantity       int64  `xml:"Quantity"`
	AllowOverdraft int64  `xml:"AllowOverdraft"`
}

type InfoItemCode

type InfoItemCode struct {
	Codes []InfoCode `xml:"Codes"`
}

type InfoMethod

type InfoMethod struct {
	Code int64  `xml:"Code,omitempty"`
	Name string `xml:"Name,omitempty"`
}

type InfoNode

type InfoNode struct {
	Id   string `xml:"Id,omitempty"`
	Name string `xml:"Name,omitempty"`
}

type InfoPayment

type InfoPayment struct {
	Method []InfoMethod `xml:"Method,omitempty"`
}

type InfoPoint

type InfoPoint struct {
	Amount          int64 `xml:"Amount,omitempty"`
	Times           int64 `xml:"Times,omitempty"`
	PremiumAmount   int64 `xml:"PremiumAmount,omitempty"`
	PremiumTimes    int64 `xml:"PremiumTimes,omitempty"`
	PremiumCpAmount int64 `xml:"PremiumCpAmount,omitempty"`
	PremiumCpTimes  int64 `xml:"PremiumCpTimes,omitempty"`
	AppCpAmount     int64 `xml:"AppCpAmount,omitempty"`
	AppCpTimes      int64 `xml:"AppCpTimes,omitempty"`
	PreAppCpAmount  int64 `xml:"PreAppCpAmount,omitempty"`
	PreAppCpTimes   int64 `xml:"PreAppCpTimes,omitempty"`
}

type InfoPrefectures

type InfoPrefectures struct {
	Prefecture []InfoNode `xml:"Prefecture,omitempty"`
}

type InfoPrice

type InfoPrice struct {
	Currency string `xml:"currency,attr"`
	Value    int64  `xml:",chardata"`
}

type InfoPriceLabel

type InfoPriceLabel struct {
	TaxIncluded  bool   `xml:"taxIncluded,attr"`
	FixedPrice   int64  `xml:FixedPrice,omitempty`
	DefaultPrice int64  `xml:DefaultPrice,omitempty`
	SalePrice    int64  `xml:SalePrice,omitempty`
	MemberPrice  int64  `xml:MemberPrice,omitempty`
	PeriodStart  string `xml:PeriodStart,omitempty`
	PeriodEnd    string `xml:PeriodEnd,omitempty`
}

type InfoProductCategory

type InfoProductCategory struct {
	ID int64 `xml:"ID,omitempty"`
}

type InfoRatings

type InfoRatings struct {
	Rate       float64 `xml:"Rate,omitempty"`
	Count      int64   `xml:"Count,omitempty"`
	Total      int64   `xml:"Total,omitempty"`
	DetailRate float64 `xml:"DetailRate,omitempty"`
}

type InfoResult

type InfoResult struct {
	ItemCode *InfoItemCode `xml:"ItemCode,omitempty"`
	Hits     []*InfoHit    `xml:"Hit,omitempty"`
}

type InfoResultSet

type InfoResultSet struct {
	Attr_xmlns                 string      `xml:"xmlns,attr"`
	Attr_xsi                   string      `xml:"xmlns xsi,attr"`
	Attr_xsi_schemaLocation    string      `xml:"http://www.w3.org/2001/XMLSchema-instance schemaLocation,attr"`
	Attr_firstResultPosition   string      `xml:"firstResultPosition,attr"`
	Attr_totalResultsAvailable string      `xml:"totalResultsAvailable,attr"`
	Attr_totalResultsReturned  string      `xml:"totalResultsReturned,attr"`
	Result                     *InfoResult `xml:"Result,omitempty"`
}

type InfoReview

type InfoReview struct {
	Rate  string `xml:"Rate,omitempty"`
	Count string `xml:"Count,omitempty"`
	Url   string `xml:"Url,omitempty"`
}

type InfoShipping

type InfoShipping struct {
	Code int64  `xml:"Code,omitempty"`
	Name string `xml:"Name,omitempty"`
}

type InfoStore

type InfoStore struct {
	Id               string          `xml:"Id,omitempty"`
	Name             string          `xml:"Name,omitempty"`
	Url              string          `xml:"Url,omitempty"`
	SellerType       string          `xml:"SellerType,omitempty"`
	InventoryMessage string          `xml:"InventoryMessage,omitempty"`
	ToolType         string          `xml:"ToolType,omitempty"`
	Ratings          *InfoRatings    `xml:"Ratings,omitempty"`
	Image            *InfoStoreImage `xml:"Image,omitempty"`
	Point            *InfoStorePoint `xml:"Point,omitempty"`
	SameDayDelivery  *InfoDelivery   `xml:"SameDayDelivery,omitempty"`
	ExpressDelivery  *InfoDelivery   `xml:"ExpressDelivery,omitempty"`
}

type InfoStoreImage

type InfoStoreImage struct {
	Id     string `xml:"Id,omitempty"`
	Medium string `xml:"Medium,omitempty"`
}

type InfoStorePoint

type InfoStorePoint struct {
	Grant  bool `xml:"Grant,omitempty"`
	Accept bool `xml:"Accept,omitempty"`
}

type RankImage

type RankImage struct {
	Id     string `xml:"Id,omitempty"`
	Small  string `xml:"Small,omitempty"`
	Medium string `xml:"Medium,omitempty"`
}

type RankReview

type RankReview struct {
	Rate  string `xml:"Rate,omitempty"`
	Count string `xml:"Count,omitempty"`
	Url   string `xml:"Url,omitempty"`
}

type RankStore

type RankStore struct {
	Id   string `xml:"Id,omitempty"`
	Name string `xml:"Name,omitempty"`
	Url  string `xml:"Url,omitempty"`
}

type Ranking

type Ranking struct {
	Rank   int64       `xml:"rank,attr"`
	Vector string      `xml:"vector,attr"`
	Type   string      `xml:"type,attr"`
	Name   string      `xml:"Name,omitempty"`
	Code   string      `xml:"Code,omitempty"`
	Url    string      `xml:"Url,omitempty"`
	Image  *RankImage  `xml:"Image,omitempty"`
	Review *RankReview `xml:"Review,omitempty"`
	Store  *RankStore  `xml:"Store,omitempty"`
}

type RankingInfo

type RankingInfo struct {
	LastModified string `xml:"LastModified,omitempty"`
	StartDate    string `xml:"StartDate,omitempty"`
	EndDate      string `xml:"EndDate,omitempty"`
	CategoryId   int64  `xml:"CategoryId,omitempty"`
	Gender       string `xml:"Gender,omitempty"`
	Generation   string `xml:"Generation,omitempty"`
	Period       string `xml:"Period,omitempty"`
}

type RankingResult

type RankingResult struct {
	RankingData []*Ranking   `xml:"RankingData,omitempty"`
	RankingInfo *RankingInfo `xml:"RankingInfo,omitempty"`
}

type RankingResultSet

type RankingResultSet struct {
	Attr_firstResultPosition   string         `xml:"firstResultPosition,attr"`
	Attr_xsi_schemaLocation    string         `xml:"http://www.w3.org/2001/XMLSchema-instance schemaLocation,attr"`
	Attr_totalResultsAvailable string         `xml:"totalResultsAvailable,attr"`
	Attr_totalResultsReturned  string         `xml:"totalResultsReturned,attr"`
	Attr_xmlns                 string         `xml:"xmlns,attr"`
	Attr_xsi                   string         `xml:"xmlns xsi,attr"`
	RankingResult              *RankingResult `xml:"Result,omitempty"`
}

type Request

type Request struct {
	Query string `xml:"Query"`
}

type SearchResult

type SearchResult struct {
	Hits    []*Hit   `xml:"Hit,omitempty"`
	Request *Request `xml:"Request,omitempty"`
}

type SearchResultSet

type SearchResultSet struct {
	Attr_firstResultPosition   string        `xml:"firstResultPosition,attr"`
	Attr_xsi_schemaLocation    string        `xml:"http://www.w3.org/2001/XMLSchema-instance schemaLocation,attr"`
	Attr_totalResultsAvailable string        `xml:"totalResultsAvailable,attr"`
	Attr_totalResultsReturned  string        `xml:"totalResultsReturned,attr"`
	Attr_xmlns                 string        `xml:"xmlns,attr"`
	Attr_xsi                   string        `xml:"xmlns xsi,attr"`
	SearchResult               *SearchResult `xml:"Result,omitempty"`
}

type SrchAffiliate

type SrchAffiliate struct {
	Rate float64 `xml:"Rate,omitempty"`
}

type SrchBrand

type SrchBrand struct {
	Id string `xml:"Id,omitempty"`
}

type SrchBrands

type SrchBrands struct {
	Name string     `xml:"Name,omitempty"`
	Path *SrchBrand `xml:"Path,omitempty"`
}

type SrchCategory

type SrchCategory struct {
	Current *SrchNode `xml:"Current,omitempty"`
}

type SrchCategoryIdPath

type SrchCategoryIdPath struct {
	Category []SrchNode `xml:"Category,omitempty"`
}

type SrchDeliveryinfo

type SrchDeliveryinfo struct {
	Area     string `xml:"Area,omitempty"`
	Deadline string `xml:"Deadline,omitempty"`
	Day      int64  `xml:"Day,omitempty"`
}

type SrchExtImage

type SrchExtImage struct {
	Url    string `xml:"Url,omitempty"`
	Width  string `xml:"Width,omitempty"`
	Height string `xml:"Height,omitempty"`
}

type SrchImage

type SrchImage struct {
	Id     string `xml:"Id,omitempty"`
	Small  string `xml:"Small,omitempty"`
	Medium string `xml:"Medium,omitempty"`
}

type SrchMethod

type SrchMethod struct {
	Code int64  `xml:"Code,omitempty"`
	Name string `xml:"Name,omitempty"`
}

type SrchNode

type SrchNode struct {
	Id   string `xml:"Id,omitempty"`
	Name string `xml:"Name,omitempty"`
}

type SrchPayment

type SrchPayment struct {
	Method []SrchMethod `xml:"Method,omitempty"`
}

type SrchPoint

type SrchPoint struct {
	Amount        int64 `xml:"Amount,omitempty"`
	Times         int64 `xml:"Times,omitempty"`
	PremiumAmount int64 `xml:"PremiumAmount,omitempty"`
	PremiumTimes  int64 `xml:"PremiumTimes,omitempty"`
}

type SrchPrice

type SrchPrice struct {
	Currency string `xml:"currency,attr"`
	Value    int64  `xml:",chardata"`
}

type SrchPriceLabel

type SrchPriceLabel struct {
	Currency            bool   `xml:"currency,attr"`
	FixedPrice          int64  `xml:FixedPrice,omitempty`
	DefaultPrice        int64  `xml:DefaultPrice,omitempty`
	SalePrice           int64  `xml:SalePrice,omitempty`
	PremiumPriceStatus  int64  `xml:PremiumPriceStatus,omitempty`
	PremiumPrice        int64  `xml:PremiumPrice,omitempty`
	PremiumDiscountType string `xml:PremiumDiscountType,omitempty`
	PremiumDiscountRate int64  `xml:PremiumDiscountRate,omitempty`
	PeriodStart         string `xml:PeriodStart,omitempty`
	PeriodEnd           string `xml:PeriodEnd,omitempty`
}

type SrchRatings

type SrchRatings struct {
	Rate       float64 `xml:"Rate,omitempty"`
	Count      int64   `xml:"Count,omitempty"`
	Total      int64   `xml:"Total,omitempty"`
	DetailRate float64 `xml:"DetailRate,omitempty"`
}

type SrchReview

type SrchReview struct {
	Rate  float64 `xml:"Rate,omitempty"`
	Count int64   `xml:"Count,omitempty"`
	Url   string  `xml:"Url,omitempty"`
}

type SrchShipping

type SrchShipping struct {
	Code int64  `xml:"Code,omitempty"`
	Name string `xml:"Name,omitempty"`
}

type SrchStore

type SrchStore struct {
	Id           string       `xml:"Id,omitempty"`
	Name         string       `xml:"Name,omitempty"`
	Url          string       `xml:"Url,omitempty"`
	IsBestStore  string       `xml:"IsBestStore,omitempty"`
	Payment      *SrchPayment `xml:"Payment,omitempty"`
	Ratings      *SrchRatings `xml:"Ratings,omitempty"`
	Image        *StoreImage  `xml:"Image,omitempty"`
	IsPMallStore bool         `xml:"IsPMallStore,omitempty"`
}

type StoreImage

type StoreImage struct {
	Id     string `xml:"Id,omitempty"`
	Medium string `xml:"Medium,omitempty"`
}

Jump to

Keyboard shortcuts

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