Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Auth ¶
type Auth struct { AuthID uint64 `gorm:"primaryKey"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` Email string `json:"Email"` Password string `json:"Password"` Users User `gorm:"foreignkey:IDAuth;references:AuthID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` }
Auth model - `auths` table
type Hobby ¶
type Hobby struct { HobbyID uint64 `gorm:"primaryKey"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` Hobby string `json:"Hobby,omitempty"` Users []User `gorm:"many2many:user_hobbies" json:"-"` }
Hobby model - `hobbies` table
type Post ¶
type Post struct { PostID uint64 `gorm:"primaryKey"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` Title string `json:"Title,omitempty"` Body string `json:"Body,omitempty"` IDUser uint64 `json:"-"` }
Post model - `posts` table
type User ¶
type User struct { UserID uint64 `gorm:"primaryKey"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` FirstName string `json:"FirstName,omitempty"` LastName string `json:"LastName,omitempty"` IDAuth uint64 `json:"-"` Posts []Post `gorm:"foreignkey:IDUser;references:UserID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE" json:",omitempty"` Hobbies []Hobby `gorm:"many2many:user_hobbies" json:",omitempty"` }
User model - `users` table
Click to show internal directories.
Click to hide internal directories.