Documentation ¶
Index ¶
- Constants
- type Passages
- func (db *Passages) Create(ctx context.Context, passage *models.Passage) (primitive.ObjectID, error)
- func (db *Passages) Read(ctx context.Context, id primitive.ObjectID) (*models.Passage, error)
- func (db *Passages) SearchLastUserPassage(ctx context.Context, userID, testID primitive.ObjectID) (*models.Passage, error)
- func (db *Passages) SearchUserPassages(ctx context.Context, userID, testID primitive.ObjectID) ([]*models.Passage, error)
- func (db *Passages) Update(ctx context.Context, passage *models.Passage) error
- type Tasks
- func (db *Tasks) Create(ctx context.Context, task *models.Task) (primitive.ObjectID, error)
- func (db *Tasks) Read(ctx context.Context, id primitive.ObjectID) (*models.Task, error)
- func (db *Tasks) Search(ctx context.Context, complexity constants.ComplexityType, themes []string, ...) (*models.Task, error)
- type Tests
- func (db *Tests) Create(ctx context.Context, test *models.Test) (primitive.ObjectID, error)
- func (db *Tests) ReadByID(ctx context.Context, id primitive.ObjectID) (*models.Test, error)
- func (db *Tests) ReadByPath(ctx context.Context, path string) (*models.Test, error)
- func (db *Tests) Search(ctx context.Context, name string, class constants.ClassNumber, ...) ([]*models.Test, error)
- func (db *Tests) SearchCountPages(ctx context.Context, name string, class constants.ClassNumber, ...) (int64, error)
- type Users
- func (db *Users) Create(ctx context.Context, user *models.User) (primitive.ObjectID, error)
- func (db *Users) ReadByAccessToken(ctx context.Context, accessToken string) (*models.User, error)
- func (db *Users) ReadByEmail(ctx context.Context, email string) (*models.User, error)
- func (db *Users) ReadByID(ctx context.Context, id primitive.ObjectID) (*models.User, error)
- func (db *Users) ReadByRefreshToken(ctx context.Context, refreshToken string) (*models.User, error)
- func (db *Users) UpdateAccessTokenByEmail(ctx context.Context, email string, accessToken string) error
- func (db *Users) UpdateAccessTokenByID(ctx context.Context, id primitive.ObjectID, accessToken string) error
- func (db *Users) UpdateTokensByEmail(ctx context.Context, email string, tokens *models.UserTokens) error
- func (db *Users) UpdateTokensByID(ctx context.Context, id primitive.ObjectID, tokens *models.UserTokens) error
Constants ¶
View Source
const LimitPerPage int64 = 20 // Количество задач на страницу
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Passages ¶
type Passages struct {
// contains filtered or unexported fields
}
func NewPassages ¶
func (*Passages) SearchLastUserPassage ¶
func (db *Passages) SearchLastUserPassage( ctx context.Context, userID, testID primitive.ObjectID, ) (*models.Passage, error)
Поиск последнего прохождения пользователем теста.
func (*Passages) SearchUserPassages ¶
type Tasks ¶
type Tasks struct {
// contains filtered or unexported fields
}
func (*Tasks) Search ¶
func (db *Tasks) Search( ctx context.Context, complexity constants.ComplexityType, themes []string, usedIDs []primitive.ObjectID, ) (*models.Task, error)
Поиск задач по сложности и темам без уже использованных IDs. Перемешивает найденные задачи, для унификации созданных тестов.
type Tests ¶
type Tests struct {
// contains filtered or unexported fields
}
func (*Tests) ReadByPath ¶
func (*Tests) Search ¶
func (db *Tests) Search( ctx context.Context, name string, class constants.ClassNumber, complexity constants.ComplexityType, page int64, ) ([]*models.Test, error)
Поиск тестов по имени, классу, сложности и номеру страницы.
func (*Tests) SearchCountPages ¶
func (db *Tests) SearchCountPages( ctx context.Context, name string, class constants.ClassNumber, complexity constants.ComplexityType, ) (int64, error)
Количество страниц при данном имени, классе и сложности.
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
func (*Users) ReadByAccessToken ¶
func (*Users) ReadByEmail ¶
func (*Users) ReadByRefreshToken ¶
func (*Users) UpdateAccessTokenByEmail ¶
func (*Users) UpdateAccessTokenByID ¶
func (*Users) UpdateTokensByEmail ¶
func (*Users) UpdateTokensByID ¶
Click to show internal directories.
Click to hide internal directories.