utils

package
v0.0.0-...-e3c39ba Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateXML

func GenerateXML(goods []entity.Goods, filePath string) error

func GetPolicyFiles

func GetPolicyFiles(policyDir string) ([]string, error)

func LoadPolicy

func LoadPolicy(filePath string) (usecase.Policy, error)

Types

type Feature

type Feature struct {
	XMLName xml.Name `xml:"feature"`
	Name    string   `xml:"name,attr"`
	Value   string   `xml:",chardata"`
}

type XMLGoods

type XMLGoods struct {
	XMLName  xml.Name  `xml:"goods"`
	Brand    string    `xml:"brand"`
	Model    string    `xml:"model"`
	Price    string    `xml:"price"`
	Stock    int       `xml:"stock"`
	Category string    `xml:"category"`
	Tags     []string  `xml:"tags>tag"`
	Features []Feature `xml:"features>feature"`
}

Jump to

Keyboard shortcuts

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