Documentation ¶
Index ¶
- type AddFavoritesUseCase
- type AuthenticationJwtUseCase
- type CreateUserUsecase
- type DeleteFavoriteUseCase
- type DeleteUserByIDUseCase
- type FindFavoritesByUserIDUseCase
- type FindUserByEmailUsecase
- type FindUserByIDUseCase
- type ListAllUsersUsecase
- type UpdateUserByIDUseCase
- type UpdateUserPointsByUserIdUseCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddFavoritesUseCase ¶
type AddFavoritesUseCase struct { UsersGateway gateway.UsersGateway PlacesGateway gateway.PlacesGateway }
func NewAddFavoritesUseCase ¶
func NewAddFavoritesUseCase(usersGateway gateway.UsersGateway) *AddFavoritesUseCase
func (*AddFavoritesUseCase) Execute ¶
func (uc *AddFavoritesUseCase) Execute(ctx context.Context, input dto.AddFavoritesInputDTO) error
type AuthenticationJwtUseCase ¶
type AuthenticationJwtUseCase struct { UsersGateway gateway.UsersGateway JwtSecretKey string }
func NewAuthenticationJwtUseCase ¶
func NewAuthenticationJwtUseCase(usersGateway gateway.UsersGateway, jwtSecretKey string) *AuthenticationJwtUseCase
func (*AuthenticationJwtUseCase) Execute ¶
func (uc *AuthenticationJwtUseCase) Execute(ctx context.Context, input dto.AuthenticateJwtUserInputDTO) (*dto.AuthenticateJwtUserOutputDTO, error)
Execute authenticates the user with the provided credentials and generates a JWT token.
ctx - The context in which the function is executed. input - The input data transfer object containing user credentials. Returns an output data transfer object containing a JWT token and/or an error in case of failure.
type CreateUserUsecase ¶
type CreateUserUsecase struct {
UsersGateway gateway.UsersGateway
}
func NewCreateUserUseCase ¶
func NewCreateUserUseCase(usersGateway gateway.UsersGateway) *CreateUserUsecase
func (*CreateUserUsecase) Execute ¶
func (uc *CreateUserUsecase) Execute(ctx context.Context, input dto.CreateUserInputDTO) error
Execute creates a new user in the database using the CreateUser method of the UsersGateway struct.
ctx is the context of the request. input is a CreateUserInputDTO struct containing the information of the user to be created. error is returned if there are any issues creating the user.
type DeleteFavoriteUseCase ¶
type DeleteFavoriteUseCase struct {
UsersGateway gateway.UsersGateway
}
func NewDeleteFavoriteUseCase ¶
func NewDeleteFavoriteUseCase(usersGateway gateway.UsersGateway) *DeleteFavoriteUseCase
func (*DeleteFavoriteUseCase) Execute ¶
func (uc *DeleteFavoriteUseCase) Execute(ctx context.Context, input dto.DeleteFavoriteByUserIdAndPlaceIdInputDTO) error
type DeleteUserByIDUseCase ¶
type DeleteUserByIDUseCase struct {
UsersGateway gateway.UsersGateway
}
func NewDeleteUserByIDUseCase ¶
func NewDeleteUserByIDUseCase(usersGateway gateway.UsersGateway) *DeleteUserByIDUseCase
func (*DeleteUserByIDUseCase) Execute ¶
func (uc *DeleteUserByIDUseCase) Execute(ctx context.Context, input dto.DeleteUserByIdInputDTO) error
type FindFavoritesByUserIDUseCase ¶
type FindFavoritesByUserIDUseCase struct {
UsersGateway gateway.UsersGateway
}
func NewFindFavoritesByUserIDUseCase ¶
func NewFindFavoritesByUserIDUseCase(usersGateway gateway.UsersGateway) *FindFavoritesByUserIDUseCase
func (*FindFavoritesByUserIDUseCase) Execute ¶
func (uc *FindFavoritesByUserIDUseCase) Execute(ctx context.Context, input dto.FindFavoritesByUserIdInputDTO) ([]*dto.FindFavoritesByUserIdOutputDTO, error)
type FindUserByEmailUsecase ¶
type FindUserByEmailUsecase struct {
UsersGateway gateway.UsersGateway
}
func NewFindUserByEmailUsecase ¶
func NewFindUserByEmailUsecase(usersGateway gateway.UsersGateway) *FindUserByEmailUsecase
func (*FindUserByEmailUsecase) Execute ¶
func (uc *FindUserByEmailUsecase) Execute(ctx context.Context, email string) (*dto.FindUserByEmailOutputDTO, error)
Execute retrieves a user by email.
ctx is the context of the request. email is the email of the user to retrieve. Returns a pointer to a User and an error if any occurred.
type FindUserByIDUseCase ¶
type FindUserByIDUseCase struct {
UsersGateway gateway.UsersGateway
}
func NewFindUserByIdUseCase ¶
func NewFindUserByIdUseCase(usersGateway gateway.UsersGateway) *FindUserByIDUseCase
func (*FindUserByIDUseCase) Execute ¶
func (uc *FindUserByIDUseCase) Execute(ctx context.Context, id string) (*dto.FindUserByIDOutputDTO, error)
type ListAllUsersUsecase ¶
type ListAllUsersUsecase struct {
UsersGateway gateway.UsersGateway
}
func NewListAllUsersUsecase ¶
func NewListAllUsersUsecase(usersGateway gateway.UsersGateway) *ListAllUsersUsecase
func (*ListAllUsersUsecase) Execute ¶
func (uc *ListAllUsersUsecase) Execute(ctx context.Context) ([]*dto.ListAllUsersOutputDTO, error)
type UpdateUserByIDUseCase ¶
type UpdateUserByIDUseCase struct {
UsersGateway gateway.UsersGateway
}
func NewUpdateUserUseCase ¶
func NewUpdateUserUseCase(usersGateway gateway.UsersGateway) *UpdateUserByIDUseCase
func (*UpdateUserByIDUseCase) Execute ¶
func (uc *UpdateUserByIDUseCase) Execute(ctx context.Context, input dto.UpdateUserInputDTO) error
Execute updates the user with the given ID according to the provided user data.
ctx is the context that the function executes under. input is the input data for updating the user. Returns an error if the update operation fails.
type UpdateUserPointsByUserIdUseCase ¶
type UpdateUserPointsByUserIdUseCase struct {
UsersGateway gateway.UsersGateway
}
func NewUpdateUserPointsByUserIDUseCase ¶
func NewUpdateUserPointsByUserIDUseCase(usersGateway gateway.UsersGateway) *UpdateUserPointsByUserIdUseCase
func (*UpdateUserPointsByUserIdUseCase) Execute ¶
func (uc *UpdateUserPointsByUserIdUseCase) Execute(ctx context.Context, input dto.UpdateUserPointsByUserIDInputDTO) error