Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
DB database
Functions ¶
Types ¶
type APIResponse ¶
type APIResponse struct { Code int `json:"code"` ResponseType string `json:"type"` Message string `json:"message"` }
APIResponse is the response for the API when an object is not returned
type Address ¶
type Address struct { ID int64 `gorm:"primary_key"` Street string `json:"street"` City string `json:"city"` State string `json:"state"` Zip string `json:"zip"` CustomerID int64 }
Address is a struct containing address details.
type Category ¶
type Category struct { ID int64 `json:"id" gorm:"primary_key"` Name string `json:"name"` PetID int64 }
Category of pet
type Customer ¶
type Customer struct { ID int64 `json:"id" gorm:"primary_key"` Username string `json:"username"` Address Address `json:"address" gorm:"foreignKey:CustomerID"` }
Customer represents a customer on an main.Order
type Order ¶
type Order struct { ID int64 `json:"id" gorm:"primary_key"` PetID int64 `json:"petId"` Quantity int `json:"quantity"` ShipDate string `json:"shipDate"` Status OrderStatus `json:"status"` Complete bool `json:"complete"` }
Order in a store
type Pet ¶
type Pet struct { ID int64 `json:"id" gorm:"primary_key"` Name string `json:"name"` Category Category `json:"category" gorm:"foreignKey:PetID"` Photos []Photo `gorm:"foreignKey:PetID"` Tags []Tag `json:"tags" gorm:"foreignKey:PetID"` Status PetStatus `json:"status"` Orders []Order `gorm:"foreignKey:PetID"` }
Pet is the pet struct
type User ¶
type User struct { ID int64 `json:"id" gorm:"primary_key"` Username string `json:"username"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Email string `json:"email"` Password string `json:"password"` Phone string `json:"phone"` UserStatus int `json:"userStatus"` }
User represents a customer
Click to show internal directories.
Click to hide internal directories.