model

package
v0.0.0-...-bc49051 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrations

func Migrations(opts ...migration.SuiteOption) *migration.Suite

Migrations returns the migration suite to bootstrap the database.

Types

type Manager

type Manager struct {
	dbutil.BaseManager
}

Manager implements database functions.

func New

func New(conn *db.Connection, opts ...db.InvocationOption) *Manager

New returns a new model manager.

func (Manager) AddQuizResult

func (m Manager) AddQuizResult(ctx context.Context, qr types.QuizResult) error

AddQuizResult creates a new quiz result.

func (Manager) AllQuizResults

func (m Manager) AllQuizResults(ctx context.Context, userID uuid.UUID) (output []types.QuizResult, err error)

AllQuizResults returns all the quiz results for a given user.

func (Manager) AllQuzzes

func (m Manager) AllQuzzes(ctx context.Context, userID uuid.UUID) (output []*types.Quiz, err error)

AllQuzzes returns all the quizzes.

func (Manager) CreateQuiz

func (m Manager) CreateQuiz(ctx context.Context, q types.Quiz) error

CreateQuiz creates a quiz.

func (Manager) GetQuiz

func (m Manager) GetQuiz(ctx context.Context, id uuid.UUID) (output types.Quiz, found bool, err error)

GetQuiz gets a quiz and associated results.

func (Manager) UpdateQuiz

func (m Manager) UpdateQuiz(ctx context.Context, q types.Quiz) error

UpdateQuiz updates a quiz.

Jump to

Keyboard shortcuts

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