Documentation ¶
Index ¶
- type DB
- type MongoDB
- func (mongodb *MongoDB) NewQuestion(topicId, question string, user *User) (*Question, error)
- func (mongodb *MongoDB) NewTopic(name, description string, user *User) (*Topic, error)
- func (mongodb *MongoDB) QuestionsForTopic(topicId string, user *User) ([]*Question, error)
- func (mongodb *MongoDB) TopicById(Id string) (*Topic, error)
- func (mongodb *MongoDB) TopicsByUser(user *User) ([]*Topic, error)
- func (mongodb *MongoDB) UnvoteForQuestion(questionId string, user *User) error
- func (mongodb *MongoDB) VoteForQuestion(questionId string, user *User) error
- type Question
- type Topic
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { NewTopic(name, description string, user *User) (*Topic, error) TopicById(Id string) (*Topic, error) TopicsByUser(user *User) ([]*Topic, error) QuestionsForTopic(topicId string, user *User) ([]*Question, error) NewQuestion(topicId, question string, user *User) (*Question, error) VoteForQuestion(questionId string, user *User) error UnvoteForQuestion(questionId string, user *User) error }
func NewMongoDB ¶
type MongoDB ¶
type MongoDB struct {
// contains filtered or unexported fields
}
func (*MongoDB) NewQuestion ¶
func (*MongoDB) QuestionsForTopic ¶
func (*MongoDB) UnvoteForQuestion ¶
Click to show internal directories.
Click to hide internal directories.