Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MariaDBOrderRepository ¶
type MariaDBOrderRepository struct { OrderRepository // contains filtered or unexported fields }
func NewMariaDBOrderRepository ¶
func NewMariaDBOrderRepository(host string, dbName string, username string, password string) (*MariaDBOrderRepository, error)
Construct a new repository connected to MariaDB
func (*MariaDBOrderRepository) CreateOrder ¶
func (repo *MariaDBOrderRepository) CreateOrder(order *Order) error
Writes the given order to the database.
func (*MariaDBOrderRepository) GetOrder ¶
func (repo *MariaDBOrderRepository) GetOrder(orderId string) (*Order, error)
Returns the order with the given ID from the database. If not found, then nil.
func (*MariaDBOrderRepository) MarkOrderDelivered ¶
func (repo *MariaDBOrderRepository) MarkOrderDelivered(orderId string) error
Sets the 'delivered' field for the given order ID. Returns an error if the order doesn't exist.
Click to show internal directories.
Click to hide internal directories.