usecase

package
v0.0.0-...-51e95d8 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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

type AuthenticationJwtUseCase

type AuthenticationJwtUseCase struct {
	UsersGateway gateway.UsersGateway
	JwtSecretKey string
}

func NewAuthenticationJwtUseCase

func NewAuthenticationJwtUseCase(usersGateway gateway.UsersGateway, jwtSecretKey string) *AuthenticationJwtUseCase

func (*AuthenticationJwtUseCase) Execute

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

type DeleteUserByIDUseCase

type DeleteUserByIDUseCase struct {
	UsersGateway gateway.UsersGateway
}

func NewDeleteUserByIDUseCase

func NewDeleteUserByIDUseCase(usersGateway gateway.UsersGateway) *DeleteUserByIDUseCase

func (*DeleteUserByIDUseCase) Execute

type FindFavoritesByUserIDUseCase

type FindFavoritesByUserIDUseCase struct {
	UsersGateway gateway.UsersGateway
}

func NewFindFavoritesByUserIDUseCase

func NewFindFavoritesByUserIDUseCase(usersGateway gateway.UsersGateway) *FindFavoritesByUserIDUseCase

func (*FindFavoritesByUserIDUseCase) Execute

type FindUserByEmailUsecase

type FindUserByEmailUsecase struct {
	UsersGateway gateway.UsersGateway
}

func NewFindUserByEmailUsecase

func NewFindUserByEmailUsecase(usersGateway gateway.UsersGateway) *FindUserByEmailUsecase

func (*FindUserByEmailUsecase) Execute

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

type ListAllUsersUsecase

type ListAllUsersUsecase struct {
	UsersGateway gateway.UsersGateway
}

func NewListAllUsersUsecase

func NewListAllUsersUsecase(usersGateway gateway.UsersGateway) *ListAllUsersUsecase

func (*ListAllUsersUsecase) Execute

type UpdateUserByIDUseCase

type UpdateUserByIDUseCase struct {
	UsersGateway gateway.UsersGateway
}

func NewUpdateUserUseCase

func NewUpdateUserUseCase(usersGateway gateway.UsersGateway) *UpdateUserByIDUseCase

func (*UpdateUserByIDUseCase) Execute

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

Jump to

Keyboard shortcuts

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