Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { gorm.Model Slug string `gorm:"unique_index;not null"` Title string `gorm:"not null"` Description string Body string Author User AuthorID uint Comments []Comment Favorites []User `gorm:"many2many:favorites;"` Tags []Tag `gorm:"many2many:article_tags;association_autocreate:false"` }
Article struct
type Follow ¶
type Follow struct { Follower User FollowerID uint `gorm:"primary_key" sql:"type:int not null"` Following User FollowingID uint `gorm:"primary_key" sql:"type:int not null"` }
Follow struct
type Tag ¶
type Tag struct { gorm.Model Tag string `gorm:"unique_index"` Articles []Article `gorm:"many2many:article_tags;"` }
Tag struct
type User ¶
type User struct { gorm.Model Username string `gorm:"unique_index;not null"` Email string `gorm:"unique_index;not null"` Password string `gorm:"not null"` Bio *string Image *string Followers []Follow `gorm:"foreignkey:FollowingID"` Followings []Follow `gorm:"foreignkey:FollowerID"` Favorites []Article `gorm:"many2many:favorites;"` }
User struct
func (*User) FollowedBy ¶
FollowedBy Followings should be pre loaded
Click to show internal directories.
Click to hide internal directories.