Documentation
¶
Index ¶
- type AnswerRepository
- func (ar AnswerRepository) FindAnswersCreatedBy(ctx context.Context, ownerID string) ([]AnswerWithRating, error)
- func (ar AnswerRepository) FindAnswersQuestionID(ctx context.Context, questionID string) ([]AnswerWithRating, error)
- func (ar AnswerRepository) FindMyAnswer(ctx context.Context, ownerID, id string) (*models.Answer, error)
- func (ar AnswerRepository) Insert(ctx context.Context, a models.Answer) (models.Answer, error)
- func (ar AnswerRepository) SetAnswered(ctx context.Context, ID, questionID string) (models.Answer, error)
- func (ar AnswerRepository) Update(ctx context.Context, a models.Answer) (models.Answer, error)
- type AnswerWithRating
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnswerRepository ¶
type AnswerRepository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *sql.DB) AnswerRepository
func (AnswerRepository) FindAnswersCreatedBy ¶
func (ar AnswerRepository) FindAnswersCreatedBy(ctx context.Context, ownerID string) ([]AnswerWithRating, error)
func (AnswerRepository) FindAnswersQuestionID ¶
func (ar AnswerRepository) FindAnswersQuestionID(ctx context.Context, questionID string) ([]AnswerWithRating, error)
func (AnswerRepository) FindMyAnswer ¶
func (AnswerRepository) SetAnswered ¶
type AnswerWithRating ¶
type AnswerWithRating struct { ID string `boil:"id" json:"id"` QuestionID string `boil:"question_id" json:"question_id"` CreatedBy string `boil:"created_by" json:"created_by"` Answer string `boil:"answer" json:"answer"` CreatedAt null.Time `boil:"created_at" json:"created_at,omitempty"` Answered null.Bool `boil:"answered" json:"answered,omitempty"` Rating int `boil:"rating" json:"rating"` }
Click to show internal directories.
Click to hide internal directories.