gocommerce

package module
v0.0.0-...-f8bbda7 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 18 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Golang Commerce Interface

Go config parsers for several PHP eCommerce platforms:

  • Magento 1
  • Magento 2
  • Wordpress/Woocommerce
  • Prestashop 1.6 / 1.7+
  • Shopware 5 / 6
  • OpenCart 4
  • JTL-Shop
  • Sylius

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllPlatforms = []PlatformInterface{
	&Magento2{
		basePlatform{
			"Magento 2",
			"app/etc/env.php",
			"app/etc/env.php",
		},
		"n98-magerun2",
	},
	&Magento1{
		basePlatform{
			"Magento 1",
			"app/etc/local.xml",
			"app/etc/local.xml",
		},
		"n98-magerun",
	},
	&Shopware6{
		basePlatform{
			"Shopware 6",
			".env",
			"vendor/shopware/core/Framework/ShopwareException.php",
		},
	},
	&Shopware5{
		basePlatform{
			"Shopware 5",
			"config.php",
			"engine/Shopware/Application.php",
		},
	},
	&Prestashop7{
		basePlatform{
			"Prestashop 1.7+",
			"app/config/parameters.php",
			"app/config/parameters.php",
		},
	},
	&Prestashop6{
		basePlatform{
			"Prestashop 1.6",
			"config/settings.inc.php",
			"config/settings.inc.php",
		},
	},
	&WooCommerce{
		basePlatform{
			"WP/WooCommerce",
			"wp-config.php",
			"wp-config.php",
		},
	},
	&OpenCart4{
		basePlatform{
			"OpenCart 4",
			"config.php",
			"system/engine/config.php",
		},
	},
	&JTLShop{
		basePlatform{
			"JTL-Shop",
			"includes/config.JTL-Shop.ini.php",
			"includes/config.JTL-Shop.ini.php",
		},
	},
	&Sylius{
		basePlatform{
			"Sylius",
			".env",
			"vendor/sylius/sylius/composer.json",
		},
	},
}

Functions

func ConnectDB

func ConnectDB(ctx context.Context, cfg DBConfig) (*sql.DB, error)

NB copy StoreConfig, as we may modify it

Types

type DBConfig

type DBConfig struct {
	Host   string
	User   string
	Pass   string
	Name   string
	Prefix string
	Port   int
}

func (*DBConfig) DSN

func (c *DBConfig) DSN() string

func (*DBConfig) SafePrefix

func (c *DBConfig) SafePrefix() (string, error)

type JTLShop

type JTLShop struct {
	// contains filtered or unexported fields
}

func (*JTLShop) BaseURLs

func (j *JTLShop) BaseURLs(_ context.Context, docroot string) ([]string, error)

func (*JTLShop) ConfigPath

func (b *JTLShop) ConfigPath() string

func (*JTLShop) Name

func (b *JTLShop) Name() string

func (*JTLShop) ParseConfig

func (j *JTLShop) ParseConfig(cfgPath string) (*StoreConfig, error)

func (*JTLShop) UniquePath

func (b *JTLShop) UniquePath() string

func (*JTLShop) Version

func (j *JTLShop) Version(docroot string) (string, error)

type Magento1

type Magento1 struct {
	Magerun string
	// contains filtered or unexported fields
}

func (*Magento1) BaseURLs

func (m1 *Magento1) BaseURLs(ctx context.Context, docroot string) ([]string, error)

func (*Magento1) ConfigPath

func (b *Magento1) ConfigPath() string

func (*Magento1) Name

func (b *Magento1) Name() string

func (*Magento1) ParseConfig

func (m1 *Magento1) ParseConfig(cfgPath string) (*StoreConfig, error)

func (*Magento1) UniquePath

func (b *Magento1) UniquePath() string

func (*Magento1) Version

func (m1 *Magento1) Version(docroot string) (string, error)

type Magento2

type Magento2 struct {
	Magerun string
	// contains filtered or unexported fields
}

func (*Magento2) BaseURLs

func (m2 *Magento2) BaseURLs(ctx context.Context, docroot string) ([]string, error)

func (*Magento2) ConfigPath

func (b *Magento2) ConfigPath() string

func (*Magento2) Name

func (b *Magento2) Name() string

func (*Magento2) ParseConfig

func (m2 *Magento2) ParseConfig(cfgPath string) (*StoreConfig, error)

func (*Magento2) UniquePath

func (b *Magento2) UniquePath() string

func (*Magento2) Version

func (m2 *Magento2) Version(docroot string) (string, error)

type OpenCart4

type OpenCart4 struct {
	// contains filtered or unexported fields
}

func (*OpenCart4) BaseURLs

func (oc4 *OpenCart4) BaseURLs(_ context.Context, docroot string) ([]string, error)

func (*OpenCart4) ConfigPath

func (b *OpenCart4) ConfigPath() string

func (*OpenCart4) Name

func (b *OpenCart4) Name() string

func (*OpenCart4) ParseConfig

func (oc4 *OpenCart4) ParseConfig(cfgPath string) (*StoreConfig, error)

func (*OpenCart4) UniquePath

func (b *OpenCart4) UniquePath() string

func (*OpenCart4) Version

func (oc4 *OpenCart4) Version(docroot string) (string, error)

type PlatformInterface

type PlatformInterface interface {
	Name() string
	ParseConfig(cfgPath string) (*StoreConfig, error)
	Version(docroot string) (string, error)
	BaseURLs(ctx context.Context, docroot string) ([]string, error)
	ConfigPath() string
	UniquePath() string
}

type Prestashop6

type Prestashop6 struct {
	// contains filtered or unexported fields
}

func (*Prestashop6) BaseURLs

func (p *Prestashop6) BaseURLs(ctx context.Context, docroot string) ([]string, error)

func (*Prestashop6) ConfigPath

func (b *Prestashop6) ConfigPath() string

func (*Prestashop6) Name

func (b *Prestashop6) Name() string

func (*Prestashop6) ParseConfig

func (p *Prestashop6) ParseConfig(cfgPath string) (*StoreConfig, error)

func (*Prestashop6) UniquePath

func (b *Prestashop6) UniquePath() string

func (*Prestashop6) Version

func (p *Prestashop6) Version(docroot string) (string, error)

type Prestashop7

type Prestashop7 struct {
	// contains filtered or unexported fields
}

func (*Prestashop7) BaseURLs

func (p *Prestashop7) BaseURLs(ctx context.Context, docroot string) ([]string, error)

func (*Prestashop7) ConfigPath

func (b *Prestashop7) ConfigPath() string

func (*Prestashop7) Name

func (b *Prestashop7) Name() string

func (*Prestashop7) ParseConfig

func (p *Prestashop7) ParseConfig(cfgPath string) (*StoreConfig, error)

func (*Prestashop7) UniquePath

func (b *Prestashop7) UniquePath() string

func (*Prestashop7) Version

func (p *Prestashop7) Version(docroot string) (string, error)

type Shopware5

type Shopware5 struct {
	// contains filtered or unexported fields
}

func (*Shopware5) BaseURLs

func (b *Shopware5) BaseURLs(_ context.Context, _ string) ([]string, error)

func (*Shopware5) ConfigPath

func (b *Shopware5) ConfigPath() string

func (*Shopware5) Name

func (b *Shopware5) Name() string

func (*Shopware5) ParseConfig

func (b *Shopware5) ParseConfig(_ string) (*StoreConfig, error)

func (*Shopware5) UniquePath

func (b *Shopware5) UniquePath() string

func (*Shopware5) Version

func (b *Shopware5) Version(_ string) (string, error)

type Shopware6

type Shopware6 struct {
	// contains filtered or unexported fields
}

func (*Shopware6) BaseURLs

func (s *Shopware6) BaseURLs(ctx context.Context, docroot string) ([]string, error)

func (*Shopware6) ConfigPath

func (b *Shopware6) ConfigPath() string

func (*Shopware6) Name

func (b *Shopware6) Name() string

func (*Shopware6) ParseConfig

func (s *Shopware6) ParseConfig(cfgPath string) (*StoreConfig, error)

func (*Shopware6) UniquePath

func (b *Shopware6) UniquePath() string

func (*Shopware6) Version

func (s *Shopware6) Version(docroot string) (string, error)

type Store

type Store struct {
	DocRoot  string
	Platform PlatformInterface
	Config   *StoreConfig
}

func DiscoverStores

func DiscoverStores() []*Store

DiscoverStores searches several common docroot locations for stores

func FindStoreAtRoot

func FindStoreAtRoot(docroot string) *Store

func FindStoreAtUniquePath

func FindStoreAtUniquePath(path string) *Store

For recursively walking the filesystem: derive a store from a uniquely identifying path

func (*Store) ConfigPath

func (s *Store) ConfigPath() string

type StoreConfig

type StoreConfig struct {
	DB        *DBConfig
	AdminSlug string
}

type Sylius

type Sylius struct {
	// contains filtered or unexported fields
}

func (*Sylius) BaseURLs

func (s *Sylius) BaseURLs(ctx context.Context, docroot string) ([]string, error)

func (*Sylius) ConfigPath

func (b *Sylius) ConfigPath() string

func (*Sylius) Name

func (b *Sylius) Name() string

func (*Sylius) ParseConfig

func (s *Sylius) ParseConfig(cfgPath string) (*StoreConfig, error)

func (*Sylius) UniquePath

func (b *Sylius) UniquePath() string

func (*Sylius) Version

func (s *Sylius) Version(docroot string) (string, error)

type WooCommerce

type WooCommerce struct {
	// contains filtered or unexported fields
}

func (*WooCommerce) BaseURLs

func (w *WooCommerce) BaseURLs(ctx context.Context, docroot string) ([]string, error)

func (*WooCommerce) ConfigPath

func (b *WooCommerce) ConfigPath() string

func (*WooCommerce) Name

func (b *WooCommerce) Name() string

func (*WooCommerce) ParseConfig

func (w *WooCommerce) ParseConfig(cfgPath string) (*StoreConfig, error)

func (*WooCommerce) UniquePath

func (b *WooCommerce) UniquePath() string

func (*WooCommerce) Version

func (w *WooCommerce) Version(docroot string) (string, error)

Directories

Path Synopsis
cmd
find command

Jump to

Keyboard shortcuts

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