validator

package
v0.0.0-...-83fb53a Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Validator

type Validator struct {
	Errors map[string]string `json:"errors"`
}

func New

func New() *Validator

func (*Validator) AddError

func (v *Validator) AddError(key, message string)

func (*Validator) Check

func (v *Validator) Check(ok bool, key, message string)

func (*Validator) GetErrMsg

func (v *Validator) GetErrMsg() string

func (*Validator) IsEmail

func (v *Validator) IsEmail(email, key, message string)

func (*Validator) IsImage

func (v *Validator) IsImage(imageType, key string)

Validate Image Type

func (*Validator) IsImageSize

func (v *Validator) IsImageSize(imageSize, max int64, key string)

Validate Image Size

func (*Validator) IsLength

func (v *Validator) IsLength(data, key string, minLength, maxLength int, message ...string)

func (*Validator) IsValidFullName

func (v *Validator) IsValidFullName(fullName, key string)

IsValidFullName validates the FullName with the given key

func (*Validator) IsValidPassword

func (v *Validator) IsValidPassword(password, key string)

isValidPassword validates the password with the given key

func (*Validator) IsVideo

func (v *Validator) IsVideo(videoType, key string)

Validate Video Type

func (*Validator) IsVideoSize

func (v *Validator) IsVideoSize(videoSize, max int64, key string)

Validate Video Size

func (*Validator) Required

func (v *Validator) Required(data, key, message string)

func (*Validator) Valid

func (v *Validator) Valid() bool

Jump to

Keyboard shortcuts

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