Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Post ¶
type Post struct { ID uint `gorm:"primaryKey" json:"id"` Title string `gorm:"type:string" json:"title"` Description string `gorm:"type:string" json:"description"` UserID uint `json:"user_id"` CreatedAt time.Time `gorm:"autoUpdateTime:milli" json:"created_at"` UpdatedAt time.Time `gorm:"autoUpdateTime:milli" json:"updated_at"` DeletedAt gorm.DeletedAt `json:"-"` }
type User ¶
type User struct { // gorm.Model /* this is the default form of declaration */ ID uint `gorm:"primaryKey;unique" json:"id"` Name string `gorm:"type:string;not null" json:"name"` Email string `gorm:"type:string;not null;unique;primaryKey" json:"email"` HashPassword string `gorm:"type:string;not null" json:"-"` CreatedAt time.Time `gorm:"autoUpdateTime:milli" json:"created_at"` UpdatedAt time.Time `gorm:"autoUpdateTime:milli" json:"updated_at"` DeletedAt gorm.DeletedAt `json:"-"` Posts []Post `gorm:"foreignKey:UserID" json:"posts"` }
Click to show internal directories.
Click to hide internal directories.