Last active
October 13, 2021 22:28
-
-
Save axel-andrade/23a28d28ad692a3baf1d1c3480bd1b04 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package login | |
import ( | |
"go_clean_api/api/entities" | |
"go_clean_api/api/usecases/common" | |
) | |
type LoginGateway interface { | |
CreateAuth(userid entities.UniqueEntityID, td *entities.TokenDetails) error | |
CompareHashAndPassword(hash string, p string) error | |
FindUserByEmail(email string) (*entities.User, error) | |
GenerateToken(userid entities.UniqueEntityID) (*entities.TokenDetails, error) | |
} | |
type LoginInputDTO struct { | |
Email string `json:"email"` | |
Password string `json:"password"` | |
} | |
type LoginOutputDTO struct { | |
User entities.User `json:"user"` | |
AccessToken string `json:"access_token"` | |
RefreshToken string `json:"refresh_token"` | |
} | |
type LoginPresenter interface { | |
Show(out *LoginOutputDTO, err error) common.OutputPort | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment