countries

package
v0.0.0-...-a2ff8f4 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CapitalQuiz

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
}

Data for the capital quiz

func GetCapitalQuiz

func GetCapitalQuiz(variants, amount int) ([]CapitalQuiz, error)

Get a quiz in which you have to guess the capital of the specified country

type CountryData

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
}

Country data from the database

type CountryQuiz

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 country quiz

func GetCountryQuiz

func GetCountryQuiz(variants, amount int) ([]CountryQuiz, error)

Get a quiz in which you have to guess the name of the country from the image of its flag

Jump to

Keyboard shortcuts

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