Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comment ¶
type Comment struct { ID uint `gorm:"primaryKey,autoincrement" json:"id"` Author User `gorm:"foreignKey:AuthorID" json:"author"` AuthorID uint `json:"-"` TopicID uint `json:"topic_id"` Content string `json:"content"` CreatedAt time.Time `json:"created_at"` ParentComment *Comment `gorm:"foreignKey:ParentCommentId" json:"parent_comment"` ParentCommentId uint `json:"parent_comment_id"` Votes int `json:"votes"` }
type Topic ¶
type Topic struct { ID uint `gorm:"primaryKey" json:"id"` AuthorID uint `json:"-"` Author User `json:"author"` Title string `json:"title"` Body string `json:"body"` CreatedAt time.Time `json:"createdAt"` Likes uint `gorm:"-" json:"likes"` Liked bool `gorm:"-" json:"liked"` TopicActions []Action `gorm:"many2many:topic_actions;" json:"-"` Comments []Comment `gorm:"foreignKey:TopicID" json:"comments,omitempty"` CommentsCount uint `gorm:"-" json:"commentsCount"` }
type TopicAction ¶
type User ¶
type User struct { ID uint `gorm:"primaryKey,autoIncrement" json:"id"` Username string `gorm:"index" json:"username"` GivenName string `json:"givenName"` LastName string `json:"lastName"` Admin bool `gorm:"index" json:"admin"` CreatedAt time.Time `json:"createdAt"` LastLogin time.Time `json:"-"` Deleted bool `gorm:"index" json:"-"` UserDetails UserDetails `gorm:"foreignKey:ID" json:"details,omitempty"` }
type UserDetails ¶
Click to show internal directories.
Click to hide internal directories.