database

package
v0.0.0-...-e2f90f4 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateProduct

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

func DeleteProduct

func DeleteProduct(db *sql.DB, productId int, ctx context.Context) error

func GetProduct

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

func New

func New() (*sql.DB, error)

func NewWithWrappedTracing

func NewWithWrappedTracing() (*sql.DB, error)

func UpdateProduct

func UpdateProduct(db *sql.DB, product *Product, ctx context.Context) 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, ctx context.Context) ([]*Product, error)

func (*Product) String

func (p *Product) String() string

Jump to

Keyboard shortcuts

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