api

package
v0.0.0-...-4df2eac Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CatchPokemon

func CatchPokemon(config *Config, pokemonName string) (bool, error)

Types

type Config

type Config struct {
	Next           string
	Previous       string
	Cashe          *pokecashe.Cashe
	CaughtPokemons map[string]Pokemon
}

type LocationAreas

type LocationAreas struct {
	Count    int    `json:"count"`
	Next     string `json:"next"`
	Previous string `json:"previous"`
	Results  []struct {
		Name string `json:"name"`
		URL  string `json:"url"`
	} `json:"results"`
}

func GetLocationAreas

func GetLocationAreas(config *Config, direction string) (LocationAreas, error)

type Pokemon

type Pokemon struct {
	Name   string `json:"name"`
	Height int    `json:"height"`
	Weight int    `json:"weight"`
	Stats  []struct {
		Base_Stat int `json:"base_stat"`
		Stat      struct {
			Name string `json:"name"`
		} `json:"stat"`
	} `json:"stats"`
	Types []struct {
		Type struct {
			Name string `json:"name"`
		} `json:"type"`
	} `json:"types"`
	Exp int `json:"base_experience"`
}

func (Pokemon) String

func (p Pokemon) String() string

type Pokemons

type Pokemons struct {
	PokemonEncounters []struct {
		Pokemon struct {
			Name string `json:"name"`
		} `json:"pokemon"`
	} `json:"pokemon_encounters"`
}

func GetPokemonsInLocation

func GetPokemonsInLocation(config *Config, location string) (Pokemons, error)

Jump to

Keyboard shortcuts

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