Documentation
¶
Overview ¶
Package productgrp maintains the group of handlers for product access.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidID = errors.New("ID is not in its proper form")
)
Set of error variables for handling product group errors.
Functions ¶
Types ¶
type AppNewProduct ¶
type AppNewProduct struct {
Name string `json:"name" validate:"required"`
Cost float64 `json:"cost" validate:"required,gte=0"`
Quantity int `json:"quantity" validate:"required,gte=1"`
}
AppNewProduct defines the data needed to add a new product.
func (AppNewProduct) Validate ¶
func (app AppNewProduct) Validate() error
Validate checks the data in the model is considered clean.
type AppProduct ¶
type AppProduct struct {
ID string `json:"id"`
UserID string `json:"userID"`
Name string `json:"name"`
Cost float64 `json:"cost"`
Quantity int `json:"quantity"`
DateCreated string `json:"dateCreated"`
DateUpdated string `json:"dateUpdated"`
}
AppProduct represents information about an individual product.
type AppUpdateProduct ¶
type AppUpdateProduct struct {
Name *string `json:"name"`
Cost *float64 `json:"cost" validate:"omitempty,gte=0"`
Quantity *int `json:"quantity" validate:"omitempty,gte=1"`
}
AppUpdateProduct defines the data needed to update a product.
func (AppUpdateProduct) Validate ¶
func (app AppUpdateProduct) Validate() error
Validate checks the data in the model is considered clean.
Click to show internal directories.
Click to hide internal directories.