address_utils

package
v1.75.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Provinces = []Province{
	{
		Code: "EC",
		Names: []string{
			"Eastern Cape",
			"Eastern-Cape",
			"Oos-Kaap",
			"iPumalanga-Kapa",
			"Kapa Bohlabela",
			"Kapa Botjhabela",
			"Kapa-Vuxa",
			"Kapa Botlhaba",
			"Kapa Vhubvaḓuvha",
			"Mpuma-Koloni",
			"Mpumalanga-Kapa",
			"Mpumalanga-Koloni",
		},
	},
	{
		Code: "FS",
		Names: []string{
			"Free State",
			"Freestate",
			"Vrystaat",
			"iFreyistata",
			"Freistata",
			"Foreisetata",
			"Fureisitata",
			"Freyistata",
			"Fuleyisitata",
			"Freyisitata",
		},
	},
	{
		Code: "GP",
		Names: []string{
			"Gauteng",
			"iGauteng",
			"Kgauteng",
			"Rhawuti",
		},
	},
	{
		Code: "KZN",
		Names: []string{
			"KwaZulu-Natal",
			"KwaZulu Natal",
			"iKwaZulu-Natal",
			"GaZulu-Natala",
			"Hazolo-Natala",
			"KwaZulu-Natali",
			"HaZulu-Natal",
			"KwaZulu-Natala",
		},
	},
	{
		Code: "LP",
		Names: []string{
			"Limpopo",
			"Vhembe",
		},
	},
	{
		Code: "MP",
		Names: []string{
			"Mpumalanga",
			"iMpumalanga",
		},
	},
	{
		Code: "NC",
		Names: []string{
			"Northern Cape",
			"Northern-Cape",
			"Noord-Kaap",
			"Noord Kaap",
			"iTlhagwini-Kapa",
			"Kapa Leboya",
			"Kapa-N'walungu",
			"Kapa Bokone",
			"Kapa Leboa",
			"Kapa Devhula",
			"Mntla-Koloni",
			"Nyakatho-Kapa",
			"Nyakatho-Koloni",
		},
	},
	{
		Code: "NW",
		Names: []string{
			"North West",
			"North-West",
			"Noordwes",
			"Noord-wes",
			"iTlhagwini-Tjhingalanga",
			"Lebowa Bodikela",
			"Leboya Bophirima",
			"Leboya le Bophirima",
			"N'walungu-Vupeladyambu",
			"Bokone Bophirima",
			"Mntla-Ntshona",
			"Nyakatho-Ntshonalanga",
		},
	},
	{
		Code: "WC",
		Names: []string{
			"Western Cape",
			"Western-Cape",
			"Wes-Kaap",
			"Wes Kaap",
			"iTjhingalanga-Kapa",
			"Kapa Bodikela",
			"Kapa Bophirimela",
			"Kapa-Vupeladyambu",
			"Kapa Bophirima",
			"Kapa Vhukovhela",
			"Ntshona-Koloni",
			"Ntshonalanga-Kapa",
			"Ntshonalanga-Koloni",
		},
	},
}

Provinces largely follows the ISO standard: https://en.wikipedia.org/wiki/ISO_3166-2:ZA

Functions

func CleanZone

func CleanZone(countryToClean, zoneToClean *string) (newCountry, newZone *string)

func IsProvince

func IsProvince(address string) bool

func MD5HashOfAddress

func MD5HashOfAddress(enteredAddress string, lat *float64, lng *float64, addressType *string) string

MD5HashOfAddress m(E,L,L) - calculates and returns the MD5 hash of the entered address, lat and lng concatenated together. If lat and lng is blank, it is only the hash of the entered address

func MD5HashOfLowerCaseEnteredAddress

func MD5HashOfLowerCaseEnteredAddress(enteredAddress string) string

MD5HashOfLowerCaseEnteredAddress m(e) - calculates and returns the MD5 hash of a string after preparing the string properly.

Types

type Province

type Province struct {
	Code  string
	Names []string
}

Jump to

Keyboard shortcuts

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