pokemon

package module
v0.0.0-...-9487194 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2014 License: MIT Imports: 2 Imported by: 0

README

go-pokemon

GoDoc Build Status

A Go wrapper for PokéAPI http://pokeapi.co

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

func GetAbility(identifier string) (ability Ability, err error)

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

func GetEggGroup(identifier string) (eggGroup EggGroup, err error)

Returns an EggGroup object according to the input identifier. If an error occurs, returns an empty EggGroup object and a corresponding error object

type Evolution

type Evolution struct {
	Level       int    `json:"level"`
	Method      string `json:"method"`
	Resouce_uri string `json:"resource_uri"`
	To          string `json:"to"`
}

type Game

type Game struct {
	Name         string `json:"name"`
	Id           int    `json:"id"`
	Resource_uri string `json:"resource_uri"`
	Created      string `json:"created"`
	Modified     string `json:"modified"`
	Release_year int    `json:"release"year"`
	Generation   int    `json:"generation"`
}

func GetGame

func GetGame(identifier string) (game Game, err error)

Returns a Game object according to the input identifier. If an error occurs, returns an empty Game object and a corresponding error object

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"`
}

func GetMove

func GetMove(identifier string) (move Move, err error)

Returns a Move object according to the input identifier. If an error occurs, returns an empty Move object and a corresponding error object

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

func GetPokedex(identifier string) (pokedex Pokedex, err error)

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

func GetPokemon(identifier string) (pokemon Pokemon, err error)

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 Pokemon_Move struct {
	Learn_type   string `json:"learn_type"`
	Name         string `json:"name"`
	Resource_uri string `json:"resource_uri"`
	Level        int    `json:"level"`
}

type Sprite

type Sprite struct {
	Name        string  `json:"name"`
	Id          int     `json:"id"`
	Resouce_uri string  `json:"resource_uri"`
	Created     string  `json:"created"`
	Modified    string  `json:"modified"`
	Pokemon     Pokemon `json:"pokemon"`
	Image       string  `json:"image"`
}

func GetSprite

func GetSprite(identifier string) (sprite Sprite, err error)

Returns a Sprite object according to the input identifier. If an error occurs, returns an empty Sprite object and a corresponding error object

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"`
}

func GetType

func GetType(identifier string) (type_ Type, err error)

Returns a Type object according to the input identifier. If an error occurs, returns an empty Type object and a corresponding error object

Jump to

Keyboard shortcuts

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