checker

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 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 added in v1.1.0

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

func IsChinese

func IsChinese(str string) bool

func IsInvalidUsername added in v1.0.4

func IsInvalidUsername(username string) bool

func IsNotZeroString added in v1.0.2

func IsNotZeroString(s string) bool

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

func IsQuestionsIgnorePath added in v1.1.0

func IsQuestionsIgnorePath(questionID string) bool

IsQuestionsIgnorePath checks whether the questionID is in ignore path

func IsReservedUsername added in v1.0.2

func IsReservedUsername(username string) bool

IsReservedUsername checks whether the username is reserved

func IsSupportedImageFile added in v1.0.4

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 added in v1.1.0

func IsUsersIgnorePath(username string) bool

IsUsersIgnorePath checks whether the username is in ignore path

Types

type PathIgnore added in v1.1.0

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