validator

package
v0.0.0-...-31a4683 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidType   = errors.New("型が相違しています")
	ErrRequired      = errors.New("必須フィールドが欠落しています")
	ErrSpecialRune   = errors.New("特殊文字が含まれています")
	ErrInvalidRune   = errors.New("無効な文字が含まれています")
	ErrInvalidFormat = errors.New("無効な形式です")
	ErrInvalidLength = errors.New("長さが指定の範囲外です")
	ErrForbidden     = errors.New("使用できないリソースを指定しています")
)
View Source
var IsNotContainSpecialRune = NotContainSpecialRuneRule{}
View Source
var IsNotOnlySpace = NotOnlySpaceRule{}
View Source
var IsPassword = PasswordRule{}

Functions

This section is empty.

Types

type ImagePathOrEmptyRule

type ImagePathOrEmptyRule struct {
	// contains filtered or unexported fields
}

func IsImagePathOrEmpty

func IsImagePathOrEmpty(characterId *int) ImagePathOrEmptyRule

func (ImagePathOrEmptyRule) Validate

func (r ImagePathOrEmptyRule) Validate(value interface{}) error

type ImagePathRule

type ImagePathRule struct {
	// contains filtered or unexported fields
}

func IsImagePath

func IsImagePath(characterId *int) ImagePathRule

func (ImagePathRule) Validate

func (r ImagePathRule) Validate(value interface{}) error

type NotContainSpecialRuneRule

type NotContainSpecialRuneRule struct{}

func (NotContainSpecialRuneRule) Validate

func (r NotContainSpecialRuneRule) Validate(value interface{}) error

type NotOnlySpaceRule

type NotOnlySpaceRule struct{}

func (NotOnlySpaceRule) Validate

func (r NotOnlySpaceRule) Validate(value interface{}) error

type PasswordRule

type PasswordRule struct{}

func (PasswordRule) Validate

func (r PasswordRule) Validate(value interface{}) error

type UsernameRule

type UsernameRule struct {
	// contains filtered or unexported fields
}

func IsUsername

func IsUsername(minLength, maxLength int) UsernameRule

func (UsernameRule) Validate

func (r UsernameRule) Validate(value interface{}) error

Jump to

Keyboard shortcuts

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