address_utils

package
v1.216.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Provinces = map[string]Province{
	"EC": {
		DisplayName: "Eastern Cape",
		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",
		},
	},
	"FS": {
		DisplayName: "Free State",
		Names: []string{
			"Free State",
			"Freestate",
			"Vrystaat",
			"iFreyistata",
			"Freistata",
			"Foreisetata",
			"Fureisitata",
			"Freyistata",
			"Fuleyisitata",
			"Freyisitata",
		},
	},
	"GP": {
		DisplayName: "Gauteng",
		Names: []string{
			"GT",
			"Gauteng",
			"iGauteng",
			"Kgauteng",
			"Rhawuti",
		},
	},
	"KZN": {
		DisplayName: "KwaZulu-Natal",
		Names: []string{
			"NT",
			"NL",
			"ZN",
			"KwaZulu-Natal",
			"KwaZulu Natal",
			"iKwaZulu-Natal",
			"GaZulu-Natala",
			"Hazolo-Natala",
			"KwaZulu-Natali",
			"HaZulu-Natal",
			"KwaZulu-Natala",
		},
	},
	"LP": {
		DisplayName: "Limpopo",
		Names: []string{
			"NP",
			"Limpopo",
			"Vhembe",
		},
	},
	"MP": {
		DisplayName: "Mpumalanga",
		Names: []string{
			"Mpumalanga",
			"iMpumalanga",
		},
	},
	"NC": {
		DisplayName: "Northern Cape",
		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",
		},
	},
	"NW": {
		DisplayName: "North West",
		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",
		},
	},
	"WC": {
		DisplayName: "Western Cape",
		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",
		},
	},
}

Functions

func CleanZone

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

func GetDistanceInKmBetweenCoordinates added in v1.111.0

func GetDistanceInKmBetweenCoordinates(lat1 float64, lng1 float64, lat2 float64, lng2 float64) float64

func GetZoneDisplayName added in v1.107.0

func GetZoneDisplayName(zone string) 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 {
	Names       []string
	DisplayName string
}

Jump to

Keyboard shortcuts

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