Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrHTTPClientNotSet is returned when a method is called and the http client is not configured. ErrHTTPClientNotSet = errors.New("http client not set") )
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { UFs UFs Distritos Distritos Municipios Municipios Regioes Regioes }
API is the IBGE Localidades API object.
type Distrito ¶
type Distrito struct { ID int `json:"id"` Nome string `json:"nome"` Municipio Municipio `json:"municipio"` }
Distrito representa um Distrito.
type Distritos ¶
type Distritos struct {
// contains filtered or unexported fields
}
func (*Distritos) Distritos ¶
func (d *Distritos) Distritos(ctx context.Context) (DistritosResponse, error)
Distritos List all the Distritos. Returns a list of Distritos. GET https://servicodados.ibge.gov.br/api/v1/localidades/distritos
type DistritosResponse ¶
type DistritosResponse []Distrito
DistritosResponse represents the response of the Distritos methods.
type Mesorregiao ¶
Mesorregiao representa uma Mesorregião.
type Microrregiao ¶
type Microrregiao struct { ID int `json:"id"` Nome string `json:"nome"` Mesorregiao Mesorregiao `json:"mesorregiao"` }
Microrregiao representa uma Microrregião.
type Municipio ¶
type Municipio struct { ID int `json:"id"` Nome string `json:"nome"` Microrregiao Microrregiao `json:"microrregiao"` RegiaoImediata RegiaoImediata `json:"regiao-imediata"` }
Municipio representa um Município.
type Municipios ¶
type Municipios struct {
// contains filtered or unexported fields
}
func (*Municipios) Municipios ¶
func (d *Municipios) Municipios(ctx context.Context) (MunicipiosResponse, error)
Municipios List all the Municípios. Returns a list of Municipios. GET https://servicodados.ibge.gov.br/api/v1/localidades/municipios
type MunicipiosResponse ¶
type MunicipiosResponse []Municipio
MunicipiosResponse represents the response of the Municipios methods.
type RegiaoImediata ¶
type RegiaoImediata struct { ID int `json:"id"` Nome string `json:"nome"` RegiaoIntermediaria RegiaoIntermediaria `json:"regiao-intermediaria"` }
RegiaoImediata representa uma Região Imediata.
type RegiaoIntermediaria ¶
RegiaoIntermediaria representa uma Região Intermediária.
type Regioes ¶
type Regioes struct {
// contains filtered or unexported fields
}
func (*Regioes) Regioes ¶
func (d *Regioes) Regioes(ctx context.Context) (RegioesResponse, error)
Regioes List all the Municípios. Returns a list of Regioes. GET https://servicodados.ibge.gov.br/api/v1/localidades/regioes
type RegioesResponse ¶
type RegioesResponse []Regiao
RegioesResponse represents the response of the Regioes methods.
type UF ¶
type UF struct { ID int `json:"id"` Nome string `json:"nome"` Sigla string `json:"sigla"` Regiao Regiao `json:"regiao"` }
UF representa uma Unidade da Federação.
type UFs ¶
type UFs struct {
// contains filtered or unexported fields
}
func (*UFs) UFs ¶
func (ufs *UFs) UFs(ctx context.Context) (UFsResponse, error)
UFs List all the UFs. Returns a list of UFs. GET https://servicodados.ibge.gov.br/api/v1/localidades/estados