Exemple #1
0
func (self *Country) StartUp() {

	self.Database = persistent.Database("default")

	self.Collection = self.Database.Collection("countries")

	self.Collection.Truncate()

	self.Collection.Append(
		db.Item{"code": "AF", "name": "Afghanistan"},
		db.Item{"code": "AX", "name": "Åland Islands"},
		db.Item{"code": "AL", "name": "Albania"},
		db.Item{"code": "DZ", "name": "Algeria"},
		db.Item{"code": "AS", "name": "American Samoa"},
		db.Item{"code": "AD", "name": "Andorra"},
		db.Item{"code": "AO", "name": "Angola"},
		db.Item{"code": "AI", "name": "Anguilla"},
		db.Item{"code": "AQ", "name": "Antarctica"},
		db.Item{"code": "AG", "name": "Antigua and Barbuda"},
		db.Item{"code": "AR", "name": "Argentina"},
		db.Item{"code": "AM", "name": "Armenia"},
		db.Item{"code": "AW", "name": "Aruba"},
		db.Item{"code": "AU", "name": "Australia"},
		db.Item{"code": "AT", "name": "Austria"},
		db.Item{"code": "AZ", "name": "Azerbaijan"},
		db.Item{"code": "BS", "name": "Bahamas"},
		db.Item{"code": "BH", "name": "Bahrain"},
		db.Item{"code": "BD", "name": "Bangladesh"},
		db.Item{"code": "BB", "name": "Barbados"},
		db.Item{"code": "BY", "name": "Belarus"},
		db.Item{"code": "BE", "name": "Belgium"},
		db.Item{"code": "BZ", "name": "Belize"},
		db.Item{"code": "BJ", "name": "Benin"},
		db.Item{"code": "BM", "name": "Bermuda"},
		db.Item{"code": "BT", "name": "Bhutan"},
		db.Item{"code": "BO", "name": "Bolivia"},
		db.Item{"code": "BA", "name": "Bosnia and Herzegovina"},
		db.Item{"code": "BW", "name": "Botswana"},
		db.Item{"code": "BV", "name": "Bouvet Island"},
		db.Item{"code": "BR", "name": "Brazil"},
		db.Item{"code": "IO", "name": "British Indian Ocean Territory"},
		db.Item{"code": "BN", "name": "Brunei Darussalam"},
		db.Item{"code": "BG", "name": "Bulgaria"},
		db.Item{"code": "BF", "name": "Burkina Faso"},
		db.Item{"code": "BI", "name": "Burundi"},
		db.Item{"code": "KH", "name": "Cambodia"},
		db.Item{"code": "CM", "name": "Cameroon"},
		db.Item{"code": "CA", "name": "Canada"},
		db.Item{"code": "CV", "name": "Cape Verde"},
		db.Item{"code": "KY", "name": "Cayman Islands"},
		db.Item{"code": "CF", "name": "Central African Republic"},
		db.Item{"code": "TD", "name": "Chad"},
		db.Item{"code": "CL", "name": "Chile"},
		db.Item{"code": "CN", "name": "China"},
		db.Item{"code": "CX", "name": "Christmas Island"},
		db.Item{"code": "CC", "name": "Cocos (Keeling) Islands"},
		db.Item{"code": "CO", "name": "Colombia"},
		db.Item{"code": "KM", "name": "Comoros"},
		db.Item{"code": "CG", "name": "Congo"},
		db.Item{"code": "CD", "name": "Congo, The Democratic Republic of The"},
		db.Item{"code": "CK", "name": "Cook Islands"},
		db.Item{"code": "CR", "name": "Costa Rica"},
		db.Item{"code": "CI", "name": "Cote D'ivoire"},
		db.Item{"code": "HR", "name": "Croatia"},
		db.Item{"code": "CU", "name": "Cuba"},
		db.Item{"code": "CY", "name": "Cyprus"},
		db.Item{"code": "CZ", "name": "Czech Republic"},
		db.Item{"code": "DK", "name": "Denmark"},
		db.Item{"code": "DJ", "name": "Djibouti"},
		db.Item{"code": "DM", "name": "Dominica"},
		db.Item{"code": "DO", "name": "Dominican Republic"},
		db.Item{"code": "EC", "name": "Ecuador"},
		db.Item{"code": "EG", "name": "Egypt"},
		db.Item{"code": "SV", "name": "El Salvador"},
		db.Item{"code": "GQ", "name": "Equatorial Guinea"},
		db.Item{"code": "ER", "name": "Eritrea"},
		db.Item{"code": "EE", "name": "Estonia"},
		db.Item{"code": "ET", "name": "Ethiopia"},
		db.Item{"code": "FK", "name": "Falkland Islands (Malvinas)"},
		db.Item{"code": "FO", "name": "Faroe Islands"},
		db.Item{"code": "FJ", "name": "Fiji"},
		db.Item{"code": "FI", "name": "Finland"},
		db.Item{"code": "FR", "name": "France"},
		db.Item{"code": "GF", "name": "French Guiana"},
		db.Item{"code": "PF", "name": "French Polynesia"},
		db.Item{"code": "TF", "name": "French Southern Territories"},
		db.Item{"code": "GA", "name": "Gabon"},
		db.Item{"code": "GM", "name": "Gambia"},
		db.Item{"code": "GE", "name": "Georgia"},
		db.Item{"code": "DE", "name": "Germany"},
		db.Item{"code": "GH", "name": "Ghana"},
		db.Item{"code": "GI", "name": "Gibraltar"},
		db.Item{"code": "GR", "name": "Greece"},
		db.Item{"code": "GL", "name": "Greenland"},
		db.Item{"code": "GD", "name": "Grenada"},
		db.Item{"code": "GP", "name": "Guadeloupe"},
		db.Item{"code": "GU", "name": "Guam"},
		db.Item{"code": "GT", "name": "Guatemala"},
		db.Item{"code": "GG", "name": "Guernsey"},
		db.Item{"code": "GN", "name": "Guinea"},
		db.Item{"code": "GW", "name": "Guinea-bissau"},
		db.Item{"code": "GY", "name": "Guyana"},
		db.Item{"code": "HT", "name": "Haiti"},
		db.Item{"code": "HM", "name": "Heard Island and Mcdonald Islands"},
		db.Item{"code": "VA", "name": "Holy See (Vatican City State)"},
		db.Item{"code": "HN", "name": "Honduras"},
		db.Item{"code": "HK", "name": "Hong Kong"},
		db.Item{"code": "HU", "name": "Hungary"},
		db.Item{"code": "IS", "name": "Iceland"},
		db.Item{"code": "IN", "name": "India"},
		db.Item{"code": "ID", "name": "Indonesia"},
		db.Item{"code": "IR", "name": "Iran, Islamic Republic of"},
		db.Item{"code": "IQ", "name": "Iraq"},
		db.Item{"code": "IE", "name": "Ireland"},
		db.Item{"code": "IM", "name": "Isle of Man"},
		db.Item{"code": "IL", "name": "Israel"},
		db.Item{"code": "IT", "name": "Italy"},
		db.Item{"code": "JM", "name": "Jamaica"},
		db.Item{"code": "JP", "name": "Japan"},
		db.Item{"code": "JE", "name": "Jersey"},
		db.Item{"code": "JO", "name": "Jordan"},
		db.Item{"code": "KZ", "name": "Kazakhstan"},
		db.Item{"code": "KE", "name": "Kenya"},
		db.Item{"code": "KI", "name": "Kiribati"},
		db.Item{"code": "KP", "name": "Korea, Democratic People's Republic of"},
		db.Item{"code": "KR", "name": "Korea, Republic of"},
		db.Item{"code": "KW", "name": "Kuwait"},
		db.Item{"code": "KG", "name": "Kyrgyzstan"},
		db.Item{"code": "LA", "name": "Lao People's Democratic Republic"},
		db.Item{"code": "LV", "name": "Latvia"},
		db.Item{"code": "LB", "name": "Lebanon"},
		db.Item{"code": "LS", "name": "Lesotho"},
		db.Item{"code": "LR", "name": "Liberia"},
		db.Item{"code": "LY", "name": "Libyan Arab Jamahiriya"},
		db.Item{"code": "LI", "name": "Liechtenstein"},
		db.Item{"code": "LT", "name": "Lithuania"},
		db.Item{"code": "LU", "name": "Luxembourg"},
		db.Item{"code": "MO", "name": "Macao"},
		db.Item{"code": "MK", "name": "Macedonia, The Former Yugoslav Republic of"},
		db.Item{"code": "MG", "name": "Madagascar"},
		db.Item{"code": "MW", "name": "Malawi"},
		db.Item{"code": "MY", "name": "Malaysia"},
		db.Item{"code": "MV", "name": "Maldives"},
		db.Item{"code": "ML", "name": "Mali"},
		db.Item{"code": "MT", "name": "Malta"},
		db.Item{"code": "MH", "name": "Marshall Islands"},
		db.Item{"code": "MQ", "name": "Martinique"},
		db.Item{"code": "MR", "name": "Mauritania"},
		db.Item{"code": "MU", "name": "Mauritius"},
		db.Item{"code": "YT", "name": "Mayotte"},
		db.Item{"code": "MX", "name": "Mexico"},
		db.Item{"code": "FM", "name": "Micronesia, Federated States of"},
		db.Item{"code": "MD", "name": "Moldova, Republic of"},
		db.Item{"code": "MC", "name": "Monaco"},
		db.Item{"code": "MN", "name": "Mongolia"},
		db.Item{"code": "ME", "name": "Montenegro"},
		db.Item{"code": "MS", "name": "Montserrat"},
		db.Item{"code": "MA", "name": "Morocco"},
		db.Item{"code": "MZ", "name": "Mozambique"},
		db.Item{"code": "MM", "name": "Myanmar"},
		db.Item{"code": "NA", "name": "Namibia"},
		db.Item{"code": "NR", "name": "Nauru"},
		db.Item{"code": "NP", "name": "Nepal"},
		db.Item{"code": "NL", "name": "Netherlands"},
		db.Item{"code": "AN", "name": "Netherlands Antilles"},
		db.Item{"code": "NC", "name": "New Caledonia"},
		db.Item{"code": "NZ", "name": "New Zealand"},
		db.Item{"code": "NI", "name": "Nicaragua"},
		db.Item{"code": "NE", "name": "Niger"},
		db.Item{"code": "NG", "name": "Nigeria"},
		db.Item{"code": "NU", "name": "Niue"},
		db.Item{"code": "NF", "name": "Norfolk Island"},
		db.Item{"code": "MP", "name": "Northern Mariana Islands"},
		db.Item{"code": "NO", "name": "Norway"},
		db.Item{"code": "OM", "name": "Oman"},
		db.Item{"code": "PK", "name": "Pakistan"},
		db.Item{"code": "PW", "name": "Palau"},
		db.Item{"code": "PS", "name": "Palestinian Territory, Occupied"},
		db.Item{"code": "PA", "name": "Panama"},
		db.Item{"code": "PG", "name": "Papua New Guinea"},
		db.Item{"code": "PY", "name": "Paraguay"},
		db.Item{"code": "PE", "name": "Peru"},
		db.Item{"code": "PH", "name": "Philippines"},
		db.Item{"code": "PN", "name": "Pitcairn"},
		db.Item{"code": "PL", "name": "Poland"},
		db.Item{"code": "PT", "name": "Portugal"},
		db.Item{"code": "PR", "name": "Puerto Rico"},
		db.Item{"code": "QA", "name": "Qatar"},
		db.Item{"code": "RE", "name": "Reunion"},
		db.Item{"code": "RO", "name": "Romania"},
		db.Item{"code": "RU", "name": "Russian Federation"},
		db.Item{"code": "RW", "name": "Rwanda"},
		db.Item{"code": "SH", "name": "Saint Helena"},
		db.Item{"code": "KN", "name": "Saint Kitts and Nevis"},
		db.Item{"code": "LC", "name": "Saint Lucia"},
		db.Item{"code": "PM", "name": "Saint Pierre and Miquelon"},
		db.Item{"code": "VC", "name": "Saint Vincent and The Grenadines"},
		db.Item{"code": "WS", "name": "Samoa"},
		db.Item{"code": "SM", "name": "San Marino"},
		db.Item{"code": "ST", "name": "Sao Tome and Principe"},
		db.Item{"code": "SA", "name": "Saudi Arabia"},
		db.Item{"code": "SN", "name": "Senegal"},
		db.Item{"code": "RS", "name": "Serbia"},
		db.Item{"code": "SC", "name": "Seychelles"},
		db.Item{"code": "SL", "name": "Sierra Leone"},
		db.Item{"code": "SG", "name": "Singapore"},
		db.Item{"code": "SK", "name": "Slovakia"},
		db.Item{"code": "SI", "name": "Slovenia"},
		db.Item{"code": "SB", "name": "Solomon Islands"},
		db.Item{"code": "SO", "name": "Somalia"},
		db.Item{"code": "ZA", "name": "South Africa"},
		db.Item{"code": "GS", "name": "South Georgia and The South Sandwich Islands"},
		db.Item{"code": "ES", "name": "Spain"},
		db.Item{"code": "LK", "name": "Sri Lanka"},
		db.Item{"code": "SD", "name": "Sudan"},
		db.Item{"code": "SR", "name": "Suriname"},
		db.Item{"code": "SJ", "name": "Svalbard and Jan Mayen"},
		db.Item{"code": "SZ", "name": "Swaziland"},
		db.Item{"code": "SE", "name": "Sweden"},
		db.Item{"code": "CH", "name": "Switzerland"},
		db.Item{"code": "SY", "name": "Syrian Arab Republic"},
		db.Item{"code": "TW", "name": "Taiwan, Province of China"},
		db.Item{"code": "TJ", "name": "Tajikistan"},
		db.Item{"code": "TZ", "name": "Tanzania, United Republic of"},
		db.Item{"code": "TH", "name": "Thailand"},
		db.Item{"code": "TL", "name": "Timor-leste"},
		db.Item{"code": "TG", "name": "Togo"},
		db.Item{"code": "TK", "name": "Tokelau"},
		db.Item{"code": "TO", "name": "Tonga"},
		db.Item{"code": "TT", "name": "Trinidad and Tobago"},
		db.Item{"code": "TN", "name": "Tunisia"},
		db.Item{"code": "TR", "name": "Turkey"},
		db.Item{"code": "TM", "name": "Turkmenistan"},
		db.Item{"code": "TC", "name": "Turks and Caicos Islands"},
		db.Item{"code": "TV", "name": "Tuvalu"},
		db.Item{"code": "UG", "name": "Uganda"},
		db.Item{"code": "UA", "name": "Ukraine"},
		db.Item{"code": "AE", "name": "United Arab Emirates"},
		db.Item{"code": "GB", "name": "United Kingdom"},
		db.Item{"code": "US", "name": "United States"},
		db.Item{"code": "UM", "name": "United States Minor Outlying Islands"},
		db.Item{"code": "UY", "name": "Uruguay"},
		db.Item{"code": "UZ", "name": "Uzbekistan"},
		db.Item{"code": "VU", "name": "Vanuatu"},
		db.Item{"code": "VE", "name": "Venezuela"},
		db.Item{"code": "VN", "name": "Viet Nam"},
		db.Item{"code": "VG", "name": "Virgin Islands, British"},
		db.Item{"code": "VI", "name": "Virgin Islands, U.S."},
		db.Item{"code": "WF", "name": "Wallis and Futuna"},
		db.Item{"code": "EH", "name": "Western Sahara"},
		db.Item{"code": "YE", "name": "Yemen"},
		db.Item{"code": "ZM", "name": "Zambia"},
		db.Item{"code": "ZW", "name": "Zimbabwe"},
	)
}
Exemple #2
0
func (self *Country) StartUp() {
	self.Database = persistent.Database("default")
}