Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidRecord = errors.New("invalid answer record")
View Source
var Module = fx.Module( "answer", fx.Provide(fx.Private, NewRepository), fx.Provide(NewService), )
Functions ¶
func OrderByCreatedAtDesc ¶
Types ¶
type Answer ¶
Answer represents the choice selected by a user for a question.
type LogItem ¶
LogItem represents a previous attempt at answering a question.
func (LogItem) IsSuccessful ¶
IsSuccessful returns whether the answer was correct or not.
type LogRequest ¶
type LogRequest struct { UserID uuid.UUID Pagination pagination.Pagination }
LogRequest has the parameters for retrieving a user's history of answers.
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *sql.DB) *Repository
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents the service that manages answers.
func NewService ¶
func NewService(repo *Repository, questionService *question.Service) *Service
NewService creates a new instance of answer.Service.
Click to show internal directories.
Click to hide internal directories.