repository

package
v0.0.0-...-59b6e81 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

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 (QuestionRepository) GetAll

func (qr QuestionRepository) GetAll(ctx context.Context, sort string, limit, offset int) ([]QuestionWithRating, int64, error)

func (QuestionRepository) GetCurrentUsers

func (qr QuestionRepository) GetCurrentUsers(ctx context.Context, ID, loggedInUserID string) (models.Question, error)

func (QuestionRepository) Insert

func (QuestionRepository) Update

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL