domain

package
v0.0.0-...-70f22cf Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comparator

type Comparator interface {
	Compare(vocabulary *Vocabulary, msg string) bool
}

type Masker

type Masker interface {
	Mask(vocabulary *Vocabulary) string
}

type Mode

type Mode struct {
	Id     int    `sql:"mode_id,pk"`
	Marker string `sql:"name"`
}

type Name

type Name string
const (
	IrregularMode Name = `irregularMode`
	TopicMode     Name = `topicMode`
)

type Task

type Task struct {
	Id           int64       `sql:"task_id,pk"`
	VocabularyId int64       `sql:"vocabulary_id"`
	PeerId       int64       `sql:"peer_id"`
	Datetime     time.Time   `sql:"datetime"`
	Time         int64       `sql:"time"`
	IsCorrect    bool        `sql:"is_correct"`
	Vocabulary   *Vocabulary `pg:"rel:belongs-to"`
}

func (*Task) GetId

func (v *Task) GetId() string

type TaskProgress

type TaskProgress struct {
	TotalAverage  float32
	TotalAttempts int
}

type TaskProgressRepository

type TaskProgressRepository interface {
	GetProgress(topicId int64, peerId int64) (success int, attempts int, err error)
	GetAverage(peerId int64) (TaskProgress, error)
}

type TaskRepository

type TaskRepository interface {
	Create(vocabulary Vocabulary, peerId int64) (*Task, error)
	GetById(taskId int64) (Task, error)
	GetLast(peerId int64) (Task, error)
	Answer(task Task) error
	GetTodayTasks(topicId int64, peerId int) (int, error)
	DeleteLast(peerId int64) error
}

type Topic

type Topic struct {
	TopicId int64  `sql:"topic_id,pk"`
	Title   string `sql:"title"`
	ModeId  int    `sql:"mode_id"`
	Tmpl    string `sql:"tmpl"`
	Mode    *Mode  `pg:"rel:belongs-to"`
}

type TopicRepository

type TopicRepository interface {
	GetList(name Name) ([]Topic, error)
}

type Vocabulary

type Vocabulary struct {
	Id         int64  `sql:"vocabulary_id,pk"`
	Attachment string `sql:"attachment"`
	Views      int64  `sql:"views"`
	Answer     string `sql:"answer"`
	Example    string `sql:"example"`
	Question   string `sql:"question"`
	TopicId    int64  `sql:"topic_id"`
	Topic      *Topic `pg:"rel:belongs-to"`
}

func (*Vocabulary) GetId

func (v *Vocabulary) GetId() string

type VocabularyRepository

type VocabularyRepository interface {
	FindActual(topicId int64, peerId int64, date time.Time) (Vocabulary, error)
	IncrViews(Vocabulary)
	GetTotal(topicId int64) (int, error)
}

Jump to

Keyboard shortcuts

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