-
Notifications
You must be signed in to change notification settings - Fork 4
/
types.go
23 lines (20 loc) 路 851 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package countries
// Country data from the database
type CountryData struct {
Code string `json:"code"` // ISO 3166-1 alpha-2 code of the country
Country string `json:"country"` // The name of the country
Capital string `json:"capital"` // The name of the capital of the country
}
// Data for the country quiz
type CountryQuiz struct {
Flag string `json:"flag"` // Link to the image of the country's flag
Variants []string `json:"variants"` // Answer options
Answer string `json:"answer"` // Correct answer
}
// Data for the capital quiz
type CapitalQuiz struct {
Country string `json:"country"` // The name of the country
Flag string `json:"flag"` // Link to the image of the country's flag
Variants []string `json:"variants"` // Answer options
Answer string `json:"answer"` // Correct answer
}