repository

package
v0.0.0-...-18aef32 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inventory

type Inventory interface {
	Startup()
	Shutdown()
	ResolveByProductIDs(ids []uuid.UUID) (inventories []model.Inventory, err error)
	TxUpdate(tx *sqlx.Tx, inventory model.Inventory) (err error)
}

Inventory is the Inventory repository interface

type InventoryMySQLRepo

type InventoryMySQLRepo struct {
	DB *database.MySQL `inject:"mysql"`
}

InventoryMySQLRepo is the repository for Inventory implemented with MySQL backend

func (*InventoryMySQLRepo) ResolveByProductIDs

func (r *InventoryMySQLRepo) ResolveByProductIDs(ids []uuid.UUID) (inventories []model.Inventory, err error)

ResolveByProductIDs resolves Inventories by their Product IDs

func (*InventoryMySQLRepo) Shutdown

func (r *InventoryMySQLRepo) Shutdown()

Shutdown cleans up everything and shuts down

func (*InventoryMySQLRepo) Startup

func (r *InventoryMySQLRepo) Startup()

Startup performs startup functions

func (*InventoryMySQLRepo) TxUpdate

func (r *InventoryMySQLRepo) TxUpdate(tx *sqlx.Tx, inventory model.Inventory) (err error)

TxUpdate performs an update transactionally with transaction object supplied from elsewhere

type Order

type Order interface {
	Startup()
	Shutdown()
	ResolveByID(id uuid.UUID) (order *model.Order, err error)
	TxUpdate(tx *sqlx.Tx, order model.Order) (err error)
}

Order is the Order repository interface

type OrderMySQLRepo

type OrderMySQLRepo struct {
	DB *database.MySQL `inject:"mysql"`
}

OrderMySQLRepo is the repository for Orders implemented with MySQL backend

func (*OrderMySQLRepo) ResolveByID

func (r *OrderMySQLRepo) ResolveByID(id uuid.UUID) (order *model.Order, err error)

ResolveByID resolves an Order by its ID, including its items

func (*OrderMySQLRepo) Shutdown

func (r *OrderMySQLRepo) Shutdown()

Shutdown cleans up everything and shuts down

func (*OrderMySQLRepo) Startup

func (r *OrderMySQLRepo) Startup()

Startup performs startup functions

func (*OrderMySQLRepo) TxUpdate

func (r *OrderMySQLRepo) TxUpdate(tx *sqlx.Tx, order model.Order) (err error)

TxUpdate performs an update transactionally with the transaction object supplied from elsewhere

Jump to

Keyboard shortcuts

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