Documentation ¶
Index ¶
- Constants
- func ActivateUser(userId string) bool
- func ConvertUserToMap(u *entities.User) map[string]interface{}
- func CreateUser(details map[string]interface{}) (entities.User, error)
- func FindUserBy(key string, value string) (entities.User, bool)
- func GenerateUserToken(tokenType string, user entities.User, value string) (string, bool)
- func GetCountryCodeByIP(ipAddress string) (string, bool)
- func GetCountryCodeByName(name string) (string, bool)
- func GetGameResultsForUser(offset int, filters map[string]interface{}) ([]map[string]interface{}, bool)
- func GetUser(id string) (entities.User, bool)
- func GetUserToken(token string, tokenType string) (entities.UserToken, bool)
- func IsEmailAvailable(email string) bool
- func IsUsernameAvailable(username string) bool
- func RemoveTokensForUser(tokenType string, userId string)
- func SanitizeUser(user *entities.User)
- func SearchForUsers(query string) []map[string]interface{}
- func UpdateUser(user *entities.User) bool
- func UpdateUserPassword(password string, user entities.User) bool
- func UseUserToken(token string, tokenType string) bool
- func UserExists(id string) bool
- func ValidateCountryCode(code string) (string, bool)
- func ValidateEmail(email string) (bool, string)
- func ValidateName(name string) (bool, string)
- func ValidatePassword(password string) (bool, string)
- func ValidateUser(details map[string]interface{}) (bool, map[string]string)
- func ValidateUsername(username string) (bool, string)
Constants ¶
View Source
const ( TOKEN_CHANGE_EMAIL = "change_email" TOKEN_ACTIVATE = "activate" TOKEN_PASSWORD_CHANGE = "password" )
Variables ¶
This section is empty.
Functions ¶
func ActivateUser ¶
func ConvertUserToMap ¶
func FindUserBy ¶
Fetches the user from the database by the provided key. First return value is a user itself. Second return value is OK/found
func GenerateUserToken ¶
func GetCountryCodeByIP ¶
func GetCountryCodeByName ¶
func GetGameResultsForUser ¶
func IsEmailAvailable ¶
Checks if there's already an account with provided e-mail address
func IsUsernameAvailable ¶
Checks if account with provided username already exists
func RemoveTokensForUser ¶
func SanitizeUser ¶
func SearchForUsers ¶
Returns an array of usernames for a given search keyword
func UpdateUser ¶
func UseUserToken ¶
func UserExists ¶
func ValidateCountryCode ¶
func ValidateEmail ¶
func ValidateName ¶
func ValidatePassword ¶
func ValidateUsername ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.