singo

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2017 License: MIT Imports: 4 Imported by: 1

README

Singo IE Validation - Golang

Build Status npm

Biblioteca para validação das inscrições dos estados brasileiros.

Validações implementadas de acordo com o manual do Sintegra.

Instalando

Para utilizar no seu projeto basta executar o seguinte comando

  go get github.com/dilowagner/singo-ie-validation

Exemplo de utilização

package main

import (
	"fmt"

	singo "github.com/dilowagner/singo-ie-validation"
)

func main() {

	validator := singo.NewIEValidator()

	validator.IE = " 251.040.852" // SC - Valido
	validator.UF = "SC"

	result, err := validator.Validate()
	if err != nil {
		panic(err.Error)
	}

	if result {
		fmt.Println("Valido")
	} else {
		fmt.Println("Invalido")
	}
}

Executando os testes

Basta clonar o projeto e rodar o comando:

  go test

Utilização

Para utilizar esta biblioteca, você pode usar o projeto singo-api, que disponibiliza uma API como um microserviço feito em Docker.

Licença MIT

Documentation

Index

Constants

View Source
const (
	Acre            = "AC" // AC Acre
	Alagoas         = "AL" // AL Alagoas
	Amapa           = "AP" // AP Amapá
	Amazonas        = "AM" // AM Amazonas
	Bahia           = "BA" // BA Bahia
	Ceara           = "CE" // CE Ceará
	DistritoFederal = "DF" // DF Distrito Federal
	EspiritoSanto   = "ES" // ES Espirito Santo
	Goais           = "GO" // GO Goias
	Maranhao        = "MA" // MA Maranhão
	MatoGrosso      = "MT" // MT Mato Grosso
	MatoGrossoSul   = "MS" // MS Mato Grosso do Sul
	MinasGerais     = "MG" // MG Minas Gerais
	Para            = "PA" // PA Pará
	Paraiba         = "PB" // PB Paraíba
	Parana          = "PR" // PR Paraná
	Pernambuco      = "PE" // PE Pernambuco
	Piaui           = "PI" // PI Piauí
	RioJaneiro      = "RJ" // RJ Rio de Janeiro
	RioGrandeNorte  = "RN" // RN Rio Grande do Norte
	RioGrandeSul    = "RS" // RS Rio Grande do Sul
	Rondonia        = "RO" // RO Rondônia
	Roraima         = "RR" // RR Roraima
	SantaCatarina   = "SC" // SC Santa Catarina
	SaoPaulo        = "SP" // SP São Paulo
	Sergipe         = "SE" // SE Sergipe
	Tocantins       = "TO" // TO Tocantins
)

Constantes

Variables

This section is empty.

Functions

This section is empty.

Types

type IEValidator

type IEValidator struct {
	IE string
	UF string
}

IEValidator struct

func NewIEValidator

func NewIEValidator() *IEValidator

NewIEValidator create the instance for IEValidator

func (IEValidator) Validate

func (v IEValidator) Validate() (bool, error)

Validate func

type ValidatableManager

type ValidatableManager interface {
	Validate() (bool, error)
}

ValidatableManager interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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