Skip to content

Commit 9ad5e54

Browse files
error handling and some more (#119)
* error handling (#86) * add tibia mapping * create the static package * create the validation package * implement error handling * adding response codes for failures even if the codes from Kong are missing too.. * adding codecov proxy support due to failure of tests being rate-limited * adjusting log message with URL * fixing docker build issue adding modules for every module inside the src folder adjusting Dockerfile order of copy and build step updating go mod and workflows to go version 1.18 * removing moved testdata files due to not being deleted when rebased * adjusting some more code things Co-authored-by: Pedro Pessoa <pedro_santos_40@hotmail.com>
1 parent bb2334d commit 9ad5e54

File tree

114 files changed

+4737
-976
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+4737
-976
lines changed

.github/workflows/codecov.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ jobs:
1818

1919
- name: Runing tests for coverage
2020
run: |
21-
go test -race -coverprofile=coverage.out -covermode=atomic `go list ./... | grep -v vendor/`
21+
go test -race -coverprofile=coverage.out -covermode=atomic `go list ./... | grep -v vendor/` -v
22+
env:
23+
TIBIADATA_PROXY: ${{ secrets.TIBIADATA_PROXY }}
2224

2325
- name: Uploading coverage to Codecov
2426
uses: codecov/codecov-action@v3

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ WORKDIR /go/src/
1212
# copy go mod files
1313
COPY go.mod go.sum ./
1414

15+
# copy all sourcecode
16+
COPY src/ ./src/
17+
1518
# download go mods
1619
RUN go mod download
1720

18-
# copy all sourcecode
19-
COPY src/ .
20-
2121
# compile the program
22-
RUN CGO_ENABLED=0 go build -ldflags="-w -s -X 'main.TibiaDataBuildBuilder=${TibiaDataBuildBuilder}' -X 'main.TibiaDataBuildRelease=${TibiaDataBuildRelease}' -X 'main.TibiaDataBuildCommit=${TibiaDataBuildCommit}'" -o app ./...
22+
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags="-w -s -X 'main.TibiaDataBuildBuilder=${TibiaDataBuildBuilder}' -X 'main.TibiaDataBuildRelease=${TibiaDataBuildRelease}' -X 'main.TibiaDataBuildCommit=${TibiaDataBuildCommit}'" -o app ./...
2323

2424

2525
# get latest alpine container

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Those are the current existing endpoints.
106106
- GET `/v3/fansites`
107107
- GET `/v3/guild/:name`
108108
- GET `/v3/guilds/:world`
109-
- GET `/v3/highscores/:world/:category/:vocation`
109+
- GET `/v3/highscores/:world/:category/:vocation/:page`
110110
- GET `/v3/house/:world/:house_id`
111111
- GET `/v3/houses/:world/:town`
112112
- GET `/v3/killstatistics/:world`

go.mod

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ go 1.19
44

55
require (
66
github.com/PuerkitoBio/goquery v1.8.0
7+
github.com/TibiaData/tibiadata-api-go/src/static v0.0.0-00010101000000-000000000000
8+
github.com/TibiaData/tibiadata-api-go/src/validation v0.0.0-00010101000000-000000000000
79
github.com/gin-gonic/gin v1.8.2
810
github.com/go-resty/resty/v2 v2.7.0
911
github.com/mantyr/go-charset v0.0.0-20160510214718-44d054d82c4a
1012
github.com/stretchr/testify v1.8.1
1113
golang.org/x/text v0.6.0
1214
)
1315

16+
require github.com/TibiaData/tibiadata-api-go/src/tibiamapping v0.0.0-00010101000000-000000000000 // indirect
17+
1418
require (
1519
github.com/goccy/go-json v0.10.0 // indirect
1620
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
@@ -39,3 +43,9 @@ require (
3943
gopkg.in/yaml.v2 v2.4.0 // indirect
4044
gopkg.in/yaml.v3 v3.0.1 // indirect
4145
)
46+
47+
replace github.com/TibiaData/tibiadata-api-go/src/tibiamapping => ./src/tibiamapping
48+
49+
replace github.com/TibiaData/tibiadata-api-go/src/static => ./src/static
50+
51+
replace github.com/TibiaData/tibiadata-api-go/src/validation => ./src/validation

src/HighscoreCategory.go

Lines changed: 0 additions & 71 deletions
This file was deleted.

src/HighscoreCategory_test.go

Lines changed: 0 additions & 112 deletions
This file was deleted.

src/HousesMapping.go

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)