Documentation ¶
Index ¶
- Constants
- Variables
- type CustomerRepository
- type MongoDBLayer
- func (mgoLayer *MongoDBLayer) AddOrder(order entities.Order) ([]byte, error)
- func (mgoLayer *MongoDBLayer) ExecuteCommand(cmd interface{}) (interface{}, error)
- func (mgoLayer *MongoDBLayer) FindAllOrders() ([]entities.Order, error)
- func (mgoLayer *MongoDBLayer) FindOrder(id []byte) (entities.Order, error)
- func (mgoLayer *MongoDBLayer) FindOrderByCustomerName(customername string) (entities.Order, error)
- type MySQLDBLayer
- func (mySQLDBLayer *MySQLDBLayer) AddCustomer(customer entities.Customer) (uint, error)
- func (mySQLDBLayer *MySQLDBLayer) Cleanup()
- func (mySQLDBLayer *MySQLDBLayer) DeleteAllData()
- func (mySQLDBLayer *MySQLDBLayer) FindAllCustomers() ([]entities.Customer, error)
- func (mySQLDBLayer *MySQLDBLayer) FindCustomer(customerId uint) (entities.Customer, error)
- func (mySQLDBLayer *MySQLDBLayer) GetSQLConnection() *gorm.DB
- type OrderRepository
Constants ¶
View Source
const (
MONGODB_ORDERSCOLLECTION = "orders"
)
Variables ¶
View Source
var (
ErrIdMustNotBeSet = errors.New("Id must not be set")
)
Functions ¶
This section is empty.
Types ¶
type CustomerRepository ¶
type CustomerRepository interface { AddCustomer(entities.Customer) (uint, error) FindAllCustomers() ([]entities.Customer, error) FindCustomer(customerId uint) (entities.Customer, error) DeleteAllData() GetSQLConnection() *gorm.DB Cleanup() }
func MySQLBLayer ¶
func MySQLBLayer(connection string, databaseName string) (CustomerRepository, error)
func NewCustomerRepository ¶
func NewCustomerRepository(connection string, databaseName string) (CustomerRepository, error)
type MongoDBLayer ¶
type MongoDBLayer struct {
// contains filtered or unexported fields
}
func (*MongoDBLayer) AddOrder ¶
func (mgoLayer *MongoDBLayer) AddOrder(order entities.Order) ([]byte, error)
func (*MongoDBLayer) ExecuteCommand ¶
func (mgoLayer *MongoDBLayer) ExecuteCommand(cmd interface{}) (interface{}, error)
func (*MongoDBLayer) FindAllOrders ¶
func (mgoLayer *MongoDBLayer) FindAllOrders() ([]entities.Order, error)
func (*MongoDBLayer) FindOrder ¶
func (mgoLayer *MongoDBLayer) FindOrder(id []byte) (entities.Order, error)
func (*MongoDBLayer) FindOrderByCustomerName ¶
func (mgoLayer *MongoDBLayer) FindOrderByCustomerName(customername string) (entities.Order, error)
type MySQLDBLayer ¶
type MySQLDBLayer struct {
// contains filtered or unexported fields
}
func (*MySQLDBLayer) AddCustomer ¶
func (mySQLDBLayer *MySQLDBLayer) AddCustomer(customer entities.Customer) (uint, error)
func (*MySQLDBLayer) Cleanup ¶
func (mySQLDBLayer *MySQLDBLayer) Cleanup()
func (*MySQLDBLayer) DeleteAllData ¶
func (mySQLDBLayer *MySQLDBLayer) DeleteAllData()
func (*MySQLDBLayer) FindAllCustomers ¶
func (mySQLDBLayer *MySQLDBLayer) FindAllCustomers() ([]entities.Customer, error)
func (*MySQLDBLayer) FindCustomer ¶
func (mySQLDBLayer *MySQLDBLayer) FindCustomer(customerId uint) (entities.Customer, error)
func (*MySQLDBLayer) GetSQLConnection ¶
func (mySQLDBLayer *MySQLDBLayer) GetSQLConnection() *gorm.DB
type OrderRepository ¶
type OrderRepository interface { AddOrder(entities.Order) ([]byte, error) FindOrder([]byte) (entities.Order, error) FindOrderByCustomerName(string) (entities.Order, error) FindAllOrders() ([]entities.Order, error) ExecuteCommand(interface{}) (interface{}, error) }
func NewEventRepository ¶
func NewEventRepository(connection string) (OrderRepository, error)
func NewMongoDBLayer ¶
func NewMongoDBLayer(connection string) (OrderRepository, error)
Click to show internal directories.
Click to hide internal directories.