Documentation ¶
Index ¶
Constants ¶
View Source
const (
// DistrictsLength is the number of districts in Vietnam.
DistrictsLength = 704
)
View Source
const DivisionPath = "data/divisions_16_10_2024.csv"
DivisionPath is the path to the divisions.csv file.
View Source
const DivisionsLength = 10547
DivisionsLength the number of divisions in the data directory.
View Source
const ProvincesLength = 63
ProvincesLength is the number of provinces.
View Source
const (
// WardsLength is the number of wards.
WardsLength = 10542
)
Variables ¶
View Source
var DataDirFS embed.FS
DataDirFS is the filesystem containing the data directory.
Functions ¶
func EachDistrict ¶
EachDistrict iterates over all districts and wards.
func EachDivision ¶
EachDivision calls fn for each division in the data directory.
func EachProvince ¶
EachProvince iterates over all provinces and districts.
Types ¶
type District ¶
type District struct { Code int64 `json:"code"` Name string `json:"name"` Wards []Ward `json:"wards"` }
District is a district in Vietnam.
func GetDistricts ¶
GetDistricts returns all districts and wards.
type Division ¶
type Division struct { ProvinceCode int64 `json:"provinceCode"` DistrictCode int64 `json:"districtCode"` WardCode int64 `json:"wardCode"` ProvinceName string `json:"provinceName"` DistrictName string `json:"districtName"` WardName string `json:"wardName"` }
Division is a division of Vietnam.
func GetDivisions ¶
GetDivisions returns all divisions in the data directory.
Click to show internal directories.
Click to hide internal directories.