database

package
v0.0.0-...-a193a83 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CreateTableQuery = `` /* 158-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func CreateProduct

func CreateProduct(db *sql.DB, product *Product) error

func DeleteProduct

func DeleteProduct(db *sql.DB, product *Product) error

func GetProduct

func GetProduct(db *sql.DB, product *Product) error

func UpdateProduct

func UpdateProduct(db *sql.DB, product *Product) error

Types

type Product

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

func GetProducts

func GetProducts(db *sql.DB, start, count int) ([]Product, error)

Jump to

Keyboard shortcuts

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