Documentation ¶
Index ¶
- type BBStandard
- func (s *BBStandard) Delete(db *gorm.DB, values url.Values, id int) (int, interface{})
- func (BBStandard) Get(db *gorm.DB, values url.Values, id int) (int, interface{})
- func (BBStandard) Post(db *gorm.DB, values url.Values, request *http.Request, id int, adj string) (int, interface{})
- func (BBStandard) Put(db *gorm.DB, values url.Values, body io.ReadCloser) (int, interface{})
- type Standard
- type StandardInt
- type ThreadStandard
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BBStandard ¶
type BBStandard struct { Standard `gorm:"embedded;embeddedPrefix:bb_"` // Thread definition (if needed) ThreadID int `json:"-"` Thread ThreadStandard `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` // IsThreaded : true if it's a threaded bottom bracket IsThreaded bool // IsPressFit : true if it's a pressfit bottom bracket // (can't be true with isThreaded) IsPressFit bool // the inside width of the shell in mm ShellWidth float32 // External diameter in mm ExternalWidth float32 }
BBStandard will define the bottom bracket standard
func GetAll ¶
func GetAll(db *gorm.DB, page string, perPage string) (standards []BBStandard)
GetAll will returns al the standards
func (BBStandard) Post ¶
func (BBStandard) Post(db *gorm.DB, values url.Values, request *http.Request, id int, adj string) (int, interface{})
Post will save the BBStandard
func (BBStandard) Put ¶
func (BBStandard) Put(db *gorm.DB, values url.Values, body io.ReadCloser) (int, interface{})
Put updates BBStandard
type Standard ¶
type Standard struct { // add basic ID/Created@/Updated@/Delete@ through Gorm gorm.Model // TODO : this is a embded struct on other structs, // find a way to create indexes on each struct that embed this struct Name string `gorm:"uniqueIndex:standard_uniqueness"` Country string Code string `gorm:"uniqueIndex:standard_uniqueness"` Type string `gorm:"uniqueIndex:standard_uniqueness"` Description string }
Standard define the generic common Standard properties
type StandardInt ¶
type StandardInt interface { GetName() string GetCountry() string GetCode() string GetType() string Get() string }
StandardInt interface define all the method that a standard need to have to be a real standard struct
type ThreadStandard ¶
ThreadStandard defines the the standard of a thread used todo : https://en.wikipedia.org/wiki/Screw_thread
Click to show internal directories.
Click to hide internal directories.