repo

package
v0.0.0-...-604f4fc Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	Quizes            []Quiz
	SequenceGenerator int
}

type Question

type Question struct {
	Prompt       string   `yaml:"prompt"`
	Answer       string   `yaml:"anser"`
	WrongAnswers []string `yaml:"wrong_answers"`
}

type Quiz

type Quiz struct {
	ID        int        `yaml:"id"`
	Name      string     `yaml:"string"`
	Questions []Question `yaml:"questions"`
}

type YamlRepo

type YamlRepo struct{}

func (*YamlRepo) Create

func (y *YamlRepo) Create(quiz *quiz.Quiz) (int, error)

Create implements quiz.QuizRepo.

func (*YamlRepo) Delete

func (y *YamlRepo) Delete(quizID int) (*quiz.Quiz, error)

Delete implements quiz.QuizRepo.

func (*YamlRepo) GetAll

func (y *YamlRepo) GetAll() ([]quiz.Quiz, error)

GetAll implements quiz.QuizRepo.

func (*YamlRepo) GetByID

func (y *YamlRepo) GetByID(quizID int) (*quiz.Quiz, error)

GetByID implements quiz.QuizRepo.

func (*YamlRepo) Update

func (y *YamlRepo) Update(quiz *quiz.Quiz) error

Update implements quiz.QuizRepo.

Jump to

Keyboard shortcuts

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