Documentation
¶
Overview ¶
Yandex YML generator: https://yandex.ru/support/partnermarket/yml/about-yml.xml
Index ¶
- Constants
- Variables
- func ExportToFile(cat Catalog, filename string, pretty bool) error
- func ExportToWriter(cat Catalog, w io.Writer, pretty bool) error
- type Age
- type Catalog
- type Categories
- type Category
- type Currencies
- type Currency
- type DeliveryOption
- type DeliveryOptions
- type Offer
- type OfferType
- type Offers
- type Param
- type Shop
Constants ¶
View Source
const Header = `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE yml_catalog SYSTEM "shops.dtd">
`
Variables ¶
View Source
var Countries = map[string]struct{}{}/* 210 elements not displayed */
Allowed countries
Functions ¶
Types ¶
type Catalog ¶
type Catalog struct {
XMLName struct{} `xml:"yml_catalog"`
Shop Shop `xml:"shop"`
Date string `xml:"date,attr"`
}
func (*Catalog) AddCategory ¶
func (*Catalog) AddCurrency ¶
func (*Catalog) AddDeliveryOption ¶
type Categories ¶
type Categories struct {
Category []Category `xml:"category"`
}
type Currencies ¶
type Currencies struct {
Currency []Currency `xml:"currency"`
}
type DeliveryOption ¶
type DeliveryOptions ¶
type DeliveryOptions struct {
Options []DeliveryOption `xml:"option"`
}
type Offer ¶
type Offer struct {
Id string `xml:"id,attr"`
Bid uint `xml:"bid,attr,omitempty"`
CBid uint `xml:"cid,attr,omitempty"`
Type OfferType `xml:"type,attr,omitempty"`
Available bool `xml:"available,attr"`
Url string `xml:"url,omitempty"`
Price float64 `xml:"price"`
OldPrice float64 `xml:"oldprice,omitempty"`
CurrencyId string `xml:"currencyId"`
CategoryId int `xml:"categoryId"`
MarketCategory string `xml:"market_category,omitempty"`
Picture []string `xml:"picture,omitempty"`
Store bool `xml:"store,omitempty"`
Pickup bool `xml:"pickup,omitempty"`
Delivery bool `xml:"delivery,omitempty"`
DeliveryOptions *DeliveryOptions `xml:"delivery-options,omitempty"`
Name string `xml:"name,omitempty"`
TypePrefix string `xml:"typePrefix,omitempty"`
Vendor string `xml:"vendor,omitempty"`
VendorCode string `xml:"vendorCode,omitempty"`
Model string `xml:"model,omitempty"`
Description string `xml:"description,omitempty"`
SalesNotes string `xml:"sales_notes,omitempty"`
ManufacturerWarranty bool `xml:"manufacturer_warranty,omitempty"`
CountryOfOrigin string `xml:"country_of_origin,omitempty"`
Downloadable bool `xml:"downloadable,omitempty"`
Adult bool `xml:"adult,omitempty"`
Age *Age `xml:"age,omitempty"`
Barcode []string `xml:"barcode,omitempty"`
Cpa int `xml:"cpa,omitempty"`
Rec string `xml:"rec,omitempty"`
Expiry string `xml:"expiry,omitempty"`
Weight float64 `xml:"weight,omitempty"`
Dimensions string `xml:"dimensions,omitempty"`
Params []Param `xml:"param,omitempty"`
Count int `xml:"count,omitempty"`
MinQuantity int `xml:"min-quantity,omitempty"`
}
Available = true - delivery in 2 days Available = false - delivery from 3 days to 2 months
func (*Offer) AddBarcode ¶
func (*Offer) AddDeliveryOption ¶
func (*Offer) AddPicture ¶
type Shop ¶
type Shop struct {
Name string `xml:"name"`
Company string `xml:"company"`
Url string `xml:"url"`
Platform string `xml:"platform,omitempty"`
Version string `xml:"version,omitempty"`
Agency string `xml:"agency,omitempty"`
Email string `xml:"email,omitempty"`
Currencies Currencies `xml:"currencies"`
Categories Categories `xml:"categories"`
DeliveryOptions *DeliveryOptions `xml:"delivery-options"`
Cpa int `xml:"cpa,omitempty"`
Offers Offers `xml:"offers"`
}
Click to show internal directories.
Click to hide internal directories.