passage

package
v0.0.0-...-34ab1a3 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAccessTokenNotExist     = errors.New("access token not exist")    // Access токен не существует
	ErrTestPathNotExist        = errors.New("test path not exist")       // Пути теста не существует
	ErrAlreadyStart            = errors.New("already start")             // Есть незаконченный тест
	ErrDisposable              = errors.New("disposable")                // Тест нельзя перепроходить
	ErrTimeToRepeat            = errors.New("time to repeat")            // Не прошло время до повторного прохождения
	ErrIncorrectlyCompiledTest = errors.New("incorrectly compiled test") // Неправильно составлен тест
	ErrPassageIDNotExist       = errors.New("passage id not exist")      // Прохождение не существует
	ErrIncorrectPassageUser    = errors.New("incorrect passage user")    // Неверный пользователь
	ErrAlreadyEnd              = errors.New("already end")               // Прохождение завершено
	ErrNotActualTaskNum        = errors.New("not actual task num")       // Не актуальный номер задачи
)

Functions

This section is empty.

Types

type DBPassages

type DBPassages interface {
	Create(ctx context.Context, passage *models.Passage) (primitive.ObjectID, error)
	Read(ctx context.Context, id primitive.ObjectID) (*models.Passage, error)
	SearchLastUserPassage(ctx context.Context, userID, testID primitive.ObjectID) (*models.Passage, error)
	Update(ctx context.Context, passage *models.Passage) error
}

type DBTasks

type DBTasks interface {
	Read(ctx context.Context, id primitive.ObjectID) (*models.Task, error)
	Search(
		ctx context.Context, complexity constants.ComplexityType, themes []string, usedIDs []primitive.ObjectID,
	) (*models.Task, error)
}

type DBTests

type DBTests interface {
	ReadByPath(ctx context.Context, path string) (*models.Test, error)
}

type DBUsers

type DBUsers interface {
	ReadByAccessToken(ctx context.Context, accessToken string) (*models.User, error)
}

type ErrorDefault

type ErrorDefault struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(dbUsers DBUsers, dbTests DBTests, dbTasks DBTasks, dbPassages DBPassages) *Service

func (*Service) Create

func (s *Service) Create(c *gin.Context)

func (*Service) End

func (s *Service) End(c *gin.Context)

func (*Service) Read

func (s *Service) Read(c *gin.Context)

func (*Service) Update

func (s *Service) Update(c *gin.Context)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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