heureka

package
v0.0.0-...-c6f47ca Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Delivery

type Delivery struct {
	ID       string `xml:"DELIVERY_ID" json:"id"`
	Price    Price  `xml:"DELIVERY_PRICE" json:"price"`
	PriceCOD Price  `xml:"DELIVERY_PRICE_COD" json:"priceCod"`
}

Delivery - describes delivery option

type Gift

type Gift struct {
	Name string `xml:",chardata" json:"name"`
	ID   ID     `xml:"ID,attr" json:"id"`
}

Gift - describes item which will be added to the order as free item

type ID

type ID string

ID - contains validated ID

func (*ID) UnmarshalText

func (id *ID) UnmarshalText(text []byte) error

UnmarshalText - unmarshal and vaidate ID

type Item

type Item struct {
	XMLName           xml.Name    `xml:"SHOPITEM"`
	ID                ID          `xml:"ITEM_ID" json:"id"`
	ProductName       string      `xml:"PRODUCTNAME" json:"name"`
	Product           string      `xml:"PRODUCT" json:"product"`
	Description       string      `xml:"DESCRIPTION" json:"description"`
	URL               URL         `xml:"URL" json:"url"`
	ImgURL            URL         `xml:"IMGURL" json:"imageUrl"`
	ImgURLAlternative []URL       `xml:"IMGURL_ALTERNATIVE" json:"imageUrlsAlternate"`
	VideoURL          URL         `xml:"VIDEO_URL" json:"videoUrl"`
	PriceVAT          Price       `xml:"PRICE_VAT" json:"priceWithVat"`
	VAT               Percent     `xml:"VAT,omitempty" json:"vat"`
	Type              string      `xml:"ITEM_TYPE,omitempty" json:"type"`
	HeurekaCPC        Price       `xml:"HEUREKA_CPC,omitempty" json:"cpc"`
	Manufacturer      string      `xml:"MANUFACTURER" json:"manufacterer"`
	CategoryText      string      `xml:"CATEGORYTEXT" json:"category"`
	EAN               string      `xml:"EAN" json:"ean"`
	ISBN              string      `xml:"ISBN" json:"isbn"`
	Parameters        []Parameter `xml:"PARAM" json:"parameters"`
	DeliveryDate      string      `xml:"DELIVERY_DATE" json:"deliveryDay"`
	Deliveries        []Delivery  `xml:"DELIVERY" json:"deliveries"`
	GroupID           string      `xml:"ITEMGROUP_ID" json:"groupId"`
	Accessories       []string    `xml:"ACCESSORY" json:"accessories"`
	Dues              Price       `xml:"DUES" json:"dues"`
	Gifts             []Gift      `xml:"GIFT" json:"gifts"`
}

Item - describes single shop item

type Parameter

type Parameter struct {
	Name  string `xml:"PARAM_NAME" json:"name"`
	Value string `xml:"VAL" json:"value"`
}

Parameter - describes product parameter

type Percent

type Percent string

Percent contains percentage value

func (*Percent) UnmarshalText

func (p *Percent) UnmarshalText(text []byte) error

UnmarshalText - validates percentage value

type Price

type Price struct {
	decimal.Decimal
}

Price - represents price in app

func (*Price) UnmarshalText

func (p *Price) UnmarshalText(text []byte) error

UnmarshalText unmarshall price with all rules or returns error

type Shop

type Shop struct {
	XMLName  xml.Name `xml:"SHOP"`
	ShopItem []Item   `xml:"SHOPITEM"`
}

Shop contains list of available shop items

type URL

type URL struct {
	url.URL
}

URL validates url

func (*URL) UnmarshalText

func (u *URL) UnmarshalText(text []byte) error

UnmarshalText - unmarshall url with validation

Jump to

Keyboard shortcuts

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