Documentation ¶
Index ¶
- type DB
- type ProblemService
- func (s *ProblemService) Create(ctx context.Context, problem *models.Problem) (*models.Problem, error)
- func (s *ProblemService) GetAll(ctx context.Context) ([]*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)
- type UserService
- func (s *UserService) Create(ctx context.Context, username, email, password string) error
- func (s *UserService) ExistsByEmail(ctx context.Context, email string) (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) UserService ¶
func (db *DB) UserService(conn *sqlx.DB) services.UserService
type ProblemService ¶
type ProblemService struct {
// contains filtered or unexported fields
}
ProblemService implements services.ProblemService
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
UserService implements services.UserService
func NewUserService ¶
func NewUserService(db *sqlx.DB) *UserService
func (*UserService) Create ¶
func (s *UserService) Create(ctx context.Context, username, email, password string) error
func (*UserService) ExistsByEmail ¶
func (*UserService) ExistsByUsername ¶
func (*UserService) GetByEmail ¶
func (*UserService) GetByUsername ¶
Click to show internal directories.
Click to hide internal directories.