validators

package
v0.0.0-...-b53ed2c Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CNPJRegexp = regexp.MustCompile(`^\d{2}\.?\d{3}\.?\d{3}\/?(:?\d{3}[1-9]|\d{2}[1-9]\d|\d[1-9]\d{2}|[1-9]\d{3})-?\d{2}$`)
View Source
var CPFRegexp = regexp.MustCompile(`^\d{3}\.?\d{3}\.?\d{3}-?\d{2}$`)

NotBlank it's just an alias for github.com/go-playground/validator/v10/non-standard/validators.NotBlank to avoid importing two packages with the same name.

Functions

func CNPJ

func CNPJ(fl validator.FieldLevel) bool

func CPF

func CPF(fl validator.FieldLevel) bool

func IsCNPJ

func IsCNPJ(doc string) bool

IsCNPJ verifies if the given string is a valid CPF document.

func IsCPF

func IsCPF(doc string) bool

IsCPF verifies if the given string is a valid CPF document.

func NotSpace

func NotSpace(fl validator.FieldLevel) bool

func Setup

func Setup() (*validator.Validate, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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