Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AnonymousUser = &User{}
Functions ¶
func HashPassword ¶
Types ¶
type Comment ¶
type Comment struct { gorm.Model Body string `gorm:"column:body;not null;"` UserID uint `gorm:"column:user_id;not null;"` User User `gorm:"foreignKey:UserID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` PostID uint `gorm:"column:post_id;not null;"` Post BlogPost `gorm:"foreignKey:PostID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` }
type Follower ¶
type Follower struct { gorm.Model UserID uint `gorm:"column:user_id;not null;"` User User `gorm:"foreignKey:UserID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` FollowerID uint `gorm:"column:follower_id;not null;"` Follower User `gorm:"foreignKey:FollowerID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` }
type User ¶
type User struct { gorm.Model Email string `gorm:"column:email;not null;index;" json:"email" validate:"required"` Name string `gorm:"column:name;size:64;not null;" json:"name" validate:"required"` Password string `gorm:"column:password;not null;" json:"-" validate:"required"` }
func (*User) IsAnonymous ¶
Click to show internal directories.
Click to hide internal directories.