Documentation ¶
Overview ¶
Package pokemon provides structs and functions for acccessing http://pokeapi.co
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ability ¶
type Ability struct { Name string `json:"name"` Id int `json:"id"` Resource_uri string `json:"resource_uri"` Created string `json:"created"` Modified string `json:"modified"` Description string `json:"description"` }
func GetAbility ¶
Returns an Ability object according to the input identifier. If an error occurs, returns an empty Ability object and a corresponding error object
type Description ¶
type Description struct { Name string `json:"name"` Id int `json:"id"` Resource_uri string `json:"resource_uri"` Created string `json:"created"` Modified string `json:"modified"` Games []Game `json:"games"` Pokemon Pokemon `json:"pokemon"` }
func GetDescription ¶
func GetDescription(identifier string) (description Description, err error)
Returns a Description object according to the input identifier. If an error occurs, returns an empty Description object and a corresponding error object
type EggGroup ¶
type EggGroup struct { Name string `json:"name"` Id int `json:"id"` Resource_uri string `json:"resource_uri"` Created string `json:"created"` Modified string `json:"modified"` Pokemon []Pokemon `json:"pokemon"` }
func GetEggGroup ¶
Returns an EggGroup object according to the input identifier. If an error occurs, returns an empty EggGroup object and a corresponding error object
type Game ¶
type Move ¶
type Move struct { Name string `json:"name"` Id int `json:"id"` Resource_uri string `json:"resource_uri"` Created string `json:"created"` Modified string `json:"modified"` Description string `json:"description"` Power int `json:"power"` Accuracy int `json:"accuracy"` Category string `json:"category"` Pp int `json:"pp"` }
type Pokedex ¶
type Pokedex struct { Name string `json:"name"` Resource_uri string `json:"resource_uri"` Created string `json:"created"` Modified string `json:"modified"` Pokemon []Pokemon `json:"pokemon"` }
func GetPokedex ¶
Returns a Pokedex object according to the input identifier. If an error occurs, returns an empty Pokedex object and a corresponding error object This is a special call and will only work for the identifier "1"
type Pokemon ¶
type Pokemon struct { Name string `json:"name"` National_id int `json:"national_id"` Resource_uri string `json:"resource_uri"` Created string `json:"created"` Modified string `json:"modified"` Abilites []Ability `json:"abilities"` Egg_groups []EggGroup `json:"egg_groups"` Evolutions []Evolution `json:"evolutions"` Descriptions []Description `json:"descriptions"` Moves []Pokemon_Move `json:"moves"` Types []Type `json:"types"` Catch_rate int `json:"catch_rate"` Species string `json:"species"` Hp int `json:"hp"` Attack int `json:"attack"` Defense int `json:"defense"` Sp_atk int `json:"sp_atk"` Sp_def int `json:"sp_def"` Speed int `json:"speed"` Egg_cycles int `json:"egg_cycles"` Ev_yield string `json:"ev_yield"` Exp int `json:"exp"` Growth_rate string `json:"growth_rate"` Happiness int `json:"happiness"` Height string `json:"height"` Male_female_ratio string `json:"male_female_ratio"` Pkdx_id int `json:"pkdx_id"` Sprites []Sprite `json:"sprites"` Total int `json:"total"` Weight string `json:"weight"` }
func GetPokemon ¶
Returns a Pokemon object according to the input identifier. If an error occurs, returns an empty Pokemon object and a corresponding error object The identifier can be either the Pokemon ID or Name
type Pokemon_Move ¶
type Sprite ¶
type Type ¶
type Type struct { Name string `json:"name"` Id int `json:"id"` Resource_uri string `json:"resource_uri"` Created string `json:created"` Modified string `json:"modified"` Ineffective []Type `json:"ineffective"` No_effect []Type `json:"no_effect"` Resistance []Type `json:"resistance"` Super_effective []Type `json:"super_effective"` Weakness []Type `json:"weakness"` }