Documentation ¶
Index ¶
- type Answer
- type Comment
- type Question
- type Quora
- func (q *Quora) AnswerQuestion(userID, questionID uint, body string) (*Answer, error)
- func (q *Quora) AskQuestion(userID uint, title, body string) (*Question, error)
- func (q *Quora) CommentOnQuestion(userID, questionID uint, body string) (*Comment, error)
- func (q *Quora) DownvoteQuestion(userID, questionID uint) error
- func (q *Quora) SearchQuestions(keyword string) ([]Question, error)
- func (q *Quora) UpvoteQuestion(userID, questionID uint) error
- type Topic
- type User
- type Vote
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Answer ¶
type Answer struct { ID uint `gorm:"primary_key"` Body string UserID uint QuestionID uint Timestamp time.Time Votes []Vote Comments []Comment }
Answer struct to hold answer data
type Comment ¶
type Comment struct { ID uint `gorm:"primary_key"` Body string UserID uint QuestionID uint AnswerID uint Timestamp time.Time }
Comment struct to hold comment data
type Question ¶
type Question struct { ID uint `gorm:"primary_key"` Title string Body string UserID uint Timestamp time.Time Answers []Answer Votes []Vote Comments []Comment }
Question struct to hold question data
type Quora ¶
Quora struct to hold the database connection
func (*Quora) AnswerQuestion ¶
AnswerQuestion adds a new answer to a question
func (*Quora) AskQuestion ¶
AskQuestion adds a new question to the platform
func (*Quora) CommentOnQuestion ¶
CommentOnQuestion adds a comment on a question
func (*Quora) DownvoteQuestion ¶
DownvoteQuestion downvotes a question
func (*Quora) SearchQuestions ¶
SearchQuestions searches for questions by keyword
func (*Quora) UpvoteQuestion ¶
UpvoteQuestion upvotes a question
type Topic ¶
type Topic struct { ID uint `gorm:"primary_key"` Name string Description string Questions []Question }
Topic struct to hold topic data
Click to show internal directories.
Click to hide internal directories.