validators

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TypesAccepts added in v1.4.0

func TypesAccepts() string

Types

type Acre added in v1.4.0

type Acre struct {
}

Acre struct - Acre Implements the Validator interface

func (Acre) IsValid added in v1.4.0

func (v Acre) IsValid(insc string) bool

IsValid func

type Alagoas added in v1.4.0

type Alagoas struct {
}

Alagoas struct - Alagoas Implements the Validator interface

func (Alagoas) IsValid added in v1.4.0

func (v Alagoas) IsValid(insc string) bool

IsValid func

type Amapa added in v1.4.0

type Amapa struct {
}

Amapa struct - Amapá Implements the Validator interface

func (Amapa) IsValid added in v1.4.0

func (v Amapa) IsValid(insc string) bool

IsValid func

type Amazonas added in v1.4.0

type Amazonas struct {
}

Amazonas struct - Amazonas Implements the Validator interface

func (Amazonas) IsValid added in v1.4.0

func (v Amazonas) IsValid(insc string) bool

IsValid func

type Bahia added in v1.4.0

type Bahia struct {
}

Bahia struct - Bahia Implements the Validator interface

func (Bahia) IsValid added in v1.4.0

func (v Bahia) IsValid(insc string) bool

IsValid func

type Ceara added in v1.4.0

type Ceara struct {
}

Ceara struct - Ceará Implements the Validator interface

func (Ceara) IsValid added in v1.4.0

func (v Ceara) IsValid(insc string) bool

IsValid func

type DistroFederal added in v1.4.0

type DistroFederal struct {
}

DistroFederal struct - Distrito Federal Implements the Validator interface

func (DistroFederal) IsValid added in v1.4.0

func (v DistroFederal) IsValid(insc string) bool

IsValid func

type EspiritoSanto added in v1.4.0

type EspiritoSanto struct {
}

EspiritoSanto struct - Espirito Santo Implements the Validator interface

func (EspiritoSanto) IsValid added in v1.4.0

func (v EspiritoSanto) IsValid(insc string) bool

IsValid func

type Goias added in v1.4.0

type Goias struct {
}

Goias struct - Goias Implements the Validator interface

func (Goias) IsValid added in v1.4.0

func (v Goias) IsValid(insc string) bool

IsValid func

type Maranhao added in v1.4.0

type Maranhao struct {
}

Maranhao struct - Maranhão Implements the Validator interface

func (Maranhao) IsValid added in v1.4.0

func (v Maranhao) IsValid(insc string) bool

IsValid func

type MataGrosso added in v1.4.0

type MataGrosso struct {
}

MataGrosso struct - Mato Grosso Implements the Validator interface

func (MataGrosso) IsValid added in v1.4.0

func (v MataGrosso) IsValid(insc string) bool

IsValid func

type MatoGrossoSul added in v1.4.0

type MatoGrossoSul struct {
}

MatoGrossoSul struct - Mato Grosso do Sul Implements the Validator interface

func (MatoGrossoSul) IsValid added in v1.4.0

func (v MatoGrossoSul) IsValid(insc string) bool

IsValid func

type MinasGerais added in v1.4.0

type MinasGerais struct {
}

MinasGerais struct - Minas Gerais Implements the Validator interface

func (MinasGerais) IsValid added in v1.4.0

func (v MinasGerais) IsValid(insc string) bool

IsValid func

type Para added in v1.4.0

type Para struct {
}

Para struct - Pará Implements the Validator interface

func (Para) IsValid added in v1.4.0

func (v Para) IsValid(insc string) bool

IsValid func

type Paraiba added in v1.4.0

type Paraiba struct {
}

Paraiba struct - Paraiba Implements the Validator interface

func (Paraiba) IsValid added in v1.4.0

func (v Paraiba) IsValid(insc string) bool

IsValid func

type Parana added in v1.4.0

type Parana struct {
}

Parana struct - Parana Implements the Validator interface

func (Parana) IsValid added in v1.4.0

func (v Parana) IsValid(insc string) bool

IsValid func

type Pernambuco added in v1.4.0

type Pernambuco struct {
}

Pernambuco struct - Pernambuco Implements the Validator interface

func (Pernambuco) IsValid added in v1.4.0

func (v Pernambuco) IsValid(insc string) bool

IsValid func

type Piaui added in v1.4.0

type Piaui struct {
}

Piaui struct - Piauí Implements the Validator interface

func (Piaui) IsValid added in v1.4.0

func (v Piaui) IsValid(insc string) bool

IsValid func

type RioGrandeNorte added in v1.4.0

type RioGrandeNorte struct {
}

RioGrandeNorte struct - Rio Grande do Norte Implements the Validator interface

func (RioGrandeNorte) IsValid added in v1.4.0

func (v RioGrandeNorte) IsValid(insc string) bool

IsValid func

type RioGrandeSul added in v1.4.0

type RioGrandeSul struct {
}

RioGrandeSul struct - Rio Grande do Sul Implements the Validator interface

func (RioGrandeSul) IsValid added in v1.4.0

func (v RioGrandeSul) IsValid(insc string) bool

IsValid func

type RioJaneiro added in v1.4.0

type RioJaneiro struct {
}

RioJaneiro struct - Rio de Janeiro Implements the Validator interface

func (RioJaneiro) IsValid added in v1.4.0

func (v RioJaneiro) IsValid(insc string) bool

IsValid func

type Rondonia added in v1.4.0

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

Rondonia struct - Rondônia Implements the Validator interface

func (Rondonia) IsValid added in v1.4.0

func (v Rondonia) IsValid(insc string) bool

IsValid func

type Roraima added in v1.4.0

type Roraima struct {
}

Roraima struct - Roraima Implements the Validator interface

func (Roraima) IsValid added in v1.4.0

func (v Roraima) IsValid(insc string) bool

IsValid func

type Rules

type Rules struct {
}

Rules struct - define rules for validator

func NewRule

func NewRule() Rules

NewRule function

func (*Rules) Between

func (r *Rules) Between(base string, inf, sup int) bool

Between function

func (*Rules) CalculateMod

func (r *Rules) CalculateMod(total, divisor int) int

CalculateMod function

func (*Rules) CalculateTotal

func (r *Rules) CalculateTotal(insc string, baseSize int, weights []int) int

CalculateTotal function

func (*Rules) GetBaseValue

func (r *Rules) GetBaseValue(insc string, quantity int) string

GetBaseValue function

func (*Rules) GetDigit

func (r *Rules) GetDigit(total, divisor int) string

GetDigit function

func (*Rules) GetWeight

func (r *Rules) GetWeight(start int, size int) []int

GetWeight function

func (*Rules) IsCorrectSize

func (r *Rules) IsCorrectSize(insc string, size int) bool

IsCorrectSize function

func (*Rules) IsStartBetween added in v1.4.0

func (r *Rules) IsStartBetween(insc string, start string, end string) bool

IsStartBetween function

func (*Rules) IsStartWith

func (r *Rules) IsStartWith(insc string, value string) bool

IsStartWith function

func (*Rules) IsUndefined

func (r *Rules) IsUndefined(obj interface{}) bool

IsUndefined function

func (*Rules) SliceValues

func (r *Rules) SliceValues(insc string, quantity int) []string

SliceValues function

func (*Rules) ValidateDefaultRule

func (r *Rules) ValidateDefaultRule(insc string, baseSize int, divisor int) bool

ValidateDefaultRule function

type SantaCatarina added in v1.4.0

type SantaCatarina struct {
}

SantaCatarina struct - Santa Catarina Implements the Validator interface

func (SantaCatarina) IsValid added in v1.4.0

func (v SantaCatarina) IsValid(insc string) bool

IsValid func

type SaoPaulo added in v1.4.0

type SaoPaulo struct {
}

SaoPaulo struct - São Paulo Implements the Validator interface

func (SaoPaulo) IsValid added in v1.4.0

func (v SaoPaulo) IsValid(insc string) bool

IsValid func

type Sergipe added in v1.4.0

type Sergipe struct {
}

Sergipe struct - Sergipe Implements the Validator interface

func (Sergipe) IsValid added in v1.4.0

func (v Sergipe) IsValid(insc string) bool

IsValid func

type Tocantins added in v1.4.0

type Tocantins struct {
}

Tocantins struct - Tocantins Implements the Validator interface

func (Tocantins) IsValid added in v1.4.0

func (v Tocantins) IsValid(insc string) bool

IsValid func

type UFEnum added in v1.4.0

type UFEnum int
const (
	Undefined UFEnum = -1
	AC        UFEnum = 12 // AC: Acre
	AL        UFEnum = 27 // AL: Alagoas
	AM        UFEnum = 13 // AM: Amazonas
	AP        UFEnum = 16 // AP: Amapá
	BA        UFEnum = 29 // BA: Bahia
	CE        UFEnum = 23 // CE: Ceará
	DF        UFEnum = 53 // DF: Distrito Federal
	ES        UFEnum = 32 // ES: Espirito Santo
	GO        UFEnum = 52 // GO: Goias
	MA        UFEnum = 21 // MA: Maranhão
	MG        UFEnum = 31 // MG: Minas Gerais
	MS        UFEnum = 50 // MS: Mato Grosso do Sul
	MT        UFEnum = 51 // MT: Mato Grosso
	PA        UFEnum = 15 // PA: Pará
	PB        UFEnum = 25 // PB: Paraíba
	PE        UFEnum = 26 // PE: Pernambuco
	PI        UFEnum = 22 // PI: Piauí
	PR        UFEnum = 41 // PR: Paraná
	RJ        UFEnum = 33 // RJ: Rio de Janeiro
	RN        UFEnum = 24 // RN: Rio Grande do Norte
	RO        UFEnum = 11 // RO: Rondônia
	RR        UFEnum = 14 // RR: Roraima
	RS        UFEnum = 43 // RS: Rio Grande do Sul
	SC        UFEnum = 42 // SC: Santa Catarina
	SE        UFEnum = 28 // SE: Sergipe
	SP        UFEnum = 35 // SP: São Paulo
	TO        UFEnum = 17 // TO: Tocantins
)

func (UFEnum) IsValid added in v1.4.0

func (uf UFEnum) IsValid() (err error)

func (UFEnum) MarshalJSON added in v1.4.0

func (uf UFEnum) MarshalJSON() ([]byte, error)

func (UFEnum) MarshalXML added in v1.4.0

func (uf UFEnum) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*UFEnum) Scan added in v1.4.0

func (uf *UFEnum) Scan(value interface{}) (err error)

func (UFEnum) String added in v1.4.0

func (uf UFEnum) String() string

func (*UFEnum) UnmarshalJSON added in v1.4.0

func (uf *UFEnum) UnmarshalJSON(bytes []byte) error

func (*UFEnum) UnmarshalXML added in v1.4.0

func (uf *UFEnum) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (UFEnum) Value added in v1.4.0

func (uf UFEnum) Value() (driver.Value, error)

type Validator added in v1.4.0

type Validator interface {
	IsValid(insc string) bool
}

Validator interface

Jump to

Keyboard shortcuts

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