Documentation
¶
Index ¶
- func CheckAnswer(m *Model)
- func CreateDir(cacheDir string)
- func CreateJsonCacheFile(jsonFile string) *os.File
- func EndingScreen(m Model) string
- func MakeOptions() (Country, []Country)
- func PopulateOptions(m *Model)
- func PopulateRandomOptions(m *Model)
- func Render(m Model, style lipgloss.Style) string
- func RenderAscii(imagePath string) string
- func RenderFlag(m Model, style lipgloss.Style) string
- func SaveImage(country Country)
- func ShuffleOptions(m *Model)
- func StartingScreen() string
- func TrimSpace(s string) string
- func WriteJsonToCacheFile()
- type Country
- type Flags
- type Model
- type Name
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAnswer ¶
func CheckAnswer(m *Model)
func CreateJsonCacheFile ¶
func EndingScreen ¶
func MakeOptions ¶
Get one random country and 3 other countries, isolated one will be the prompetd flag
func PopulateOptions ¶
func PopulateOptions(m *Model)
func PopulateRandomOptions ¶
func PopulateRandomOptions(m *Model)
func RenderAscii ¶
func ShuffleOptions ¶
func ShuffleOptions(m *Model)
func StartingScreen ¶
func StartingScreen() string
func WriteJsonToCacheFile ¶
func WriteJsonToCacheFile()
Types ¶
type Country ¶
type Country struct { Name Name `json:"name"` Flags Flags `json:"flags"` Capital []string `json:"capital"` }
func GetAllCountries ¶
func GetAllCountries() []Country
func GetRandomCountriesN ¶
Get N amount of random countries
func ReadCountries ¶
func ReadCountries() []Country
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func InitialModel ¶
func InitialModel() Model
Click to show internal directories.
Click to hide internal directories.