Documentation
¶
Overview ¶
Package petstore demonstrates a full CRUD JSON API server using r3 with GORM and PostgreSQL.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pet ¶
type Pet struct {
ID int64 `gorm:"primaryKey" json:"id"`
Name string `gorm:"not null" json:"name"`
SpeciesID int64 `gorm:"not null" json:"species_id"`
Species *Species `gorm:"foreignKey:SpeciesID" json:"species,omitempty"`
Status string `gorm:"not null;default:'available'" json:"status"` // available, pending, sold
Age int ` json:"age"`
Price float64 ` json:"price"`
Tags string ` json:"tags"` // comma-separated tags for simplicity
CreatedAt time.Time ` json:"created_at"`
UpdatedAt time.Time ` json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
Pet represents a pet in the store.
Click to show internal directories.
Click to hide internal directories.