Skip to content

Commit

Permalink
Added an http app to test http parser (#113)
Browse files Browse the repository at this point in the history
* added http app to test http parser

Signed-off-by: dhruv <[email protected]>

* fixes

Signed-off-by: dhruv <[email protected]>

* added http app to test http parser

Signed-off-by: dhruv <[email protected]>

* added docker compose

Signed-off-by: dhruv <[email protected]>

---------

Signed-off-by: dhruv <[email protected]>
  • Loading branch information
jaydee029 authored Aug 12, 2024
1 parent 2afb959 commit 3ec7797
Show file tree
Hide file tree
Showing 20 changed files with 1,022 additions and 0 deletions.
18 changes: 18 additions & 0 deletions http-pokeapi/.github/workflows/keploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Keploy
on:
push:
branches: [main, master]
pull_request:
types: [opened, reopened, synchronize]
jobs:
e2e-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test-Report
uses: keploy/testgpt@main
with:
working-directory: ./
keploy-path: ./
command: ./http-pokeapi
9 changes: 9 additions & 0 deletions http-pokeapi/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM --platform=linux/amd64 debian:stable-slim

RUN apt-get update && apt-get install -y ca-certificates

ADD http-pokeapi /usr/bin/http-pokeapi

EXPOSE 8080

CMD ["http-pokeapi"]
8 changes: 8 additions & 0 deletions http-pokeapi/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3'
services:
http-pokeapi:
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
5 changes: 5 additions & 0 deletions http-pokeapi/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module http-pokeapi

go 1.21.6

require github.com/go-chi/chi v1.5.5
2 changes: 2 additions & 0 deletions http-pokeapi/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/go-chi/chi v1.5.5 h1:vOB/HbEMt9QqBqErz07QehcOKHaWFtuj87tTDVz2qXE=
github.com/go-chi/chi v1.5.5/go.mod h1:C9JqLr3tIYjDOZpzn+BCuxY8z8vmca43EeMgyZt7irw=
Binary file added http-pokeapi/http-pokeapi
Binary file not shown.
64 changes: 64 additions & 0 deletions http-pokeapi/internal/models/location_models.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package models

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

type Pokelocation struct {
EncounterMethodRates []struct {
EncounterMethod struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"encounter_method"`
VersionDetails []struct {
Rate int `json:"rate"`
Version struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"version"`
} `json:"version_details"`
} `json:"encounter_method_rates"`
GameIndex int `json:"game_index"`
ID int `json:"id"`
Location struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"location"`
Name string `json:"name"`
Names []struct {
Language struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"language"`
Name string `json:"name"`
} `json:"names"`
PokemonEncounters []struct {
Pokemon struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"pokemon"`
VersionDetails []struct {
EncounterDetails []struct {
Chance int `json:"chance"`
ConditionValues []interface{} `json:"condition_values"`
MaxLevel int `json:"max_level"`
Method struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"method"`
MinLevel int `json:"min_level"`
} `json:"encounter_details"`
MaxChance int `json:"max_chance"`
Version struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"version"`
} `json:"version_details"`
} `json:"pokemon_encounters"`
}
273 changes: 273 additions & 0 deletions http-pokeapi/internal/models/pokemon_models.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
package models

type Pokemon struct {
ID int `json:"id"`
Name string `json:"name"`
BaseExperience int `json:"base_experience"`
Height int `json:"height"`
IsDefault bool `json:"is_default"`
Order int `json:"order"`
Weight int `json:"weight"`
Abilities []struct {
IsHidden bool `json:"is_hidden"`
Slot int `json:"slot"`
Ability struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"ability"`
} `json:"abilities"`
Forms []struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"forms"`
GameIndices []struct {
GameIndex int `json:"game_index"`
Version struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"version"`
} `json:"game_indices"`
HeldItems []struct {
Item struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"item"`
VersionDetails []struct {
Rarity int `json:"rarity"`
Version struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"version"`
} `json:"version_details"`
} `json:"held_items"`
LocationAreaEncounters string `json:"location_area_encounters"`
Moves []struct {
Move struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"move"`
VersionGroupDetails []struct {
LevelLearnedAt int `json:"level_learned_at"`
VersionGroup struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"version_group"`
MoveLearnMethod struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"move_learn_method"`
} `json:"version_group_details"`
} `json:"moves"`
Species struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"species"`
Sprites struct {
BackDefault string `json:"back_default"`
BackFemale interface{} `json:"back_female"`
BackShiny string `json:"back_shiny"`
BackShinyFemale interface{} `json:"back_shiny_female"`
FrontDefault string `json:"front_default"`
FrontFemale interface{} `json:"front_female"`
FrontShiny string `json:"front_shiny"`
FrontShinyFemale interface{} `json:"front_shiny_female"`
Other struct {
DreamWorld struct {
FrontDefault string `json:"front_default"`
FrontFemale interface{} `json:"front_female"`
} `json:"dream_world"`
Home struct {
FrontDefault string `json:"front_default"`
FrontFemale interface{} `json:"front_female"`
FrontShiny string `json:"front_shiny"`
FrontShinyFemale interface{} `json:"front_shiny_female"`
} `json:"home"`
OfficialArtwork struct {
FrontDefault string `json:"front_default"`
FrontShiny string `json:"front_shiny"`
} `json:"official-artwork"`
Showdown struct {
BackDefault string `json:"back_default"`
BackFemale interface{} `json:"back_female"`
BackShiny string `json:"back_shiny"`
BackShinyFemale interface{} `json:"back_shiny_female"`
FrontDefault string `json:"front_default"`
FrontFemale interface{} `json:"front_female"`
FrontShiny string `json:"front_shiny"`
FrontShinyFemale interface{} `json:"front_shiny_female"`
} `json:"showdown"`
} `json:"other"`
Versions struct {
GenerationI struct {
RedBlue struct {
BackDefault string `json:"back_default"`
BackGray string `json:"back_gray"`
FrontDefault string `json:"front_default"`
FrontGray string `json:"front_gray"`
} `json:"red-blue"`
Yellow struct {
BackDefault string `json:"back_default"`
BackGray string `json:"back_gray"`
FrontDefault string `json:"front_default"`
FrontGray string `json:"front_gray"`
} `json:"yellow"`
} `json:"generation-i"`
GenerationIi struct {
Crystal struct {
BackDefault string `json:"back_default"`
BackShiny string `json:"back_shiny"`
FrontDefault string `json:"front_default"`
FrontShiny string `json:"front_shiny"`
} `json:"crystal"`
Gold struct {
BackDefault string `json:"back_default"`
BackShiny string `json:"back_shiny"`
FrontDefault string `json:"front_default"`
FrontShiny string `json:"front_shiny"`
} `json:"gold"`
Silver struct {
BackDefault string `json:"back_default"`
BackShiny string `json:"back_shiny"`
FrontDefault string `json:"front_default"`
FrontShiny string `json:"front_shiny"`
} `json:"silver"`
} `json:"generation-ii"`
GenerationIii struct {
Emerald struct {
FrontDefault string `json:"front_default"`
FrontShiny string `json:"front_shiny"`
} `json:"emerald"`
FireredLeafgreen struct {
BackDefault string `json:"back_default"`
BackShiny string `json:"back_shiny"`
FrontDefault string `json:"front_default"`
FrontShiny string `json:"front_shiny"`
} `json:"firered-leafgreen"`
RubySapphire struct {
BackDefault string `json:"back_default"`
BackShiny string `json:"back_shiny"`
FrontDefault string `json:"front_default"`
FrontShiny string `json:"front_shiny"`
} `json:"ruby-sapphire"`
} `json:"generation-iii"`
GenerationIv struct {
DiamondPearl struct {
BackDefault string `json:"back_default"`
BackFemale interface{} `json:"back_female"`
BackShiny string `json:"back_shiny"`
BackShinyFemale interface{} `json:"back_shiny_female"`
FrontDefault string `json:"front_default"`
FrontFemale interface{} `json:"front_female"`
FrontShiny string `json:"front_shiny"`
FrontShinyFemale interface{} `json:"front_shiny_female"`
} `json:"diamond-pearl"`
HeartgoldSoulsilver struct {
BackDefault string `json:"back_default"`
BackFemale interface{} `json:"back_female"`
BackShiny string `json:"back_shiny"`
BackShinyFemale interface{} `json:"back_shiny_female"`
FrontDefault string `json:"front_default"`
FrontFemale interface{} `json:"front_female"`
FrontShiny string `json:"front_shiny"`
FrontShinyFemale interface{} `json:"front_shiny_female"`
} `json:"heartgold-soulsilver"`
Platinum struct {
BackDefault string `json:"back_default"`
BackFemale interface{} `json:"back_female"`
BackShiny string `json:"back_shiny"`
BackShinyFemale interface{} `json:"back_shiny_female"`
FrontDefault string `json:"front_default"`
FrontFemale interface{} `json:"front_female"`
FrontShiny string `json:"front_shiny"`
FrontShinyFemale interface{} `json:"front_shiny_female"`
} `json:"platinum"`
} `json:"generation-iv"`
GenerationV struct {
BlackWhite struct {
Animated struct {
BackDefault string `json:"back_default"`
BackFemale interface{} `json:"back_female"`
BackShiny string `json:"back_shiny"`
BackShinyFemale interface{} `json:"back_shiny_female"`
FrontDefault string `json:"front_default"`
FrontFemale interface{} `json:"front_female"`
FrontShiny string `json:"front_shiny"`
FrontShinyFemale interface{} `json:"front_shiny_female"`
} `json:"animated"`
BackDefault string `json:"back_default"`
BackFemale interface{} `json:"back_female"`
BackShiny string `json:"back_shiny"`
BackShinyFemale interface{} `json:"back_shiny_female"`
FrontDefault string `json:"front_default"`
FrontFemale interface{} `json:"front_female"`
FrontShiny string `json:"front_shiny"`
FrontShinyFemale interface{} `json:"front_shiny_female"`
} `json:"black-white"`
} `json:"generation-v"`
GenerationVi struct {
OmegarubyAlphasapphire struct {
FrontDefault string `json:"front_default"`
FrontFemale interface{} `json:"front_female"`
FrontShiny string `json:"front_shiny"`
FrontShinyFemale interface{} `json:"front_shiny_female"`
} `json:"omegaruby-alphasapphire"`
XY struct {
FrontDefault string `json:"front_default"`
FrontFemale interface{} `json:"front_female"`
FrontShiny string `json:"front_shiny"`
FrontShinyFemale interface{} `json:"front_shiny_female"`
} `json:"x-y"`
} `json:"generation-vi"`
GenerationVii struct {
Icons struct {
FrontDefault string `json:"front_default"`
FrontFemale interface{} `json:"front_female"`
} `json:"icons"`
UltraSunUltraMoon struct {
FrontDefault string `json:"front_default"`
FrontFemale interface{} `json:"front_female"`
FrontShiny string `json:"front_shiny"`
FrontShinyFemale interface{} `json:"front_shiny_female"`
} `json:"ultra-sun-ultra-moon"`
} `json:"generation-vii"`
GenerationViii struct {
Icons struct {
FrontDefault string `json:"front_default"`
FrontFemale interface{} `json:"front_female"`
} `json:"icons"`
} `json:"generation-viii"`
} `json:"versions"`
} `json:"sprites"`
Cries struct {
Latest string `json:"latest"`
Legacy string `json:"legacy"`
} `json:"cries"`
Stats []struct {
BaseStat int `json:"base_stat"`
Effort int `json:"effort"`
Stat struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"stat"`
} `json:"stats"`
Types []struct {
Slot int `json:"slot"`
Type struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"type"`
} `json:"types"`
PastTypes []struct {
Generation struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"generation"`
Types []struct {
Slot int `json:"slot"`
Type struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"type"`
} `json:"types"`
} `json:"past_types"`
}
Loading

0 comments on commit 3ec7797

Please sign in to comment.