Documentation ¶
Overview ¶
Package csfw contains the CoreStore FrameWork based on Magento's database structure. 99% compatible to Magento 1 and 2.
The package csfw contains at the moment only go:generate commands to build Go code.
Two skeleton projects (monolith and SOA) are already setup but of course empty.
Purpose ¶
Why is someone trying to create a Magento database schema compatible online shop in Go?
Because performance :-)
Architecture ¶
@todo 10km view.
Names ¶
Generated SQL table structs start with the word "Table". The word "Slice" will be appended when there is a slice of structs.
Example for generated SQL table structs:
type ( // TableStoreSlice contains pointers to TableStore types TableStoreSlice []*TableStore // TableStore a type for the MySQL table core_store TableStore struct { ... } )
Table indexes are iota constants and start with TableIndex[table name].
The word "collection" will be appended to a variable or function when that variable or function contains a materialized slice or handles it.
Required settings ¶
CS_DSN the environment variable for the MySQL connection.
$ export CS_DSN='magento1:magento1@tcp(localhost:3306)/magento1' $ export CS_DSN='magento2:magento2@tcp(localhost:3306)/magento2' $ go get github.com/corestoreio/csfw $ export CS_DSN_TEST='see next section' $ cd $GOPATH/src/github.com/corestoreio/csfw $ go generate ./...
Testing ¶
Setup two databases. One for Magento 1 and one for Magento 2 and fill them with the provided test data https://github.com/corestoreio/csfw/tree/master/testData
Create a DSN env var CS_DSN_TEST and point it to Magento 1 database. Run the tests. Change the env var to let it point to Magento 2 database. Rerun the tests.
$ export CS_DSN_TEST='magento1:magento1@tcp(localhost:3306)/magento1' $ export CS_DSN_TEST='magento2:magento2@tcp(localhost:3306)/magento2'
IDE ¶
Currently using the IntelliJ IDEA Community Edition with the https://github.com/go-lang-plugin-org/go-lang-idea-plugin plugin.
At the moment Q2/2015: There are no official jar files for downloading so the go lang plugin will be compiled on a daily basis. The plugin works very well! Kudos to those developers!
IDEA has been configured with goimports, gofmt, golint, govet and ... with the file watcher plugin.
Why am I not using vim? Because I would only generate passwords ;-|.
Contributing ¶
Please have a look at the contribution guidelines https://github.com/corestoreio/corestore/blob/master/CONTRIBUTING.md
Trademarks ¶
Magento is a trademark of MAGENTO, INC. http://www.magentocommerce.com/license/
Directories ¶
Path | Synopsis |
---|---|
Package bundle handles the creation of catalog product bundles.
|
Package bundle handles the creation of catalog product bundles. |
Package catalog implements category tree and product features.
|
Package catalog implements category tree and product features. |
catattr
Package catattr handles all product and category related attributes.
|
Package catattr handles all product and category related attributes. |
Package cataloginventory handles product inventory and indexing
|
Package cataloginventory handles product inventory and indexing |
Package codegen generates Go code and is only used in development.
|
Package codegen generates Go code and is only used in development. |
csMake
Package csMake replaces the Makefile and is only used via go:generate.
|
Package csMake replaces the Makefile and is only used via go:generate. |
materialization
package main materializes attributes, sets, groups, entity types, stores, websites, etc.
|
package main materializes attributes, sets, groups, entity types, stores, websites, etc. |
tableToStruct
package main generates Go structs and slices from SQL tables.
|
package main generates Go structs and slices from SQL tables. |
Package config handles the scopes and the configuration via consul, etc or simple files.
|
Package config handles the scopes and the configuration via consul, etc or simple files. |
Package customer handles a customer entity with its addresses.
|
Package customer handles a customer entity with its addresses. |
custattr
Package custattr handles all customer and address related attributes.
|
Package custattr handles all customer and address related attributes. |
Package directory provides features for currencies, currency rates, conversion of prices to a specified currency format, countries and regions.
|
Package directory provides features for currencies, currency rates, conversion of prices to a specified currency format, countries and regions. |
Package eav contains the logic for the Entity-Attribute-Value model based on the Magento database schema.
|
Package eav contains the logic for the Entity-Attribute-Value model based on the Magento database schema. |
Package i18n supports string translations with variable substitution and CLDR pluralization.
|
Package i18n supports string translations with variable substitution and CLDR pluralization. |
Package msrp handles the manufacturer's suggested retail price.
|
Package msrp handles the manufacturer's suggested retail price. |
Package storage provides everything from MySQL, Redis, BoltDB, file, etc functions.
|
Package storage provides everything from MySQL, Redis, BoltDB, file, etc functions. |
csdb
Package csdb implements MySQL handling and general SQL functions.
|
Package csdb implements MySQL handling and general SQL functions. |
dbr
package dbr Additions to Go's database/sql for super fast performance and convenience.
|
package dbr Additions to Go's database/sql for super fast performance and convenience. |
Package store implements the handling of websites, groups and stores.
|
Package store implements the handling of websites, groups and stores. |
Package tax takes care of all kind of taxes.
|
Package tax takes care of all kind of taxes. |
Package testgen is not testing your genes/DNA ;-).
|
Package testgen is not testing your genes/DNA ;-). |
Package utils contains general purpose functions and helpers used in many packages.
|
Package utils contains general purpose functions and helpers used in many packages. |