Documentation ¶
Index ¶
- Variables
- func CompareHashWithPassword(password string, hash string) (match bool, err error)
- func CompareStrings(first string, second string, err error) (bool, error)
- func GenerateHashFromPassword(password string) (hash string, err error)
- func GenerateToken(c *gin.Context, player *models.Player) *models.Token
- func HasTokenExpired(token string) bool
- func ParseQueryToInt(queries ...string) ([]int, *models.ErrorParsing)
- func VerifyToken(token string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrorInternalError : ErrorInternalError = errors.New("whoops something went wrong") // ErrorPasswordMismatch : ErrorPasswordMismatch = errors.New("Password don't match") // ErrorNotYetImplemented : ErrorNotYetImplemented = errors.New("Not yet implemented") // ErrorPlayerAlreadyExist : ErrorPlayerAlreadyExist = errors.New("Player already exist") // ErrorPlayerCreationFailed : ErrorPlayerCreationFailed = errors.New("Unable to create new player") // ErrorDatabaseOperationFailed : ErrorDatabaseOperationFailed = errors.New("Database operation failed") // ErrorPlayerNotFound : ErrorPlayerNotFound = errors.New("Player not found") // ErrorEncryptionFailed : ErrorEncryptionFailed = errors.New("Encryption failed") // ErrorInvalidQuery : ErrorInvalidQuery = errors.New("Invalid query parameter") // ErrorRequestIDMismatch : ErrorRequestIDMismatch = errors.New("Request ID do not match") // ErrorPlayerUpdateFailed : ErrorPlayerUpdateFailed = errors.New("Unable to update player") // ErrorPlayerDeleteFailed : ErrorPlayerDeleteFailed = errors.New("Unable to delete player") // ErrorAuthenticationFailed : ErrorAuthenticationFailed = errors.New("Username or Password not valid") // ErrorAuthorizationTokenNotFound : ErrorAuthorizationTokenNotFound = errors.New("Player authorization not found") // ErrorAuthorizationVerificationFailed : ErrorAuthorizationVerificationFailed = errors.New("Authorization failed") )
View Source
var ( // ReasonInternalServer : ReasonInternalServer = "InternalServerError" // ReasonPasswordMismatch : ReasonPasswordMismatch = "PasswordMismatch" // ReasonEntityCreationFailed : ReasonEntityCreationFailed = "EntityCreationFailed" // ReasonFieldValidationError : ReasonFieldValidationError = "FieldValidationError" // ReasonEntityNotFound : ReasonEntityNotFound = "EntityNotFound" // ReasonIDMismatch : ReasonIDMismatch = "IDMismatch" // ReasonEntityDeletionFailed : ReasonEntityDeletionFailed = "EntityDeletionFailed" // ReasonAuthorizationFailed : ReasonAuthorizationFailed = "AuthorizationFailed" )
Functions ¶
func CompareHashWithPassword ¶
CompareHashWithPassword :
func CompareStrings ¶
CompareStrings :
func GenerateHashFromPassword ¶
GenerateHashFromPassword :
func GenerateToken ¶
GenerateToken :
func ParseQueryToInt ¶
func ParseQueryToInt(queries ...string) ([]int, *models.ErrorParsing)
ParseQueryToInt ;
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.