Documentation ¶
Index ¶
- Variables
- type Category
- type Categorys
- type Data
- type Product
- type Products
- func (products *Products) AddProduct(p Product)
- func (products *Products) DelProduct(id int)
- func (products *Products) EditProduct(id int, p Product)
- func (products *Products) GetMultipleItems(count int) Products
- func (products *Products) GetProductById(id int) (x Product, err error)
- func (products *Products) GetProductsByCategory(categoryid string) (Products, error)
- type Review
Constants ¶
This section is empty.
Variables ¶
View Source
var CategorName = make(map[string]string)
View Source
var CategoryIds = make(map[string][]int)
View Source
var GlobalId = 0
View Source
var Hashmap = make(map[string]int)
View Source
var ProductsList = InitProducts()
Functions ¶
This section is empty.
Types ¶
type Data ¶
func (*Data) GetDataAndChangeTitle ¶
type Product ¶
type Product struct { Images []string `json:"images"` Name string `json:"name"` NameId string `json:"name_id"` Price float64 `json:"price"` Description string `json:"description"` Category string `json:"category"` CategoryId string `json:"category_id"` Reviews []Review `json:"reviews"` Views int `json:"views"` AverageRating float64 `json:"average_rating"` IsDeleted bool `json:"isdeleted"` ID int `json:"id"` }
type Products ¶
type Products struct {
Product []Product `json:"products"`
}
func InitProducts ¶
func InitProducts() *Products
func (*Products) AddProduct ¶
func (*Products) DelProduct ¶
func (*Products) EditProduct ¶
func (*Products) GetMultipleItems ¶
func (*Products) GetProductById ¶
Click to show internal directories.
Click to hide internal directories.