mock shops more spelled out

This commit is contained in:
2026-01-22 15:14:44 -07:00
parent b182685ec3
commit 38aa3796b9
11 changed files with 1241 additions and 556 deletions
+36 -12
View File
@@ -10,22 +10,46 @@ type (
)
const (
Etsy Platform = "Etsy"
Tiktok Platform = "Tiktok"
Wix Platform = "Wix"
Etsy Platform = "Etsy"
Tiktok Platform = "Tiktok"
Wix Platform = "Wix"
Ebay Platform = "ebay"
WalmartMarketplace Platform = "walmart_marketplace"
Amazon Platform = "amazon"
BigCartel Platform = "big_cartel"
Ecwid Platform = "ecwid"
Zoho Platform = "zoho"
SquareOnline Platform = "square_online"
Squarespace Platform = "squarespace"
WooCommerce Platform = "woo_commerce"
Shopify Platform = "shopify"
)
var (
allValues = []Platform{
Etsy,
Tiktok,
Wix,
Ebay,
WalmartMarketplace,
Amazon,
BigCartel,
Ecwid,
Zoho,
SquareOnline,
Squarespace,
WooCommerce,
Shopify,
}
)
func NewPlatform(s string) (Platform, error) {
switch strings.ToLower(s) {
case strings.ToLower(string(Etsy)):
return Etsy, nil
case strings.ToLower(string(Tiktok)):
return Tiktok, nil
case strings.ToLower(string(Wix)):
return Wix, nil
default:
return "", fmt.Errorf("unrecognized constant: %q", s)
for _, v := range allValues {
if strings.ToLower(s) == strings.ToLower(string(v)) {
return v, nil
}
}
return "", fmt.Errorf("unrecognized constant: %q", s)
}
// sql.Scanner implementation