models

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LocationMap

func LocationMap(locations []Location) map[int]Location

func NeighborhoodMap

func NeighborhoodMap(neighborhoods []Neighborhood) map[int]Neighborhood

func ZipCodeMap

func ZipCodeMap(addrs []Street) map[int]Street

Types

type Address

type Address struct {
	StreetType   string
	Street       string
	Neighborhood string
	City         string
	CityIBGECode string
	State        string
	ZipCode      int
}

type Location

type Location struct {
	ID                    int
	State                 string
	Name                  string
	ZipCode               int
	Situation             LocationSituation
	Type                  LocationType
	SubordinateLocationID int
	IBGECode              string
}

type LocationSituation

type LocationSituation int
const (
	LocationSituationNonCodified LocationSituation = iota
	LocationSituationCodifiedStreet
	LocationSituationCodifiedDistrict
)

type LocationType

type LocationType string
const (
	LocationTypeDistrict LocationType = "D"
	LocationTypeCity     LocationType = "M"
	LocationTypeVillage  LocationType = "P"
)

type Neighborhood

type Neighborhood struct {
	ID   int
	Name string
}

type Street

type Street struct {
	ID                   int
	ZipCode              int
	State                string
	LocationID           int
	StartingNeighborhood *Neighborhood
	EndingNeighborhood   *Neighborhood
	Name                 string
	Complement           string
	Type                 string
}

Jump to

Keyboard shortcuts

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