repositories

package
v0.0.0-...-4bb76e4 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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)

Jump to

Keyboard shortcuts

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