dvdstore

package
v0.0.0-...-cb069d3 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresRepo

type PostgresRepo interface {
	GetAllCustomers(limit int) ([]*models.Customer, error)
	GetCustomer(customerId int) (*models.Customer, error)
	AddCustomer(customer *models.Customer) (id int, err error)
	DeleteCustomer(customerId int) error

	GetAllProducts(limit int) ([]*models.Product, error)
	GetProduct(productId int) (*models.Product, error)
	AddProduct(prod *models.Product) (productId int, err error)
	DeleteProduct(productId int) error

	GetOrder(orderId int) (*models.Order, error)
	GetCustomerOrders(customerId int) ([]*models.Order, error)
	AddOrder(customerId int, products []*models.Product) (*models.Order, error)
	DeleteOrder(orderId int) error
}

PostgresRepo is used to interact via postgresql

type Usecase

type Usecase interface {
	GetCustomers(limit int) ([]*models.Customer, error)
	GetCustomer(customerId int) (*models.Customer, error)
	AddCustomer(customer *models.Customer) (id int, err error)
	DeleteCustomer(customerId int) error

	GetProducts(limit int) ([]*models.Product, error)
	GetProduct(productId int) (*models.Product, error)
	AddProduct(prod *models.Product) (productId int, err error)
	DeleteProduct(productId int) error

	GetOrder(orderId int) (*models.Order, error)
	GetCustomerOrders(customerId int) ([]*models.Order, error)
	AddOrder(customerId int, products []*models.Product) (*models.Order, error)
	DeleteOrder(orderId int) error
}

Usecase is a use case for dvdstore

Directories

Path Synopsis
repository

Jump to

Keyboard shortcuts

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