pgsql

package
v0.0.0-...-c60e208 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyExists = echo.NewHTTPError(http.StatusInternalServerError, "Product name  already exists.")
)

Custom errors

Functions

This section is empty.

Types

type Product

type Product struct{}

Product represents the client for product table

func NewProduct

func NewProduct() *Product

NewProduct returns a new product database instance

func (*Product) Create

func (self *Product) Create(db orm.DB, productModel model.Product) (*model.Product, error)

Create creates a new product on database

func (*Product) Delete

func (self *Product) Delete(db orm.DB, product *model.Product) error

Delete sets deleted_at for a product

func (*Product) List

func (self *Product) List(db orm.DB, qp *model.FilterQuery, p *model.Pagination) ([]model.Product, int, error)

List returns list of all products retrievable for the current product, depending on role

func (*Product) Update

func (self *Product) Update(db orm.DB, product *model.Product) error

Update updates product's contact info

func (*Product) View

func (self *Product) View(db orm.DB, qp *model.FilterQuery) (*model.Product, error)

View returns single product by ID

Jump to

Keyboard shortcuts

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