Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Post ¶
type Post struct {
gorm.Model
Title string `gorm:"type:varchar(100);unique;not null"`
Content string `gorm:'type:text;`
Tags []*Tag `gorm:"many2many:post_tag"`
}
func (*Post) DeletePost ¶
func (*Post) UpdatePost ¶
type Tag ¶
type Tag struct {
gorm.Model
Name string `gorm:"type:varchar(100);unique;not null"`
Posts []*Post `gorm:"many2many:post_tag"`
}
func CreateTagByName ¶
func GenerateTag ¶
func GetTagByName ¶
Click to show internal directories.
Click to hide internal directories.