pokemon

package
v0.0.0-...-8aa7e6e Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImageToString

func ImageToString(width, height uint, img image.Image) (string, error)

ImageToString converts an image to a string.

Types

type Model

type Model struct {
	Content  Pokemon
	ShowBack bool
}

func (*Model) SetContent

func (m *Model) SetContent(content Pokemon)

SetContent sets the content of the pokemon.

func (*Model) ToggleImage

func (m *Model) ToggleImage(showBack bool)

ToggleImage toggles between the front and back sprites.

func (Model) View

func (m Model) View() string

type Pokemon

type Pokemon struct {
	Count    int              `json:"count"`
	Next     string           `json:"next"`
	Previous string           `json:"previous"`
	Results  []PokemonDetails `json:"results"`
}

type PokemonDetails

type PokemonDetails struct {
	ID      string  `json:"id"`
	Name    string  `json:"name"`
	URL     string  `json:"url"`
	Order   int     `json:"order"`
	Sprites Sprites `json:"sprites"`
	Stats   []Stats `json:"stats"`
}

type Sprites

type Sprites struct {
	FrontDefault string `json:"front_default"`
	BackDefault  string `json:"back_default"`
}

type Stat

type Stat struct {
	Name string `json:"name"`
}

type Stats

type Stats struct {
	BaseStat int  `json:"base_stat"`
	Effort   int  `json:"effort"`
	Stat     Stat `json:"stat"`
}

Jump to

Keyboard shortcuts

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