catalog

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotFoundError = &ProductError{Code: http.StatusNotFound, Message: "Not found"}

Functions

This section is empty.

Types

type Product

type Product struct {
	ID    int    `json:"id"`
	Name  string `json:"name"`
	Price int    `json:"price"`
	Color string `json:"color"`
	Size  string `json:"size"`
}

Product model

func (*Product) IsValid

func (p *Product) IsValid() bool

IsValid checks whether a product is valid

type ProductCreated

type ProductCreated struct {
	ID int `json:"id"`
}

ProductCreated model

type ProductError

type ProductError struct {
	Code    int
	Message string
}

ProductError model

func (*ProductError) Error

func (err *ProductError) Error() string

type ProductPage

type ProductPage struct {
	Products   []Product `json:"products"`
	TotalCount int       `json:"totalCount"`
}

ProductPage model

Jump to

Keyboard shortcuts

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