checker

package
v0.0.0-...-883d24b Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

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(file io.Reader, ext string) bool

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

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