package models
// Tag models
type Tag struct {
Name string `gorm:"primaryKey"`
Type TagType `gorm:"column:tag_type"`
Aliases []TagAlias `gorm:"foreignKey:TagID"`
Groups []TagGroup `gorm:"foreignKey:TagID"`
Posts []Post `gorm:"many2many:post_tags;"`
}
func (Tag) TableName() string {
return "Tag"
// TagAlias model
type TagAlias struct {
TagID string
func (TagAlias) TableName() string {
return "TagAlias"
// TagGroup model
type TagGroup struct {
func (TagGroup) TableName() string {
return "TagGroup"
type TagsWithFrequency struct {
Frequency int64 `json:"frequency"`
Tags Tag `json:"tags"`