Documentation ¶
Index ¶
- func Close() error
- func MakeMigration(db *sql.DB) error
- type Data
- type GameRepository
- func (gr *GameRepository) Create(ctx context.Context, game *game.Game) error
- func (gr *GameRepository) Delete(ctx context.Context, id uint) error
- func (gr *GameRepository) GetAll(ctx context.Context) ([]game.Game, error)
- func (gr *GameRepository) GetByUser(ctx context.Context, userID uint) ([]game.Game, error)
- func (gr *GameRepository) GetOne(ctx context.Context, gamename string) (game.Game, error)
- func (gr *GameRepository) Update(ctx context.Context, id uint, game game.Game) error
- type UserRepository
- func (ur *UserRepository) Create(ctx context.Context, u *user.User) error
- func (ur *UserRepository) Delete(ctx context.Context, id uint) error
- func (ur *UserRepository) GetByUsername(ctx context.Context, username string) (user.User, error)
- func (ur *UserRepository) Update(ctx context.Context, id uint, u user.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeMigration ¶
MakeMigration creates all the tables in the database
Types ¶
type GameRepository ¶
type GameRepository struct {
Data *Data
}
GameRepository manages the operations with the database that correspond to the game model.
func (*GameRepository) Delete ¶
func (gr *GameRepository) Delete(ctx context.Context, id uint) error
Delete removes a game by id.
type UserRepository ¶
type UserRepository struct {
Data *Data
}
UserRepository manages the operations with the database that correspond to the user model.
func (*UserRepository) Delete ¶
func (ur *UserRepository) Delete(ctx context.Context, id uint) error
Delete removes a user by id.
func (*UserRepository) GetByUsername ¶
GetByUsername returns one user by username.
Click to show internal directories.
Click to hide internal directories.