pokego

package module
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 17 Imported by: 0

README

PokeGO

Go Reference Go Report Card CI

PokeGO is a Go package that provides bindings to the Pokeapi. It caches to a local SQLite database.

Getting Started

Installing
go get github.com/mazylol/pokego
Usage

Import the package into your project.

import "github.com/mazylol/pokego"

Use the GetPokemon function to get a Pokemon of the provided name.

pokemon, err := pokego.GetPokemon("slugma")

// Print out name
fmt.Println(pokemon.Name)

You can also get a list of every Pokemon name.

pokemonList, err := pokego.GetResourceList("pokemon", 35) // 35 is how many pokemon it will get
	
// Print out the first Pokemons name
fmt.Println(pokemonList.Results[0].Name)

Features

  • Resource Lists/Pagination

  • Berries
  • Contests
  • Encounters
  • Evolution
  • Games
  • Items
  • Locations
  • Machines
  • Moves
  • Pokemon

  • Utility

Contributions <3

Contributors are very welcome. I still have a lot of ground to cover and any help is greatly appreciated. Refer to the features to see what needs done.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAilment added in v0.5.0

func GetAilment(name string) (moves.Ailment, error)

GetAilment returns a Move struct containing information about the Move with the given name.

func GetBattleStyle added in v0.5.0

func GetBattleStyle(name string) (moves.BattleStyle, error)

GetBattleStyle returns a Move struct containing information about the Move with the given name.

func GetBerry added in v0.6.2

func GetBerry(name string) (berries.Berry, error)

GetBerry returns a berry by name.

func GetBerryFirmness added in v0.6.2

func GetBerryFirmness(name string) (berries.Firmness, error)

GetBerryFirmness returns a berry firmness by name.

func GetBerryFlavor added in v0.6.2

func GetBerryFlavor(name string) (berries.Flavor, error)

GetBerryFlavor returns a berry flavor by name.

func GetCategory added in v0.5.0

func GetCategory(name string) (moves.Category, error)

GetCategory returns a Move struct containing information about the Move with the given name.

func GetContestEffect added in v0.7.0

func GetContestEffect(id int) (contests.Effect, error)

GetContestEffect returns a ContestEffect struct containing information about the ContestEffect with the given id.

func GetContestType added in v0.7.0

func GetContestType(name string) (contests.Type, error)

GetContestType returns a ContestType struct containing information about the ContestType with the given name.

func GetDamageClass added in v0.5.0

func GetDamageClass(name string) (moves.DamageClass, error)

GetDamageClass returns a Move struct containing information about the Move with the given name.

func GetEncounterCondition added in v0.7.0

func GetEncounterCondition(name string) (encounters.Condition, error)

GetEncounterCondition returns a EncounterCondition struct containing information about the EncounterCondition with the given name.

func GetEncounterConditionValue added in v0.7.0

func GetEncounterConditionValue(name string) (encounters.ConditionValue, error)

GetEncounterConditionValue returns a EncounterConditionValue struct containing information about the EncounterConditionValue with the given name.

func GetEncounterMethod added in v0.7.0

func GetEncounterMethod(name string) (encounters.Method, error)

GetEncounterMethod returns a EncounterMethod struct containing information about the EncounterMethod with the given name.

func GetLearnMethod added in v0.5.0

func GetLearnMethod(name string) (moves.LearnMethod, error)

GetLearnMethod returns a Move struct containing information about the Move with the given name.

func GetMove added in v0.3.0

func GetMove(name string) (moves.Move, error)

GetMove returns a Move struct containing information about the Move with the given name.

func GetPokemon

func GetPokemon(name string) (pokemon.Pokemon, error)

GetPokemon returns a Pokemon struct containing information about the Pokemon with the given name.

func GetPokemonAbility added in v0.4.0

func GetPokemonAbility(name string) (pokemon.Ability, error)

GetPokemonAbility returns an Ability struct containing information about the Ability with the given name.

func GetPokemonCharacteristic added in v0.4.0

func GetPokemonCharacteristic(id int) (pokemon.Characteristic, error)

GetPokemonCharacteristic returns a Characteristic struct containing information about the Characteristic with the given id.

func GetPokemonColor added in v0.4.0

func GetPokemonColor(name string) (pokemon.Color, error)

GetPokemonColor returns a Color struct containing information about the Color with the given name.

func GetPokemonEggGroup added in v0.4.0

func GetPokemonEggGroup(name string) (pokemon.EggGroup, error)

GetPokemonEggGroup returns an EggGroup struct containing information about the EggGroup with the given name.

func GetPokemonForm added in v0.4.0

func GetPokemonForm(name string) (pokemon.Form, error)

GetPokemonForm returns a Form struct containing information about the Form with the given name.

func GetPokemonGender added in v0.4.0

func GetPokemonGender(name string) (pokemon.Gender, error)

GetPokemonGender returns a Gender struct containing information about the EggGroup with the given name.

func GetPokemonGrowthRate added in v0.4.0

func GetPokemonGrowthRate(name string) (pokemon.GrowthRate, error)

GetPokemonGrowthRate returns a GrowthRate struct containing information about the GrowthRate with the given name.

func GetPokemonHabitat added in v0.4.0

func GetPokemonHabitat(name string) (pokemon.Habitat, error)

GetPokemonHabitat returns a Habitat struct containing information about the Habitat with the given name.

func GetPokemonLocationArea added in v0.4.0

func GetPokemonLocationArea(name string) ([]pokemon.LocationArea, error)

GetPokemonLocationArea returns a PokemonLocationArea struct containing information about the PokemonLocationArea with the given name.

func GetPokemonNature added in v0.4.0

func GetPokemonNature(name string) (pokemon.Nature, error)

GetPokemonNature returns a Nature struct containing information about the Nature with the given name.

func GetPokemonPokeathlonStats added in v0.4.0

func GetPokemonPokeathlonStats(name string) (pokemon.PokeathlonStat, error)

GetPokemonPokeathlonStats returns a PokeathlonStat struct containing information about the PokeathlonStat with the given name.

func GetPokemonShape added in v0.4.0

func GetPokemonShape(name string) (pokemon.Shape, error)

GetPokemonShape returns a Shape struct containing information about the Shape with the given name.

func GetPokemonSpecies added in v0.4.0

func GetPokemonSpecies(name string) (pokemon.Species, error)

GetPokemonSpecies returns a Species struct containing information about the Species with the given name.

func GetPokemonStat added in v0.4.0

func GetPokemonStat(name string) (pokemon.Stat, error)

GetPokemonStat returns a Stat struct containing information about the Stat with the given name.

func GetPokemonType added in v0.4.0

func GetPokemonType(name string) (pokemon.Type, error)

GetPokemonType returns a Type struct containing information about the Type with the given name.

func GetResourceList added in v0.4.0

func GetResourceList(endpoint string, count int) (resource.List, error)

GetResourceList returns a ResourceList struct containing information about the list of resources with the given name.

func GetSuperContestEffect added in v0.7.0

func GetSuperContestEffect(id int) (contests.SuperEffect, error)

GetSuperContestEffect returns a SuperContestEffect struct containing information about the SuperContestEffect with the given id.

func GetTarget added in v0.5.0

func GetTarget(name string) (moves.Target, error)

GetTarget returns a Move struct containing information about the Move with the given name.

Types

This section is empty.

Directories

Path Synopsis
types

Jump to

Keyboard shortcuts

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