repositories

package
v0.0.0-...-7184739 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnswerRepo

type AnswerRepo struct{}

AnswerRepo repo for Answer model

func (*AnswerRepo) Create

func (r *AnswerRepo) Create(answer models.Answer)

Create create a new anser

func (*AnswerRepo) Find

func (r *AnswerRepo) Find(ID int) models.Answer

Find get an answer by it's ID

func (*AnswerRepo) GetFor

func (r *AnswerRepo) GetFor(questionID int) []models.Answer

GetFor get all answers for a question

type CategoryRepo

type CategoryRepo struct{}

CategoryRepo repo for categories

func (*CategoryRepo) All

func (r *CategoryRepo) All() []models.Category

All returns all categories

type QuestionRepo

type QuestionRepo struct{}

QuestionRepo repository for Question

func (*QuestionRepo) Create

func (r *QuestionRepo) Create(question models.Question) int

Create create a new question @returns models.Question recently created

func (*QuestionRepo) Find

func (r *QuestionRepo) Find(ID int) models.Question

Find find a question by ID

func (*QuestionRepo) Get

func (r *QuestionRepo) Get(categories []int) models.Question

Get get a question randomly from entered categories

type ScoreRepo

type ScoreRepo struct{}

ScoreRepo repository for score

func (*ScoreRepo) GetStats

func (r *ScoreRepo) GetStats() []responses.Stat

GetStats get stats from database

func (*ScoreRepo) Insert

func (r *ScoreRepo) Insert(score models.Score)

Insert insert a new score

Jump to

Keyboard shortcuts

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