Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *sql.DB
DB ...
Functions ¶
func AddProduct ¶
AddProduct .... TODO update this to user images
Types ¶
type Cart ¶
type Cart struct { Items []CartItem `json:"items"` PaymentMethod int `json:"paymentid"` ShippingAdress ShippingAdress `json:"shippingadress"` }
type Category ¶
type Category struct { ID int64 `json:"id"` UUID string `json:"uuid"` Name string `json:"name"` Description string `json:"description"` Picture string `json:"picture"` }
Category ..
func GetCategories ¶
func GetCategoryById ¶
type Order ¶
type Order struct { ID int64 `json:"id"` UUID string `json:"uuid"` ProductID int64 `json:"productid"` CustomerID int64 `json:"customer"` PaymentID int64 `json:"payment"` ShippingAdress ShippingAdress `json:"shippingadress"` Paid bool `json:"paid"` Fulfilled bool `json:"fulfilled"` TimePlaced time.Time `json:"timestamp"` Price float64 `json:"price"` Quantity int `json:"quantity"` }
func GetUserOrders ¶
type Payment ¶
type Payment struct { ID int64 `json:"id"` UUID string `json:"uuid"` PaymentType string `json:"paymenttype"` Allowed bool `json:"allowed"` }
func GetPayment ¶
func GetPayments ¶
type Product ¶
type Product struct { ID int64 `json:"id"` UUID string `json:"uuid"` Name string `json:"name"` Images []ProductsImages `json:"images"` Description string `json:"description"` // Unit price Price float64 `json:"price"` ProductStock float64 `json:"stock"` UpdateDate time.Time `json:"update_date"` //AvailableSizes int `json:"size"` //AvailableColor string `json:"color"` QuantityPerUnit int64 `json:"quantitypreunit"` CategoryID int64 `json:"categoryid"` Category Category `json:"category"` }
Product describe a ecom
type ProductsImages ¶
type ShippingAdress ¶
type User ¶
type User struct { ID int64 `json:"id"` UUID string `json:"uuid"` Fisrtname string `json:"firstname"` Lastname string `json:"lastname"` Username string `json:"username"` Address string Location string `json:"location"` PhoneNumber string `json:"phonenumber"` Email string `json:"email"` PasswordHash string Password string `json:"password"` JoinedOn time.Time `json:"joinedon"` }
User ...
func GetUserByUUID ¶
func (*User) CreateUser ¶
CreateUser writes the userdetails to the database
type UserCredential ¶
UserCredential ...
func (*UserCredential) VerifyUser ¶
func (u *UserCredential) VerifyUser() (user User, err error)
VerifyUser ...
Click to show internal directories.
Click to hide internal directories.