pokeapi

package
v0.0.0-...-82988be Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLocationArea

func GetLocationArea(url string, cf *pokecache.Cache) (*locationArea, error)

func GetPokemonInLocationArea

func GetPokemonInLocationArea(url string, cf *pokecache.Cache) (*pokemonInArea, error)

Types

type Pokemon

type Pokemon struct {
	ASCIIArt               []string
	Name                   string `json:"name"`
	BaseExperience         int    `json:"base_experience"`
	Height                 int    `json:"height"`
	Weight                 int    `json:"weight"`
	LocationAreaEncounters string `json:"location_area_encounters"`
	Sprites                struct {
		Others struct {
			OfficialArtwork struct {
				FrontDefault string `json:"front_default"`
			} `json:"official-artwork"`
		} `json:"other"`
	} `json:"sprites"`

	Stats []struct {
		BaseStat int `json:"base_stat"`
		Effort   int `json:"effort"`
		Stat     struct {
			Name string `json:"name"`
			URL  string `json:"url"`
		} `json:"stat"`
	} `json:"stats"`
	Types []struct {
		Type struct {
			Name string `json:"name"`
			URL  string `json:"url"`
		} `json:"type"`
	} `json:"types"`
}

func GetPokemon

func GetPokemon(url string, cf *pokecache.Cache) (*Pokemon, error)

Jump to

Keyboard shortcuts

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