Add Go-based PokeAPI fetch tool

Replaces the Python fetch_pokeapi.py script with a Go tool that crawls
a local PokeAPI instance and writes seed JSON files. Supports caching
and special encounter definitions via JSON config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-07 19:44:05 +01:00
parent ab6c1adb1f
commit 0bf628157f
9 changed files with 1575 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
package main
// Output JSON structs — identical schema to current Python output.
type GameOutput struct {
Name string `json:"name"`
Slug string `json:"slug"`
Generation int `json:"generation"`
Region string `json:"region"`
ReleaseYear int `json:"release_year"`
Color *string `json:"color"`
}
type PokemonOutput struct {
PokeAPIID int `json:"pokeapi_id"`
NationalDex int `json:"national_dex"`
Name string `json:"name"`
Types []string `json:"types"`
SpriteURL string `json:"sprite_url"`
}
type EvolutionOutput struct {
FromPokeAPIID int `json:"from_pokeapi_id"`
ToPokeAPIID int `json:"to_pokeapi_id"`
Trigger string `json:"trigger"`
MinLevel *int `json:"min_level"`
Item *string `json:"item"`
HeldItem *string `json:"held_item"`
Condition *string `json:"condition"`
}
type RouteOutput struct {
Name string `json:"name"`
Order int `json:"order"`
Encounters []EncounterOutput `json:"encounters"`
Children []RouteOutput `json:"children,omitempty"`
}
type EncounterOutput struct {
PokeAPIID int `json:"pokeapi_id"`
PokemonName string `json:"pokemon_name"`
Method string `json:"method"`
EncounterRate int `json:"encounter_rate"`
MinLevel int `json:"min_level"`
MaxLevel int `json:"max_level"`
}