xitem

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: 1 Imported by: 0

Documentation

Index

Constants

View Source
const LteUnlimited = 999999

LteUnlimited is magic number used to represent unlimited number

Variables

This section is empty.

Functions

func ItemUniqueID

func ItemUniqueID(platform Platform, itemID string) string

Types

type IntRange

type IntRange struct {
	Gte int `json:"gte"`
	Lte int `json:"lte"`
}

func NewIntRange

func NewIntRange(gte int, lte *int) *IntRange

type Item

type Item struct {
	// must set an ID generated from ItemUniqueID
	ID            string    `json:"id"`
	Name          string    `json:"name"`
	Description   string    `json:"description"`
	Status        Status    `json:"status"`
	URL           string    `json:"url"`
	AffiliateURL  string    `json:"affiliate_url"`
	Price         int       `json:"price"`
	ImageURLs     []string  `json:"image_urls"`
	AverageRating float64   `json:"average_rating"`
	ReviewCount   int       `json:"review_count"`
	CategoryID    string    `json:"category_id"`
	CategoryIDs   []string  `json:"category_ids"`
	CategoryNames []string  `json:"category_names"`
	BrandName     string    `json:"brand_name"`
	Colors        []string  `json:"colors"`
	WidthRange    *IntRange `json:"widthRange,omitempty"`
	DepthRange    *IntRange `json:"depthRange,omitempty"`
	HeightRange   *IntRange `json:"heightRange,omitempty"`
	JANCode       string    `json:"jan_code,omitempty"`
	Platform      Platform  `json:"platform"`
}

func (*Item) IsIndexable

func (i *Item) IsIndexable() bool

type Platform

type Platform string
const (
	PlatformAmazon        Platform = "amazon"
	PlatformRakuten       Platform = "rakuten"
	PlatformYahooShopping Platform = "yahoo_shopping"
	PlatformPayPayMall    Platform = "paypay_mall"
)

type Status

type Status int
const (
	StatusActive Status = iota + 1
	StatusInactive
)

Jump to

Keyboard shortcuts

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