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
> propAlphasCorrect :: String -> Bool | |
> propAlphasCorrect xs = isCorrect (alphas xs) | |
> where | |
> isCorrect ys = all (isAlpha) ys | |
> propUppersCorrect :: String -> Bool | |
> propUppersCorrect xs = isCorrect (uppers xs) | |
> where | |
> isCorrect ys = all (isUpper) ys |
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
> alphas :: String -> String | |
> alphas xs = filter (isAlpha) xs | |
> propAlphasCorrect :: String -> Bool | |
> propAlphasCorrect xs = isCorrect (alphas xs) | |
> where | |
> isCorrect ys = all (isAlpha) ys | |
> uppers :: String -> String |
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 entities | |
import ( | |
"errors" | |
ERROR "go_clean_api/api/shared/constants/errors" | |
v "go_clean_api/api/shared/validators" | |
) | |
type UniqueEntityID = string |
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 entities | |
import ( | |
"errors" | |
ERROR "go_clean_api/api/shared/constants/errors" | |
v "go_clean_api/api/shared/validators" | |
"time" | |
) | |
type User struct { |
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 entities | |
type AccessDetails struct { | |
AccessUUID string `json:"access_uuid"` | |
UserID UniqueEntityID `json:"user_id"` | |
} |
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 entities | |
type TokenDetails struct { | |
AccessToken string `json:"access_token"` | |
RefreshToken string `json:"refresh_token"` | |
AccessUuid string `json:"access_uuid"` | |
RefreshUuid string `json:"refresh_uuid"` | |
AtExpires int64 `json:"at_expires"` | |
RtExpires int64 `json:"rt_expires"` | |
} |
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 |
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 ( | |
"fmt" | |
"go_clean_api/api/entities" | |
ERROR "go_clean_api/api/shared/constants/errors" | |
"go_clean_api/api/usecases/common" | |
) | |
type LoginInteractor struct { |
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 controllers | |
import ( | |
"go_clean_api/api/usecases/common" | |
interactor "go_clean_api/api/usecases/login" | |
) | |
type LoginController struct { | |
Interactor interactor.LoginInteractor | |
} |
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 presenters | |
import ( | |
ERROR "go_clean_api/api/shared/constants/errors" | |
"go_clean_api/api/usecases/common" | |
interactor "go_clean_api/api/usecases/login" | |
"net/http" | |
) | |
type LoginPresenter struct{} |
OlderNewer