Documentation
¶
Index ¶
- type DB
- func (db *DB) ProblemService(logger *log.Logger) services.ProblemService
- func (db *DB) RunMigrations(logger *log.Logger)
- func (db *DB) SubmissionService(logger *log.Logger) services.SubmissionService
- func (db *DB) SubmissionTestService(logger *log.Logger) services.SubmissionTestService
- func (db *DB) TestService(logger *log.Logger) services.TestService
- func (db *DB) UserService(logger *log.Logger) services.UserService
- type ProblemService
- func (s *ProblemService) Create(ctx context.Context, problem *models.Problem, authorId int) error
- func (s *ProblemService) Delete(ctx context.Context, id int) error
- func (s *ProblemService) ExistsById(ctx context.Context, id int) (bool, error)
- func (s *ProblemService) ExistsByName(ctx context.Context, name string) (bool, error)
- func (s *ProblemService) GetAll(ctx context.Context) ([]*models.Problem, error)
- func (s *ProblemService) GetByFilter(ctx context.Context, filter *models.ProblemFilter) ([]*models.Problem, error)
- func (s *ProblemService) GetById(ctx context.Context, id int) (*models.Problem, error)
- func (s *ProblemService) GetByName(ctx context.Context, name string) (*models.Problem, error)
- func (s *ProblemService) Update(ctx context.Context, id int, updateRequest *models.UpdateProblemRequest) error
- type SubmissionService
- func (s *SubmissionService) Create(ctx context.Context, submission *models.Submission) error
- func (s *SubmissionService) Delete(ctx context.Context, id int) error
- func (s *SubmissionService) GetAll(ctx context.Context) ([]*models.Submission, error)
- func (s *SubmissionService) GetByFilter(ctx context.Context, filter *models.SubmissionFilter) ([]*models.Submission, error)
- func (s *SubmissionService) GetById(ctx context.Context, id int) (*models.Submission, error)
- func (s *SubmissionService) GetByUserName(ctx context.Context, userId int) ([]*models.Submission, error)
- func (s *SubmissionService) Update(ctx context.Context, id int, updateRequest *models.UpdateSubmissionRequest) error
- type SubmissionTestService
- func (s *SubmissionTestService) Create(ctx context.Context, tst *models.SubmissionTest) error
- func (s *SubmissionTestService) GetById(ctx context.Context, id uint64) (*models.SubmissionTest, error)
- func (s *SubmissionTestService) GetBySubmissionId(ctx context.Context, submissionId uint64) ([]*models.SubmissionTest, error)
- func (s *SubmissionTestService) Update(ctx context.Context, submissionId, testId uint64, ...) error
- type TestService
- func (s *TestService) Create(ctx context.Context, test *models.Test) error
- func (s *TestService) Delete(ctx context.Context, testId, problemId int) error
- func (s *TestService) DeleteAllProblemTests(ctx context.Context, problemId int) error
- func (s *TestService) GetAllProblemTests(ctx context.Context, problemId int) ([]*models.Test, error)
- func (s *TestService) GetAllTests(ctx context.Context) ([]*models.Test, error)
- func (s *TestService) GetById(ctx context.Context, id int) (*models.Test, error)
- func (s *TestService) Update(ctx context.Context, testId, problemId int, test *models.Test) error
- type UserService
- func (s *UserService) Create(ctx context.Context, user *models.User) error
- func (s *UserService) ExistsByEmail(ctx context.Context, email string) (bool, error)
- func (s *UserService) ExistsById(ctx context.Context, id int) (bool, error)
- func (s *UserService) ExistsByUsername(ctx context.Context, username string) (bool, error)
- func (s *UserService) GetAll(ctx context.Context) ([]*models.User, error)
- func (s *UserService) GetByEmail(ctx context.Context, email string) (*models.User, error)
- func (s *UserService) GetById(ctx context.Context, id int) (*models.User, error)
- func (s *UserService) GetByUsername(ctx context.Context, username string) (*models.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
func DefaultDatabase ¶
DefaultDatabase returns an instance of a psql database
func (*DB) ProblemService ¶
func (db *DB) ProblemService(logger *log.Logger) services.ProblemService
func (*DB) RunMigrations ¶
RunMigrations creates the database schema for the database
func (*DB) SubmissionService ¶
func (db *DB) SubmissionService(logger *log.Logger) services.SubmissionService
func (*DB) SubmissionTestService ¶
func (db *DB) SubmissionTestService(logger *log.Logger) services.SubmissionTestService
func (*DB) TestService ¶
func (db *DB) TestService(logger *log.Logger) services.TestService
func (*DB) UserService ¶
func (db *DB) UserService(logger *log.Logger) services.UserService
type ProblemService ¶
type ProblemService struct {
// contains filtered or unexported fields
}
ProblemService implements services.ProblemService
func NewProblemService ¶
func NewProblemService(db *sqlx.DB, logger *log.Logger) *ProblemService
func (*ProblemService) ExistsById ¶
func (*ProblemService) ExistsByName ¶
func (*ProblemService) GetByFilter ¶
func (s *ProblemService) GetByFilter(ctx context.Context, filter *models.ProblemFilter) ([]*models.Problem, error)
func (*ProblemService) Update ¶
func (s *ProblemService) Update(ctx context.Context, id int, updateRequest *models.UpdateProblemRequest) error
type SubmissionService ¶
type SubmissionService struct {
// contains filtered or unexported fields
}
SubmissionService implements services.SubmissionService
func NewSubmissionService ¶
func NewSubmissionService(db *sqlx.DB, logger *log.Logger) *SubmissionService
func (*SubmissionService) Create ¶
func (s *SubmissionService) Create(ctx context.Context, submission *models.Submission) error
func (*SubmissionService) Delete ¶
func (s *SubmissionService) Delete(ctx context.Context, id int) error
func (*SubmissionService) GetAll ¶
func (s *SubmissionService) GetAll(ctx context.Context) ([]*models.Submission, error)
func (*SubmissionService) GetByFilter ¶
func (s *SubmissionService) GetByFilter(ctx context.Context, filter *models.SubmissionFilter) ([]*models.Submission, error)
func (*SubmissionService) GetById ¶
func (s *SubmissionService) GetById(ctx context.Context, id int) (*models.Submission, error)
func (*SubmissionService) GetByUserName ¶
func (s *SubmissionService) GetByUserName(ctx context.Context, userId int) ([]*models.Submission, error)
func (*SubmissionService) Update ¶
func (s *SubmissionService) Update(ctx context.Context, id int, updateRequest *models.UpdateSubmissionRequest) error
type SubmissionTestService ¶
type SubmissionTestService struct {
// contains filtered or unexported fields
}
func NewSubmissionTestService ¶
func NewSubmissionTestService(db *sqlx.DB, logger *log.Logger) *SubmissionTestService
func (*SubmissionTestService) Create ¶
func (s *SubmissionTestService) Create(ctx context.Context, tst *models.SubmissionTest) error
func (*SubmissionTestService) GetById ¶
func (s *SubmissionTestService) GetById(ctx context.Context, id uint64) (*models.SubmissionTest, error)
func (*SubmissionTestService) GetBySubmissionId ¶
func (s *SubmissionTestService) GetBySubmissionId(ctx context.Context, submissionId uint64) ([]*models.SubmissionTest, error)
func (*SubmissionTestService) Update ¶
func (s *SubmissionTestService) Update(ctx context.Context, submissionId, testId uint64, update *models.UpdateSubmissionTestRequest) error
type TestService ¶
type TestService struct {
// contains filtered or unexported fields
}
TestService implements services.TestService
func NewTestService ¶
func NewTestService(db *sqlx.DB, logger *log.Logger) *TestService
func (*TestService) Delete ¶
func (s *TestService) Delete(ctx context.Context, testId, problemId int) error
func (*TestService) DeleteAllProblemTests ¶
func (s *TestService) DeleteAllProblemTests(ctx context.Context, problemId int) error
func (*TestService) GetAllProblemTests ¶
func (*TestService) GetAllTests ¶
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
UserService implements services.UserService
func NewUserService ¶
func NewUserService(db *sqlx.DB, logger *log.Logger) *UserService
func (*UserService) ExistsByEmail ¶
func (*UserService) ExistsById ¶
func (*UserService) ExistsByUsername ¶
func (*UserService) GetByEmail ¶
func (*UserService) GetByUsername ¶
Click to show internal directories.
Click to hide internal directories.