Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Answer ¶
type Answer struct { gorm.Model Body string `gorm:"type:text;not null" json:"body"` Likes Likes `gorm:"foreignkey:LikesID" json:"likes"` LikesID int `json:"-"` Comments []*Comment `gorm:"many2many:answer_comments" json:"comments"` Author *User `gorm:"foreignkey:AuthorID" json:"author"` AuthorID int `json:"-"` Question *Question `gorm:"foreignkey:QuestionID" json:"question"` QuestionID int `json:"-"` }
type AnswerInfo ¶
type Comment ¶
type Comment struct { gorm.Model Body string `gorm:"type:text;not null" json:"body"` Likes Likes `gorm:"foreignkey:LikesID" json:"likes"` LikesID int `json:"-"` Replies []*Comment `gorm:"many2many:comment_replies" json:"replies"` Author *User `gorm:"foreignkey:AuthorID" json:"author"` AuthorID int `json:"author_id"` }
type Question ¶
type Question struct { gorm.Model Title string `gorm:"type:varchar(255);not null" json:"title" binding:"required"` Body string `gorm:"type:text;not null" json:"body" binding:"required"` Likes Likes `gorm:"foreignkey:LikesID" json:"likes"` LikesID int `json:"-"` Answers []*Answer `gorm:"many2many:question_answers" json:"answers"` Comments []*Comment `gorm:"many2many:question_comments" json:"comments"` Author *User `gorm:"foreignkey:AuthorID" json:"author"` AuthorID int `json:"-"` }
type QuestionsQuery ¶
type User ¶
type User struct { gorm.Model Username string `gorm:"type:varchar(255);not null;unique" json:"username"` Email string `gorm:"type:varchar(255);not null;unique" json:"-"` Password string `gorm:"type:varchar(255);not null" json:"-"` Questions []*Question `gorm:"many2many:user_questions" json:"questions"` }
Click to show internal directories.
Click to hide internal directories.