data

package
v0.0.0-...-7fc8bb1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrProductNotFound = fmt.Errorf("Product not found")

Functions

func AddProduct

func AddProduct(p *Product)

func UpdateProduct

func UpdateProduct(id int, p *Product) error

Types

type Product

type Product struct {
	ID          int     `json:"id"`
	Name        string  `json:"name"`
	Description string  `json:"desc"`
	Price       float32 `json:"price"`
}

func (*Product) FromJSON

func (p *Product) FromJSON(r io.Reader) error

type Products

type Products []*Product

func GetProducts

func GetProducts() Products

func (*Products) ToJSON

func (p *Products) ToJSON(w io.Writer) error

Jump to

Keyboard shortcuts

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