Skip to content

Instantly share code, notes, and snippets.

@axel-andrade
Last active October 13, 2021 22:28
Show Gist options
  • Save axel-andrade/23a28d28ad692a3baf1d1c3480bd1b04 to your computer and use it in GitHub Desktop.
Save axel-andrade/23a28d28ad692a3baf1d1c3480bd1b04 to your computer and use it in GitHub Desktop.
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