parser

package
v0.0.0-...-c017963 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collection

func Collection(category string, pageno int) (bool, error)

Collection finds all the link from the font page.

func FindAttr

func FindAttr(node html.Node, key string) string

FindAttr finds attr from node.

func FullCollection

func FullCollection(name string) error

Types

type Media

type Media struct {
	Alt       string `json:"alt"`
	Src       string `json:"src"`
	LocalPath string `json:"local_path"`
}

type Product

type Product struct {
	ID          uint       `json:"id"`
	Title       string     `json:"title"`
	Vendor      string     `json:"vendor"`
	Handle      string     `json:"handle"`
	Type        string     `json:"type"`
	Price       int        `json:"price"`
	PriceMax    int        `json:"price_max"`
	PriceMin    int        `json:"price_min"`
	Description string     `json:"description"`
	Media       []Media    `json:"media"`
	Variants    []Variants `json:"variants"`
}

func FetchProduct

func FetchProduct(url string) (*Product, error)

func (*Product) LoadMedia

func (p *Product) LoadMedia() error

func (Product) Save

func (p Product) Save() error

type Variants

type Variants struct {
	SKU    string `json:"sku"`
	Weight int    `json:"weight"`
}

Jump to

Keyboard shortcuts

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