pkg

package module
v0.0.0-...-202847b Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

README

CoreStore: A standard library for e-commerce | WIP (Work in Progress)

based on an optimized Magento 2 database structure.

Build Status wercker status Appveyor Build status GoDoc goreportcard

Magento is a trademark of MAGENTO, INC..

Min. Go Version: 1.11

Usage

To properly use the CoreStore packages, some environment variables must be set before running go generate. (TODO)

Required settings

CS_DSN the environment variable for the MySQL connection.

$ export CS_DSN='username:pa55w0rd@tcp(localhost:3306)/databaseName?parseTime=true&loc=UTC&collation=utf8mb4_unicode_ci'
$ go get github.com/corestoreio/pkg
$ export CS_DSN='see previous'
$ cd $GOPATH/src/github.com/corestoreio/pkg
$ xgo run xcodegen/tableToStruct/*.go

Testing

Setup database for Magento 2 and fill them with the provided testdata.

Create a DSN env var CS_DSN and point it to Magento 2 database. Run the tests.

TODO

If you find an entry in the source like TODO(CS) that means you can ask CS to get more information about how to implement and what to fix if the context of the todo description isn't understandable.

  • Create Magento 2 modules to setup test database and test Magento system.

Details

  • single repo. CoreStore is a single repo. That means things can be changed and rearranged globally atomically with ease and confidence.

  • no backwards compatibility. CoreStore makes no backwards compatibility promises. If you want to use CoreStore, vendor it. And next time you update your vendor tree, update to the latest API if things in CoreStore changed. The plan is to eventually provide tools to make this easier.

  • forward progress because we have no backwards compatibility, it's always okay to change things to make things better. That also means the bar for contributions is lower. We don't have to get the API 100% correct in the first commit.

  • no Go version policy CoreStore packages are usually built and tested with the latest Go stable version. However, CoreStore has no overarching version policy; each package can declare its own set of supported Go versions.

  • code review contributions must be code-reviewed.

  • CLA compliant contributors must agree to the CLA.

  • docs, tests, portability all code should be documented in the normal Go style, have tests, and be portable to different operating systems and architectures. We'll try to get builders in place to help run the tests on different OS/arches. For now we have Travis at least.

Contributing

Please have a look at the contribution guidelines That document is an idea.

Acknowledgements

Some packages have been fully refactored but the initial idea has been extracted from the geniuses listed below:

Name Package License
Steve Francia util/conv MIT Copyright (c) 2014
Martin Angers and Contributors. ctxthrottled The MIT License (MIT) 2014
Dave Cheney util/errors The MIT License (MIT) 2015
Jad Dittmar finance aka. money Copyright (c) 2011
Google Inc youtube/vitess\sqlparser Copyright 2012 BSD Style
Olivier Poitrey ctxmw.WithAccessLog & CORS Copyright (c) 2014-2015 MIT License
Dave Grijalva csjwt Copyright (c) 2012 MIT License
Uber Technologies, Inc. log Copyright (c) 2016 MIT License
2013 The Go Authors singleflight Copyright (c) 2013 BSD Style
Carl Jackson (carl@avtok.com) (Goji) net/responseproxy Copyright (c) 2014, 2015, 2016
Greg Roseberry, 2014; Patrick O'Brien, 2016 util/null BSD Copyright (c) 2014, 2015, 2016
The Go-MySQL-Driver Authors storage/null/time_mysql.go Mozilla Public License, v. 2.0, Copyright 2012
siddontang storage/binlogsync MIT Copyright (c) 2014
siddontang storage/myreplicator MIT Copyright (c) 2014
Tace De Wolf util/byteconv MIT Copyright (c) 2015
Copyright 2013 The Camlistore Authors util/byteconv Apache 2.0
Copyright 2013 Google Inc. storage/lru Apache 2.0
Alex Saskevich util/validation MIT Copyright (c) 2014
Mat Ryer and Tyler Bunnell util/assert or github.com/stretchr/testify Copyright (c) 2012 - 2013
Google Youtube storage/lru Apache License, Version 2.0
Iman Tumorang util/pseudo Copyright (c) 2017 Iman Tumorang
Dmitry Afanasyev util/pseudo Copyright (c) 2014 Dmitry Afanasyev
Michal Witkowski net/csgrpc/auth Copyright (c) 2016 Michal Witkowski, Apache 2
go-pg/pg Authors sql/urlvalues Copyright (c) 2013 MIT

Licensing

CoreStore is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

Cyrill Schumacher - PGP Key

Documentation

Overview

pkg provides standard libraries for distributed e-commerce based on an optimized Magento 2 database structure.

Magento is a trademark of MAGENTO, INC. http://www.magentocommerce.com/license/

Directories

Path Synopsis
Package codegen is deprecated and generates Go code and is only used in development.
Package codegen is deprecated and generates Go code and is only used in development.
formhandler
formhandler generates code to map URL query string or URL encoded form data to structs and vice versa.
formhandler generates code to map URL query string or URL encoded form data to structs and vice versa.
localization
package main generates i18n names of currencies, countries because not yet implemented in text/language TODO.
package main generates i18n names of currencies, countries because not yet implemented in text/language TODO.
localization/gen
Package gen contains common code for the various code generation tools in the text repository.
Package gen contains common code for the various code generation tools in the text repository.
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, slices and function receivers from SQL tables.
package main generates Go structs, slices and function receivers from SQL tables.
Package authorization enables management of access control list roles and rules.
Package authorization enables management of access control list roles and rules.
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 config, abbrev.
Package config, abbrev.
_cfgsource
Package deprecated source provides a slice type for handling config sources to be used in config/models.
Package deprecated source provides a slice type for handling config sources to be used in config/models.
observer
Package observer provides validators and modifiers for configuration values.
Package observer provides validators and modifiers for configuration values.
storage
Package storage provides the available storage engines for level 1 and level 2 caches.
Package storage provides the available storage engines for level 1 and level 2 caches.
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.
custconfig
Package custconfig handles configuration structure and its models.
Package custconfig handles configuration structure and its models.
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.
eav
Package eav contains the logic for the Entity-Attribute-Value pattern (WIP).
Package eav contains the logic for the Entity-Attribute-Value pattern (WIP).
eavgen
Package eavgen generates code for concrete normalized EAV models.
Package eavgen generates code for concrete normalized EAV models.
Package mail provides functions and services for sending html or text emails via encrypted or unencrypted connections.
Package mail provides functions and services for sending html or text emails via encrypted or unencrypted connections.
Package generic contains all generic functions.
Package generic contains all generic functions.
Package i18n supports string translations with variable substitution, CLDR pluralization, currency, formats, language, regions and timezones.
Package i18n supports string translations with variable substitution, CLDR pluralization, currency, formats, language, regions and timezones.
Package locale provides locale specific services like formatting or translating.
Package locale provides locale specific services like formatting or translating.
net
Package net provides additional network helper functions and in subpackages middleware.
Package net provides additional network helper functions and in subpackages middleware.
auth/backendauth
Package backendauth (TODO) defines the backend configuration options and element slices.
Package backendauth (TODO) defines the backend configuration options and element slices.
cors
Package cors provides a middleware for Cross-origin resource sharing (CORS).
Package cors provides a middleware for Cross-origin resource sharing (CORS).
cors/backendcors
Package backendcors defines the backend configuration options and element slices.
Package backendcors defines the backend configuration options and element slices.
csgrpc
Package csgrpc provides basics types for grpc servers and clients.
Package csgrpc provides basics types for grpc servers and clients.
csgrpc/auth
Package grpc_auth a generic server-side auth middleware for gRPC.
Package grpc_auth a generic server-side auth middleware for gRPC.
csgrpc/scope
Package grpc_scope handles setting and retrieving the store/scope for clients and servers.
Package grpc_scope handles setting and retrieving the store/scope for clients and servers.
csrf
Package csrf implements scope based Cross-Site Request Forgery protection.
Package csrf implements scope based Cross-Site Request Forgery protection.
geoip
Package geoip detects the country by an IP address and provides alternative handlers.
Package geoip detects the country by an IP address and provides alternative handlers.
geoip/backendgeoip
Package backendgeoip defines the backend configuration options and element slices.
Package backendgeoip defines the backend configuration options and element slices.
geoip/maxmindfile
Package maxmindfile provides an OptionFactoryFunc for the backendgeopip package.
Package maxmindfile provides an OptionFactoryFunc for the backendgeopip package.
geoip/maxmindwebservice
Package maxmindwebservice provides an OptionFactoryFunc for the backendgeopip package.
Package maxmindwebservice provides an OptionFactoryFunc for the backendgeopip package.
internal/scopedservice
Package scopedservice gets copied to specific net middleware packages - do not use.
Package scopedservice gets copied to specific net middleware packages - do not use.
jwt
Package jwt provides a middleware for JSON web token authentication and runMode initialization.
Package jwt provides a middleware for JSON web token authentication and runMode initialization.
jwt/backendjwt
Package backendjwt defines the backend configuration options and element slices.
Package backendjwt defines the backend configuration options and element slices.
mw
Package mw provides a various middleware.
Package mw provides a various middleware.
problem
Package problem implements the RFC7807 Details for HTTP APIs.
Package problem implements the RFC7807 Details for HTTP APIs.
ratelimit
Package ratelimit implements scope based HTTP rate limiting.
Package ratelimit implements scope based HTTP rate limiting.
request
Package request provides functions for http request handling.
Package request provides functions for http request handling.
response
Package response provides functions for working with an http response.
Package response provides functions for working with an http response.
responseproxy
Package responseproxy provides various proxy functions for extending http.ResponseWriter.
Package responseproxy provides various proxy functions for extending http.ResponseWriter.
runmode
Package runmode defines store specific middleware to initialize the scope and its ID per request.
Package runmode defines store specific middleware to initialize the scope and its ID per request.
secure
Package secure adds a middleware for quick security wins to response HTTP headers
Package secure adds a middleware for quick security wins to response HTTP headers
signed
Package signed provides a middleware to sign responses and validate requests.
Package signed provides a middleware to sign responses and validate requests.
url
Package url parses program specific URLs and provides helper functions.
Package url parses program specific URLs and provides helper functions.
Package payment defines a payment processing library which can connect to payment gateways.
Package payment defines a payment processing library which can connect to payment gateways.
exchangerate
Package exchangerate imports rates from various services
Package exchangerate imports rates from various services
sql
Package sql contains subpackages for working with MySQL and its derivates.
Package sql contains subpackages for working with MySQL and its derivates.
ddl
Package ddl implements MySQL data definition language functions.
Package ddl implements MySQL data definition language functions.
dml
Package dml handles the SQL DML for super fast performance, type safety and convenience.
Package dml handles the SQL DML for super fast performance, type safety and convenience.
dmlgen
Package dmlgen generates Go code and protocol buffer files from database tables.
Package dmlgen generates Go code and protocol buffer files from database tables.
dmlgen/dmltestgenerated2
Code generated by corestoreio/pkg/util/codegen.
Code generated by corestoreio/pkg/util/codegen.
dmlgen/dmltestgenerated3
Code generated by corestoreio/pkg/util/codegen.
Code generated by corestoreio/pkg/util/codegen.
dmlgen/dmltestgenerated4
Code generated by corestoreio/pkg/util/codegen.
Code generated by corestoreio/pkg/util/codegen.
dmlgen/dmltestgenerated5
Code generated by corestoreio/pkg/util/codegen.
Code generated by corestoreio/pkg/util/codegen.
dmlgen/dmltestgeneratedMToM
Code generated by corestoreio/pkg/util/codegen.
Code generated by corestoreio/pkg/util/codegen.
dmltest
Package dmltest provides functions for testing the dml package.
Package dmltest provides functions for testing the dml package.
dmltype
Package dmltype provides additional types for database values.
Package dmltype provides additional types for database values.
migration
Package migration provides tools for database schema migrations.
Package migration provides tools for database schema migrations.
mview
Package mview adds materialized views via events on the MySQL binary log.
Package mview adds materialized views via events on the MySQL binary log.
mycanal
Package mycanal adds event listener to a MySQL/MariaDB compatible binlog, based on pkg myreplicator to provide triggerless events.
Package mycanal adds event listener to a MySQL/MariaDB compatible binlog, based on pkg myreplicator to provide triggerless events.
myreplicator
Package myreplicator handles the MySQL binary replication protocol.
Package myreplicator handles the MySQL binary replication protocol.
Package storage provides everything from MySQL, Redis, BoltDB, file etc functions.
Package storage provides everything from MySQL, Redis, BoltDB, file etc functions.
lru
Package lru implements a LRU cache.
Package lru implements a LRU cache.
null
Package null contains types which can be NULL in some storage engines.
Package null contains types which can be NULL in some storage engines.
objcache
Package objcache transcodes arbitrary Go types to bytes and stores them in a cache reducing GC.
Package objcache transcodes arbitrary Go types to bytes and stores them in a cache reducing GC.
Package store implements the handling of websites, groups and stores.
Package store implements the handling of websites, groups and stores.
mock
Package mock implements mocking of the store.Service for tests.
Package mock implements mocking of the store.Service for tests.
scope
Package scope defines the configuration of scopes default, website, group and store.
Package scope defines the configuration of scopes default, website, group and store.
Package sync provides tools to deal with goroutines.
Package sync provides tools to deal with goroutines.
bgwork
Package bgwork handles background work or jobs distributed over many machines.
Package bgwork handles background work or jobs distributed over many machines.
suspend
Package suspend provides a complicated duplicate function call suppression mechanism.
Package suspend provides a complicated duplicate function call suppression mechanism.
Package tax takes care of all kind of taxes.
Package tax takes care of all kind of taxes.
Package util should stay empty.
Package util should stay empty.
assert
Package assert provides a set of comprehensive testing tools for use with the normal Go testing system.
Package assert provides a set of comprehensive testing tools for use with the normal Go testing system.
bufferpool
Package bufferpool implements a pool of reusable auto-resizing buffers.
Package bufferpool implements a pool of reusable auto-resizing buffers.
byteconv
Package byteconv converts sql.RawBytes for MySQL or MariaDB to primitive types.
Package byteconv converts sql.RawBytes for MySQL or MariaDB to primitive types.
codegen
Package codegen generates Go, Protobuf, Flatbuffers, TypeScript, etc.
Package codegen generates Go, Protobuf, Flatbuffers, TypeScript, etc.
conv
Package conv - easy and safe casting from one type to another.
Package conv - easy and safe casting from one type to another.
csjwt
Package csjwt handles JSON web tokens.
Package csjwt handles JSON web tokens.
csjwt/cmd/jwt
A useful example app.
A useful example app.
csjwt/jwtclaim
Package jwtclaim provides claim structs and maps for convenience.
Package jwtclaim provides claim structs and maps for convenience.
csjwt/jwthttp
Package jwthttp extracts, parses and verifies a token from HTTP requests.
Package jwthttp extracts, parses and verifies a token from HTTP requests.
cstesting
Package cstesting provides testing helpers
Package cstesting provides testing helpers
diff
package diff compares two strings and prints out all differences
package diff compares two strings and prints out all differences
gzippool
Package gzippool provides pooled gzip reader and writers.
Package gzippool provides pooled gzip reader and writers.
hashpool
Package hashpool implements a pool for reusable and registered hash.Hash types.
Package hashpool implements a pool for reusable and registered hash.Hash types.
naughtystrings
Package naughtystrings is a collection of strings that have a high probability of causing issues when used as user input.
Package naughtystrings is a collection of strings that have a high probability of causing issues when used as user input.
pseudo
package pseudo is the fake data generator, heavily inspired by forgery and ffaker Ruby gems.
package pseudo is the fake data generator, heavily inspired by forgery and ffaker Ruby gems.
slices
Package slices contains functions for working on specific slice types.
Package slices contains functions for working on specific slice types.
strs
Package strs contains additional string manipulation functions.
Package strs contains additional string manipulation functions.
translit
Package translit replaces characters in a string using a huge conversion table.
Package translit replaces characters in a string using a huge conversion table.

Jump to

Keyboard shortcuts

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