models

package
v0.0.0-...-2ec944d Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateProduct

func CreateProduct(db *pg.DB, p *Product) error

func FindDiscounts

func FindDiscounts(client pb.DiscountsServiceClient, productIds []string, userId *string) ([]*pb.Discount, error)

func ProductToProto

func ProductToProto(p *Product) *pb.Product

Types

type Product

type Product struct {
	CreatedAt    time.Time `json:"created_at"`
	ID           uuid.UUID `json:"id", sql:"type:uuid"`
	PriceInCents uint64    `json:"price_in_cents"`
	Title        string    `json:"title"`
	Description  string    `json:"description"`
	// contains filtered or unexported fields
}

func FindProductById

func FindProductById(db *pg.DB, id string) (*Product, error)

func FindProductByIds

func FindProductByIds(db *pg.DB, ids []string) ([]*Product, error)

func ListProducts

func ListProducts(db *pg.DB) ([]*Product, error)

Jump to

Keyboard shortcuts

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