models

package
v0.0.0-...-1379509 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2019 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Shops map[string]ShopSite

Shops is the list of all running shop sites in the instance.

Functions

This section is empty.

Types

type NewForm

type NewForm struct {
	SiteName        string                `form:"site_name" binding:"Required"`
	SiteDescription string                `form:"site_desc" binding:"Required"`
	Email           string                `form:"email" binding:"Required;Email"`
	LogoURL         string                `form:"logo_url" binding:"Required;Url"`
	BannerURL       string                `form:"banner_url" binding:"Required;Url"`
	Spreadsheet     *multipart.FileHeader `form:"spreadsheet" binding:"Required"`
}

NewForm represents the data binding structure of a form to create a new website.

type ShopItem

type ShopItem struct {
	ID          string
	Name        string
	Description string
	Price       float64
	ImageURL    string
}

ShopItem represents an item in the shop.

func GetShopItemsFromCSV

func GetShopItemsFromCSV(csvText string) ([]ShopItem, error)

GetShopItemsFromCSV marshalls the shop items listed in a CSV file into an array of ShopItem.

type ShopSite

type ShopSite struct {
	SiteTitle       string
	SiteDescription string
	Email           string
	LogoURL         string
	BannerURL       string
	Items           []ShopItem
}

ShopSite represents an shop site instance.

Jump to

Keyboard shortcuts

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