checker

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 20 Imported by: 7

Documentation

Index

Constants

View Source
const (
	LevelC
	LevelB
	LevelA
	LevelS
)
View Source
const (
	PasswordCannotContainSpaces = "error.password.space_invalid"
)

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(password string) error

CheckPassword checks the password strength

func EmailInAllowEmailDomain

func EmailInAllowEmailDomain(email string, allowEmailDomains []string) bool

func IsChinese

func IsChinese(str string) bool

func IsInvalidUsername

func IsInvalidUsername(username string) bool

func IsNotZeroString

func IsNotZeroString(s string) bool

IsNotZeroString check s is not empty string and is not "0"

func IsQuestionsIgnorePath

func IsQuestionsIgnorePath(questionID string) bool

IsQuestionsIgnorePath checks whether the questionID is in ignore path

func IsReservedUsername

func IsReservedUsername(username string) bool

IsReservedUsername checks whether the username is reserved

func IsSupportedImageFile

func IsSupportedImageFile(localFilePath string) bool

IsSupportedImageFile currently answers support image type is `image/jpeg, image/jpg, image/png, image/gif, image/webp`

func IsURL added in v1.3.0

func IsURL(str string) bool

func IsUsersIgnorePath

func IsUsersIgnorePath(username string) bool

IsUsersIgnorePath checks whether the username is in ignore path

Types

type PathIgnore

type PathIgnore struct {
	Users     []string `yaml:"users"`
	Questions []string `yaml:"questions"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL