Documentation
¶
Index ¶
- Constants
- type QuestionRepository
- func (qr QuestionRepository) Delete(ctx context.Context, ID, loggedInUserID string) error
- func (qr QuestionRepository) Get(ctx context.Context, ID string) (QuestionWithRating, error)
- func (qr QuestionRepository) GetAll(ctx context.Context, sort string, limit, offset int) ([]QuestionWithRating, int64, error)
- func (qr QuestionRepository) GetCurrentUsers(ctx context.Context, ID, loggedInUserID string) (models.Question, error)
- func (qr QuestionRepository) Insert(ctx context.Context, q models.Question) (models.Question, error)
- func (qr QuestionRepository) Update(ctx context.Context, q models.Question) (models.Question, error)
- type QuestionWithRating
Constants ¶
View Source
const ( StatusPublished = "Published" StatusArchived = "Archived" StatusDeleted = "Deleted" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type QuestionRepository ¶
type QuestionRepository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *sql.DB) QuestionRepository
func (QuestionRepository) Delete ¶
func (qr QuestionRepository) Delete(ctx context.Context, ID, loggedInUserID string) error
func (QuestionRepository) Get ¶
func (qr QuestionRepository) Get(ctx context.Context, ID string) (QuestionWithRating, error)
func (QuestionRepository) GetAll ¶
func (qr QuestionRepository) GetAll(ctx context.Context, sort string, limit, offset int) ([]QuestionWithRating, int64, error)
func (QuestionRepository) GetCurrentUsers ¶
type QuestionWithRating ¶
type QuestionWithRating struct { ID string `boil:"id" json:"id"` Title string `boil:"title" json:"title"` Description string `boil:"description" json:"description"` CreatedBy string `boil:"created_by" json:"created_by"` CreatedAt null.Time `boil:"created_at" json:"created_at,omitempty"` Status null.String `boil:"status" json:"status,omitempty"` Rating int `json:"rating" boil:"rating"` }
Click to show internal directories.
Click to hide internal directories.