models

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const CitiesCollection = "DalgoTest_Cities"

Variables

View Source
var Cities = []City{
	{
		Name:          "Tokyo",
		State:         "Tokyo",
		Country:       "JP",
		Population:    37400068,
		AreaSqKm:      2187,
		IsCapital:     true,
		HasAirport:    true,
		Founded:       Year(1457),
		LastUpdatedAt: time.Now(),
	},
	{
		Name:          "Delhi",
		State:         "Delhi",
		Country:       "IN",
		Population:    30290936,
		AreaSqKm:      1484,
		IsCapital:     true,
		HasAirport:    true,
		Founded:       Year(1911),
		LastUpdatedAt: time.Now(),
	},
	{
		Name:          "Shanghai",
		State:         "Shanghai",
		Country:       "CN",
		Population:    27058480,
		AreaSqKm:      6340,
		IsCapital:     false,
		HasAirport:    true,
		Founded:       Year(1291),
		LastUpdatedAt: time.Now(),
	},
	{
		Name:          "São Paulo",
		State:         "São Paulo",
		Country:       "BR",
		Population:    22046000,
		AreaSqKm:      1521,
		IsCapital:     false,
		HasAirport:    true,
		Founded:       Year(1554),
		LastUpdatedAt: time.Now(),
	},
	{
		Name:          "Mumbai",
		State:         "Maharashtra",
		Country:       "IN",
		Population:    21344117,
		AreaSqKm:      603,
		IsCapital:     false,
		HasAirport:    true,
		Founded:       Year(1661),
		LastUpdatedAt: time.Now(),
	},
	{
		Name:          "Beijing",
		State:         "Beijing",
		Country:       "CN",
		Population:    21051600,
		AreaSqKm:      16410,
		IsCapital:     true,
		HasAirport:    true,
		Founded:       Year(1045),
		LastUpdatedAt: time.Now(),
	},
	{
		Name:          "Cairo",
		State:         "Cairo",
		Country:       "EG",
		Population:    20474100,
		AreaSqKm:      214,
		IsCapital:     true,
		HasAirport:    true,
		Founded:       Year(969),
		LastUpdatedAt: time.Now(),
	},
	{
		Name:          "Dhaka",
		State:         "Dhaka",
		Country:       "BD",
		Population:    20183500,
		AreaSqKm:      306,
		IsCapital:     true,
		HasAirport:    true,
		Founded:       Year(1608),
		LastUpdatedAt: time.Now(),
	},
	{
		Name:          "Karachi",
		State:         "Sindh",
		Country:       "PK",
		Population:    15741000,
		AreaSqKm:      3780,
		IsCapital:     false,
		HasAirport:    true,
		Founded:       Year(1729),
		LastUpdatedAt: time.Now(),
	},
	{
		Name:          "Istanbul",
		State:         "Istanbul",
		Country:       "TR",
		Population:    15029231,
		AreaSqKm:      5343,
		IsCapital:     false,
		HasAirport:    true,
		Founded:       Year(660),
		LastUpdatedAt: time.Now(),
	},
}
View Source
var SortedCityIDs []string

Functions

func CityID added in v0.0.11

func CityID(city City) string

func Year

func Year(year int) time.Time

Types

type City

type City struct {
	Name          string
	State         string
	Country       string
	Population    int // in people
	AreaSqKm      int // in square kilometers
	IsCapital     bool
	HasAirport    bool
	Founded       time.Time
	LastUpdatedAt time.Time
}

Jump to

Keyboard shortcuts

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