Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *mongo.Database
Functions ¶
func CreateProduct ¶
func CreateProduct(w http.ResponseWriter, r *http.Request)
CreateProduct : Method for insert a product in DB
func GetProducts ¶
func GetProducts(w http.ResponseWriter, r *http.Request)
GetProducts : Method for get all products in the DB
Types ¶
type Product ¶
type Product struct { //Id primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` Available bool `json:"disponible,omitempty" bson:"disponible,omitempty"` Name string `json:"nombre,omitempty" bson:"nombre,omitempty"` Description string `json:"descripcion,omitempty" bson:"descripcion,omitempty"` Price int32 `json:"precioUni,omitempty" bson:"precioUni,omitempty"` Category primitive.ObjectID `json:"categoria,omitempty" bson:"categoria,omitempty"` User primitive.ObjectID `json:"usuario,omitempty" bson:"usuario,omitempty"` Image string `json:"img,omitempty" bson:"img,omitempty"` }
Product : Model for product struct
Click to show internal directories.
Click to hide internal directories.