cep

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiCepModel

type ApiCepModel struct {
	Code       string `json:"code"`
	Address    string `json:"address"`
	District   string `json:"district"`
	City       string `json:"city"`
	State      string `json:"state"`
	StatusText string `json:"statusText"`
	Status     int    `json:"status"`
	Ok         bool   `json:"ok"`
	Message    string `json:"message"`
}

type BrasilAPIModel added in v0.0.7

type BrasilAPIModel struct {
	CEP          string `json:"cep"`
	Street       string `json:"street"`
	Neighborhood string `json:"neighborhood"`
	State        string `json:"state"`
	City         string `json:"city"`
}

type CEP

type CEP struct {
	CEP            string    `json:"cep" yaml:"cep" toml:"cep"`
	Logradouro     string    `json:"logradouro" yaml:"logradouro" toml:"logradouro"`
	TipoLogradouro string    `json:"tipo_logradouro" yaml:"tipo_logradouro" toml:"tipo_logradouro"`
	Bairro         string    `json:"bairro" yaml:"bairro" toml:"bairro"`
	Municipio      string    `json:"municipio" yaml:"municipio" toml:"municipio"`
	UF             string    `json:"uf" yaml:"uf" toml:"uf"`
	DataRequisicao time.Time `json:"data_requisicao" yaml:"data_requisicao" toml:"data_requisicao"`
}

func (*CEP) CheckTipoLogradouro added in v0.7.9

func (cep *CEP) CheckTipoLogradouro()

type CEPAPIBrasilAPI added in v0.0.7

type CEPAPIBrasilAPI struct {
}

func (*CEPAPIBrasilAPI) GetCEP added in v0.0.7

func (c *CEPAPIBrasilAPI) GetCEP(cep string) (*CEP, error)

type CEPAPICep

type CEPAPICep struct {
}

func (*CEPAPICep) GetCEP

func (c *CEPAPICep) GetCEP(cep string) (*CEP, error)

type CEPAPIProvider added in v0.7.12

type CEPAPIProvider interface {
	GetCEP(cep string) (*CEP, error)
}

type CEPAPIViaCep

type CEPAPIViaCep struct {
}

func (*CEPAPIViaCep) GetCEP

func (c *CEPAPIViaCep) GetCEP(cep string) (*CEP, error)

type CEPCorreiosAPI added in v0.7.13

type CEPCorreiosAPI struct {
}
{
    "erro": false,
    "mensagem": "DADOS ENCONTRADOS COM SUCESSO.",
    "total": 1,
    "dados": [
        {
            "uf": "SC",
            "localidade": "Blumenau",
            "locNoSem": "",
            "locNu": "",
            "localidadeSubordinada": "",
            "logradouroDNEC": "Rua Manoel Barreto",
            "logradouroTextoAdicional": "",
            "logradouroTexto": "",
            "bairro": "Victor Konder",
            "baiNu": "",
            "nomeUnidade": "",
            "cep": "89012134",
            "tipoCep": "2",
            "numeroLocalidade": "",
            "situacao": "",
            "faixasCaixaPostal": [],
            "faixasCep": []
        }
    ]
}

func (*CEPCorreiosAPI) GetCEP added in v0.7.13

func (c *CEPCorreiosAPI) GetCEP(cep string) (*CEP, error)

type CEPRepository

type CEPRepository interface {
	GetCEP(cep string) (*CEP, error)
	SaveCEP(cep *CEP) error
}

type CEPRepositorySQLite

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

func NewCEPRepositorySQLite

func NewCEPRepositorySQLite(connectionString string) (repo *CEPRepositorySQLite, err error)

func (*CEPRepositorySQLite) GetCEP

func (r *CEPRepositorySQLite) GetCEP(cep string) (*CEP, error)

func (*CEPRepositorySQLite) SaveCEP

func (r *CEPRepositorySQLite) SaveCEP(cep *CEP) error

type CEPService

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

func NewCEPService

func NewCEPService(repository CEPRepository) *CEPService

func NewSQliteCEPService added in v0.0.6

func NewSQliteCEPService(connectionString string) (*CEPService, error)

func (*CEPService) GetCEP

func (c *CEPService) GetCEP(cep string) (*CEP, error)

type CorreiosAPIModel added in v0.7.13

type CorreiosAPIModel struct {
	UF                       string `json:"uf"`
	Localidade               string `json:"localidade"`
	LogradouroDNEC           string `json:"logradouroDNEC"`
	LogradouroTextoAdicional string `json:"logradouroTextoAdicional"`
	LogradouroTexto          string `json:"logradouroTexto"`
	Bairro                   string `json:"bairro"`
	CEP                      string `json:"cep"`

	Street       string `json:"street"`
	Neighborhood string `json:"neighborhood"`
	State        string `json:"state"`
	City         string `json:"city"`
}
{
    "erro": false,
    "mensagem": "DADOS ENCONTRADOS COM SUCESSO.",
    "total": 1,
    "dados": [
        {
            "uf": "SC",
            "localidade": "Blumenau",
            "locNoSem": "",
            "locNu": "",
            "localidadeSubordinada": "",
            "logradouroDNEC": "Rua Manoel Barreto",
            "logradouroTextoAdicional": "",
            "logradouroTexto": "",
            "bairro": "Victor Konder",
            "baiNu": "",
            "nomeUnidade": "",
            "cep": "89012134",
            "tipoCep": "2",
            "numeroLocalidade": "",
            "situacao": "",
            "faixasCaixaPostal": [],
            "faixasCep": []
        }
    ]
}

type CorreiosAPIModelResponse added in v0.7.13

type CorreiosAPIModelResponse struct {
	Erro     bool               `json:"erro"`
	Mensagem string             `json:"mensagem"`
	Total    int                `json:"total"`
	Dados    []CorreiosAPIModel `json:"dados"`
}
{
    "erro": false,
    "mensagem": "DADOS ENCONTRADOS COM SUCESSO.",
    "total": 1,
    "dados": [
        {
            "uf": "SC",
            "localidade": "Blumenau",
            "locNoSem": "",
            "locNu": "",
            "localidadeSubordinada": "",
            "logradouroDNEC": "Rua Manoel Barreto",
            "logradouroTextoAdicional": "",
            "logradouroTexto": "",
            "bairro": "Victor Konder",
            "baiNu": "",
            "nomeUnidade": "",
            "cep": "89012134",
            "tipoCep": "2",
            "numeroLocalidade": "",
            "situacao": "",
            "faixasCaixaPostal": [],
            "faixasCep": []
        }
    ]
}

type ViaCepModel

type ViaCepModel struct {
	CEP         string `json:"cep"`
	Logradouro  string `json:"logradouro"`
	Complemento string `json:"complemento"`
	Bairro      string `json:"bairro"`
	Localidade  string `json:"localidade"`
	UF          string `json:"uf"`
	IBGE        string `json:"ibge"`
	GIA         string `json:"gia"`
	DDD         string `json:"ddd"`
	SIAFI       string `json:"siafi"`
	ERRO        string `json:"erro"`
}

Jump to

Keyboard shortcuts

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