persist

package
v0.0.0-...-3a56a5c Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sql.DB

DB lint

Functions

func AnswerQuestion

func AnswerQuestion(questionId int, answerIndex int, sessionId string) error

func CorrectCountForSessionId

func CorrectCountForSessionId(sessionId string) (int, error)

func FindWinners

func FindWinners(topN int) ([]string, error)

Types

type Answer

type Answer struct {
	Id          int
	Body        string
	QuestionId  int
	AnswerIndex int
}

func GetAnswersForQuestion

func GetAnswersForQuestion(question Question) ([]Answer, error)

type Question

type Question struct {
	Id           int
	Body         string
	Number       int
	Info         string
	CorrectIndex int
}

func GetAllQuestions

func GetAllQuestions() ([]Question, error)

func GetQuestion

func GetQuestion(number int) (*Question, error)

Jump to

Keyboard shortcuts

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