Documentation
¶
Index ¶
- Constants
- func CheckPassword(password string) error
- func DecodeAndCheckImageFile(localFilePath string, maxImageMegapixel int) bool
- func EmailInAllowEmailDomain(email string, allowEmailDomains []string) bool
- func IsChinese(str string) bool
- func IsInvalidUsername(username string) bool
- func IsNotZeroString(s string) bool
- func IsQuestionsIgnorePath(questionID string) bool
- func IsReservedUsername(username string) bool
- func IsURL(str string) bool
- func IsUnAuthorizedExtension(fileName string, allowedExtensions []string) bool
- func IsUsersIgnorePath(username string) bool
- type PathIgnore
- type QuestionLink
Constants ¶
View Source
const ( LevelC LevelB LevelA LevelS )
View Source
const ( QuestionLinkTypeURL = 1 QuestionLinkTypeID = 2 )
View Source
const (
PasswordCannotContainSpaces = "error.password.space_invalid"
)
Variables ¶
This section is empty.
Functions ¶
func CheckPassword ¶
CheckPassword checks the password strength
func DecodeAndCheckImageFile ¶
DecodeAndCheckImageFile currently answers support image type is `image/jpeg, image/jpg, image/png, image/gif, image/webp`
func EmailInAllowEmailDomain ¶
func IsInvalidUsername ¶
func IsNotZeroString ¶
IsNotZeroString check s is not empty string and is not "0"
func IsQuestionsIgnorePath ¶
IsQuestionsIgnorePath checks whether the questionID is in ignore path
func IsReservedUsername ¶
IsReservedUsername checks whether the username is reserved
func IsUnAuthorizedExtension ¶
IsUnAuthorizedExtension check whether the file extension is not in the allowedExtensions WANING Only checks the file extension is not reliable, but `http.DetectContentType` and `mimetype` are not reliable for all file types.
func IsUsersIgnorePath ¶
IsUsersIgnorePath checks whether the username is in ignore path
Types ¶
type PathIgnore ¶
type QuestionLink ¶
func GetQuestionLink ¶
func GetQuestionLink(content string) []QuestionLink
Click to show internal directories.
Click to hide internal directories.