Discover Packages
github.com/sebastian-nunez/golang-store-api
types
package
Version:
v0.0.0-...-f80c191
Opens a new window with list of versions in this module.
Published: Aug 10, 2024
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
type CartCheckoutItem struct {
ProductID int `json:"productId"`
Quantity int `json:"quantity"`
}
type CartCheckoutRequest struct {
Items []CartCheckoutItem `json:"items" validate:"required"`
}
type CreateProductRequest struct {
Name string `json:"name" validate:"required"`
Description string `json:"description"`
Image string `json:"image"`
Price float64 `json:"price" validate:"required"`
Quantity int `json:"quantity" validate:"required"`
}
type LoginUserRequest struct {
Email string `json:"email" validate:"required,email"`
Password string `json:"password" validate:"required"`
}
type Order struct {
ID int `json:"id"`
UserID int `json:"userId"`
Total float64 `json:"total"`
Status string `json:"status"`
Address string `json:"address"`
CreatedAt time .Time `json:"createdAt"`
}
type OrderItem struct {
ID int `json:"id"`
OrderID int `json:"orderId"`
ProductID int `json:"productId"`
Quantity int `json:"quantity"`
Price float64 `json:"price"`
CreatedAt time .Time `json:"createdAt"`
}
type Product struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Image string `json:"image"`
Price float64 `json:"price"`
Quantity int `json:"quantity"`
CreatedAt time .Time `json:"createdAt"`
}
type RegisterUserRequest struct {
FirstName string `json:"firstName" validate:"required"`
LastName string `json:"lastName" validate:"required"`
Email string `json:"email" validate:"required,email"`
Password string `json:"password" validate:"required,min=4,max=128"`
}
type User struct {
ID int `json:"id"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Email string `json:"email"`
Password string `json:"-"`
CreatedAt time .Time `json:"createdAt"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.