From 7468fbf3edc10297129b2075bf175ff54c2a15cc Mon Sep 17 00:00:00 2001 From: Mikhail Gerasimchuk Date: Sun, 19 Nov 2023 14:18:42 +0700 Subject: [PATCH] Upgrade dependencies. Move coverage generating to the CI --- .github/workflows/test-integration.yml | 2 +- .github/workflows/test-unit.yml | 9 +- Makefile | 2 + README.md | 58 +- assets/coverage/coverage.html | 506 ------------------ assets/coverage/coverage.out | 113 ---- assets/coverage/unit/.gitkeep | 0 go.mod | 58 +- go.sum | 143 ++--- internal/adapter/repository/mock/booking.go | 91 ++-- internal/adapter/repository/mock/landpad.go | 43 +- internal/adapter/repository/mock/launchpad.go | 55 +- internal/usecase/booking_test.go | 2 +- internal/usecase/repository/booking.go | 2 + internal/usecase/repository/landpad.go | 2 + internal/usecase/repository/launchpad.go | 2 + test/integration/api/bookings_test.go | 10 +- test/integration/api/util_test.go | 8 + 18 files changed, 255 insertions(+), 851 deletions(-) delete mode 100644 assets/coverage/coverage.html delete mode 100644 assets/coverage/coverage.out create mode 100644 assets/coverage/unit/.gitkeep diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 3a24e1f..68ab1ec 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -1,4 +1,4 @@ -name: Test Integration +name: Test (Integration) on: push jobs: diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index 94684a6..955c928 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -1,4 +1,4 @@ -name: Test Unit +name: Test (unit) on: push jobs: @@ -8,3 +8,10 @@ jobs: - uses: actions/checkout@v3 - name: Test Unit run: make test-unit + - name: Coverage report + uses: ncruces/go-coverage-report@v0.2.9 + with: + badge-title: Coverage (unit) + coverage-file: assets/coverage/unit/coverage.out + report: true + output-dir: assets/coverage/unit diff --git a/Makefile b/Makefile index a8e5717..78adb81 100644 --- a/Makefile +++ b/Makefile @@ -28,5 +28,7 @@ lint-golangci: vendor-install lint-architecture: docker run --rm -v $(shell pwd):/app -w /app golang:1.20.0 /bin/bash \ -c "go install github.com/fdaines/arch-go@v1.4.2 && arch-go -v" +generate-go: + docker run --rm -v $(shell pwd):/app -w /app golang:1.20.0 /bin/bash -c 'go install go.uber.org/mock/mockgen@v0.3.0 && go generate ./...' vendor-install: @if [ -d "vendor" ]; then echo "Vendor folder already exists. Skip vendor installing."; else docker run --rm -v $(shell pwd):/app -w /app golang:1.20.0 /bin/bash -c "go mod tidy && go mod vendor"; fi \ No newline at end of file diff --git a/README.md b/README.md index d536447..12b980d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,13 @@ -[![Lint Golangci][lint-golangci-badge]][lint-golangci-url] -[![Lint Architecture][lint-architecture-badge]][lint-architecture-url] -[![Test Unit][test-unit-badge]][test-unit-url] -[![Test Integration][test-integration-badge]][test-integration-url] +[![Lint Golangci](https://github.com/mgerasimchuk/space-trouble/actions/workflows/lint-golangci.yml/badge.svg)](https://github.com/mgerasimchuk/space-trouble/actions/workflows/lint-golangci.yml) +[![Lint Architecture](https://github.com/mgerasimchuk/space-trouble/actions/workflows/lint-architecture.yml/badge.svg)](https://github.com/mgerasimchuk/space-trouble/actions/workflows/lint-architecture.yml) +[![Test (unit)](https://github.com/mgerasimchuk/space-trouble/actions/workflows/test-unit.yml/badge.svg)](https://github.com/mgerasimchuk/space-trouble/actions/workflows/test-unit.yml) +[![Coverage (unit)](https://github.com/mgerasimchuk/space-trouble/wiki/assets/coverage/unit/coverage.svg)](https://raw.githack.com/wiki/mgerasimchuk/space-trouble/assets/coverage/unit/coverage.html) +[![Test (integration)](https://github.com/mgerasimchuk/space-trouble/actions/workflows/test-integration.yml/badge.svg)](https://github.com/mgerasimchuk/space-trouble/actions/workflows/test-integration.yml) # Space Trouble +Solution for the [Space trouble challenge](#space-trouble-challenge) + ## Requirements * [Docker Engine](https://docs.docker.com/engine/) (tested on 20.10.7) @@ -55,39 +58,6 @@ See data in DB: docker-compose -f deployments/docker-compose/docker-compose.yaml run migrations-up bash -c 'psql -c "SELECT * FROM bookings"' ``` -## Tests - -### Unit - -Run tests with generating html coverage report: - -``` -make test-unit -``` - -After executing, you can open generated [assets/coverage/coverage.html](https://htmlpreview.github.io/?https://raw.githubusercontent.com/mgerasimchuk/space-trouble/master/assets/coverage/coverage.html) -file in browser for checking coverage - -### Integration - -``` -make test-integration -``` - -## Linters - -### Golangci - -``` -make lint-golangci -``` - -### Architecture - -``` -make lint-architecture -``` - ## Configuration See env file: [deployments/docker-compose/.env](deployments/docker-compose/.env) @@ -97,9 +67,10 @@ See env file: [deployments/docker-compose/.env](deployments/docker-compose/.env) As an architectural approach was used - [The Clean Architecture](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html) -The project layout follows [https://github.com/golang-standards/project-layout](https://github.com/golang-standards/project-layout) +The project layout follows +- [https://github.com/golang-standards/project-layout](https://github.com/golang-standards/project-layout) -## Original Technical Task Description +## Space trouble challenge Imagine it’s 2049 and you are working for a company called SpaceTrouble that sends people to different places in our solar system. You are not the only one working in this industry. Your biggest competitor is a less known company called @@ -144,12 +115,3 @@ Technical requirements: * Please, use github or bitbucket. * Commit your changes often. Do not push the whole project in one commit. - -[lint-golangci-badge]: https://github.com/mgerasimchuk/space-trouble/actions/workflows/lint-golangci.yml/badge.svg -[lint-golangci-url]: https://github.com/mgerasimchuk/space-trouble/actions/workflows/lint-golangci.yml -[lint-architecture-badge]: https://github.com/mgerasimchuk/space-trouble/actions/workflows/lint-architecture.yml/badge.svg -[lint-architecture-url]: https://github.com/mgerasimchuk/space-trouble/actions/workflows/lint-architecture.yml -[test-unit-badge]: https://github.com/mgerasimchuk/space-trouble/actions/workflows/test-unit.yml/badge.svg -[test-unit-url]: https://github.com/mgerasimchuk/space-trouble/actions/workflows/test-unit.yml -[test-integration-badge]: https://github.com/mgerasimchuk/space-trouble/actions/workflows/test-integration.yml/badge.svg -[test-integration-url]: https://github.com/mgerasimchuk/space-trouble/actions/workflows/test-integration.yml diff --git a/assets/coverage/coverage.html b/assets/coverage/coverage.html deleted file mode 100644 index 65faa54..0000000 --- a/assets/coverage/coverage.html +++ /dev/null @@ -1,506 +0,0 @@ - - - - - - entity: Go Coverage Report - - - -
- -
- not tracked - - no coverage - low coverage - * - * - * - * - * - * - * - * - high coverage - -
-
-
- - - - - - - -
- - - diff --git a/assets/coverage/coverage.out b/assets/coverage/coverage.out deleted file mode 100644 index 61e21e4..0000000 --- a/assets/coverage/coverage.out +++ /dev/null @@ -1,113 +0,0 @@ -mode: count -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:28.142,36.2 3 8 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:38.166,45.2 2 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:47.31,49.2 1 0 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:51.36,53.2 1 0 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:55.35,57.2 1 9 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:59.44,61.2 1 0 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:63.41,65.2 1 0 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:67.56,69.2 1 0 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:71.38,73.2 1 8 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:75.50,77.2 1 0 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:79.37,81.2 1 7 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:83.48,85.2 1 0 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:87.35,89.2 1 6 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:91.44,93.2 1 0 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:95.40,97.2 1 5 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:99.51,101.2 1 0 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:103.40,105.2 1 4 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:107.54,109.2 1 0 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:111.42,113.2 1 3 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:115.58,117.2 1 0 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:119.42,121.2 1 2 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:123.55,125.2 1 0 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:127.35,128.43 1 9 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:128.43,130.3 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:131.2,131.46 1 8 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:131.46,133.3 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:134.2,134.45 1 7 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:134.45,136.3 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:137.2,137.43 1 6 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:137.43,139.3 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:140.2,140.45 1 5 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:140.45,142.3 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:143.2,143.48 1 4 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:143.48,145.3 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:146.2,146.50 1 3 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:146.50,148.3 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:149.2,149.47 1 2 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:149.47,151.3 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:153.2,153.12 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:156.41,157.22 1 9 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:157.22,159.3 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:161.2,161.12 1 8 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:164.44,165.25 1 8 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:165.25,167.3 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:169.2,169.12 1 7 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:172.43,173.24 1 7 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:173.24,175.3 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:177.2,177.12 1 6 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:180.41,181.22 1 6 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:181.22,183.3 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:185.2,185.12 1 5 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:188.43,189.36 1 5 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:189.36,192.3 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:194.2,194.12 1 4 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:197.46,198.27 1 4 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:198.27,200.3 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:202.2,202.12 1 3 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:205.48,206.29 1 3 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:206.29,208.3 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:210.2,210.12 1 2 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:213.45,214.39 1 2 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:214.39,216.3 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/booking.go:218.2,218.12 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/service/booking_verifier.go:12.58,14.2 1 1 -github.com/mgerasimchuk/space-trouble/internal/entity/service/booking_verifier.go:16.91,17.28 1 6 -github.com/mgerasimchuk/space-trouble/internal/entity/service/booking_verifier.go:17.28,22.3 4 1 -github.com/mgerasimchuk/space-trouble/internal/entity/service/booking_verifier.go:23.2,23.28 1 5 -github.com/mgerasimchuk/space-trouble/internal/entity/service/booking_verifier.go:23.28,28.3 4 1 -github.com/mgerasimchuk/space-trouble/internal/entity/service/booking_verifier.go:29.2,29.35 1 4 -github.com/mgerasimchuk/space-trouble/internal/entity/service/booking_verifier.go:29.35,34.3 4 1 -github.com/mgerasimchuk/space-trouble/internal/entity/service/booking_verifier.go:35.2,35.26 1 3 -github.com/mgerasimchuk/space-trouble/internal/entity/service/booking_verifier.go:35.26,40.3 4 1 -github.com/mgerasimchuk/space-trouble/internal/entity/service/booking_verifier.go:41.2,41.26 1 2 -github.com/mgerasimchuk/space-trouble/internal/entity/service/booking_verifier.go:41.26,46.3 4 1 -github.com/mgerasimchuk/space-trouble/internal/entity/service/booking_verifier.go:48.2,50.12 3 1 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:20.214,22.2 1 3 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:29.28,31.37 2 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:31.37,33.3 1 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:35.2,36.16 2 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:36.16,38.3 1 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:40.2,40.15 1 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:43.85,44.32 1 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:44.32,46.3 1 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:47.2,47.34 1 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:47.34,49.3 1 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:51.2,52.16 2 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:52.16,54.3 1 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:56.2,56.22 1 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:59.57,60.14 1 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:60.14,62.3 1 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:64.2,65.16 2 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:65.16,67.3 1 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:69.2,69.12 1 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:72.62,74.16 2 3 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:74.16,76.3 1 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:77.2,77.14 1 3 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:77.14,79.3 1 0 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:81.2,83.26 3 3 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:83.26,86.3 2 3 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:87.2,87.26 1 3 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:87.26,90.3 2 3 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:91.2,91.26 1 3 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:91.26,94.3 2 3 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:95.2,95.26 1 3 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:95.26,98.3 2 3 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:99.2,99.26 1 3 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:99.26,102.3 2 3 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:104.2,104.32 1 3 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:104.32,108.3 3 1 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:110.2,111.16 2 2 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:111.16,113.3 1 1 -github.com/mgerasimchuk/space-trouble/internal/usecase/booking.go:115.2,115.30 1 1 diff --git a/assets/coverage/unit/.gitkeep b/assets/coverage/unit/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/go.mod b/go.mod index 949e3a9..a2e5adb 100644 --- a/go.mod +++ b/go.mod @@ -3,54 +3,59 @@ module github.com/mgerasimchuk/space-trouble go 1.20 require ( - github.com/brianvoe/gofakeit/v6 v6.5.0 - github.com/bxcodec/faker/v3 v3.8.1 github.com/gavv/httpexpect/v2 v2.16.0 - github.com/gin-gonic/gin v1.7.2 - github.com/golang/mock v1.5.0 - github.com/google/uuid v1.3.0 + github.com/gin-gonic/gin v1.9.1 + github.com/go-faker/faker/v4 v4.2.0 + github.com/google/uuid v1.4.0 github.com/jinzhu/gorm v1.9.16 github.com/kelseyhightower/envconfig v1.4.0 - github.com/pkg/errors v0.8.1 - github.com/sirupsen/logrus v1.6.0 - github.com/stretchr/testify v1.7.4 + github.com/pkg/errors v0.9.1 + github.com/sirupsen/logrus v1.9.3 + github.com/stretchr/testify v1.8.4 github.com/toorop/gin-logrus v0.0.0-20210225092905-2c785434f26f - golang.org/x/sync v0.0.0-20210220032951-036812b2e83c + go.uber.org/mock v0.3.0 + golang.org/x/sync v0.5.0 ) require ( github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2 // indirect github.com/ajg/form v1.5.1 // indirect github.com/andybalholm/brotli v1.0.4 // indirect + github.com/bytedance/sonic v1.10.2 // indirect + github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect + github.com/chenzhuoyu/iasm v0.9.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/color v1.15.0 // indirect github.com/fatih/structs v1.1.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-playground/locales v0.13.0 // indirect - github.com/go-playground/universal-translator v0.17.0 // indirect - github.com/go-playground/validator/v10 v10.4.1 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.16.0 // indirect github.com/gobwas/glob v0.2.3 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/goccy/go-json v0.10.2 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/gorilla/websocket v1.4.2 // indirect github.com/hpcloud/tail v1.0.0 // indirect github.com/imkira/go-interpol v1.1.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect - github.com/json-iterator/go v1.1.11 // indirect + github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.15.0 // indirect - github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect + github.com/klauspost/cpuid/v2 v2.2.6 // indirect github.com/kr/pretty v0.1.0 // indirect - github.com/leodido/go-urn v1.2.0 // indirect - github.com/lib/pq v1.1.1 // indirect + github.com/leodido/go-urn v1.2.4 // indirect + github.com/lib/pq v1.10.9 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.18 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect - github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/sanity-io/litter v1.5.5 // indirect github.com/sergi/go-diff v1.0.0 // indirect - github.com/ugorji/go/codec v1.1.7 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.2.11 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.34.0 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect @@ -59,14 +64,15 @@ require ( github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect github.com/yudai/gojsondiff v1.0.0 // indirect github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect - golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.7.0 // indirect - google.golang.org/protobuf v1.26.0 // indirect + golang.org/x/arch v0.6.0 // indirect + golang.org/x/crypto v0.15.0 // indirect + golang.org/x/net v0.18.0 // indirect + golang.org/x/sys v0.14.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect gopkg.in/fsnotify.v1 v1.4.7 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect moul.io/http2curl/v2 v2.3.0 // indirect ) diff --git a/go.sum b/go.sum index 7bb0ffd..dae8c9f 100644 --- a/go.sum +++ b/go.sum @@ -6,10 +6,17 @@ github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= -github.com/brianvoe/gofakeit/v6 v6.5.0 h1:zoWqGsuB8TB4MSwUZXtV3OwUSdzi8EHeXO8JfReRIHg= -github.com/brianvoe/gofakeit/v6 v6.5.0/go.mod h1:palrJUk4Fyw38zIFB/uBZqsgzW5VsNllhHKKwAebzew= -github.com/bxcodec/faker/v3 v3.8.1 h1:qO/Xq19V6uHt2xujwpaetgKhraGCapqY2CRWGD/SqcM= -github.com/bxcodec/faker/v3 v3.8.1/go.mod h1:DdSDccxF5msjFo5aO4vrobRQ8nIApg8kq3QWPEQD6+o= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM= +github.com/bytedance/sonic v1.10.2 h1:GQebETVBxYB7JGWJtLBi07OVzWwt+8dWA00gEVW2ZFE= +github.com/bytedance/sonic v1.10.2/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= +github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= +github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= +github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA= +github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= +github.com/chenzhuoyu/iasm v0.9.1 h1:tUHQJXo3NhBqw6s33wkGn9SP3bvrWLdlVIJ3hQBL7P0= +github.com/chenzhuoyu/iasm v0.9.1/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -22,40 +29,40 @@ github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= +github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/gavv/httpexpect/v2 v2.16.0 h1:Ty2favARiTYTOkCRZGX7ojXXjGyNAIohM1lZ3vqaEwI= github.com/gavv/httpexpect/v2 v2.16.0/go.mod h1:uJLaO+hQ25ukBJtQi750PsztObHybNllN+t+MbbW8PY= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.2 h1:Tg03T9yM2xa8j6I3Z3oqLaQRSmKvxPd6g/2HJ6zICFA= -github.com/gin-gonic/gin v1.7.2/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= +github.com/go-faker/faker/v4 v4.2.0 h1:dGebOupKwssrODV51E0zbMrv5e2gO9VWSLNC1WDCpWg= +github.com/go-faker/faker/v4 v4.2.0/go.mod h1:F/bBy8GH9NxOxMInug5Gx4WYeG6fHJZ8Ol/dhcpRub4= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.16.0 h1:x+plE831WK4vaKHO/jpgUGsvLKIqRRkz6M78GuJAfGE= +github.com/go-playground/validator/v10 v10.16.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= -github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f h1:7LYC+Yfkj3CTRcShK0KOL/w6iTiKyqqBA9a41Wnggw8= @@ -69,44 +76,47 @@ github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M= github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/klauspost/compress v1.15.0 h1:xqfchp4whNFxn5A4XFyyYtitiWI8Hy5EW59jEwcyL6U= github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= +github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo= github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/diff v0.0.0-20200914180035-5b29258ca4f7/go.mod h1:zO8QMzTeZd5cpnIkz/Gn6iK0jDfGicM1nynOkkPIl28= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -114,23 +124,28 @@ github.com/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQ github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v0.0.0-20161117074351-18a02ba4a312/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.4 h1:wZRexSlwd7ZXfKINDLsO4r7WBt3gTKONc6K/VesHvHM= -github.com/stretchr/testify v1.7.4/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tailscale/depaware v0.0.0-20210622194025-720c4b409502/go.mod h1:p9lPsd+cx33L3H9nNoecRRxPssFKUwwI50I3pZ0yT+8= github.com/toorop/gin-logrus v0.0.0-20210225092905-2c785434f26f h1:oqdnd6OGlOUu1InG37hWcCB3a+Jy3fwjylyVboaNMwY= github.com/toorop/gin-logrus v0.0.0-20210225092905-2c785434f26f/go.mod h1:X3Dd1SB8Gt1V968NTzpKFjMM6O8ccta2NPC6MprOxZQ= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.34.0 h1:d3AAQJ2DRcxJYHm7OXNXtXt2as1vMDfxeIcFvhmGGm4= @@ -151,13 +166,19 @@ github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3Ifn github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= github.com/yudai/pp v2.0.1+incompatible h1:Q4//iY4pNF6yPLZIigmvcl7k/bPgrcTPIFIcmawg5bI= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= +go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.6.0 h1:S0JTfE48HbRj80+4tbvZDYsJ3tGv6BUU3XxyZ7CirAc= +golang.org/x/arch v0.6.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292 h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= +golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -168,16 +189,14 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= +golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -185,18 +204,20 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -206,8 +227,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -216,11 +237,11 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= moul.io/http2curl/v2 v2.3.0 h1:9r3JfDzWPcbIklMOs2TnIFzDYvfAZvjeavG6EzP7jYs= moul.io/http2curl/v2 v2.3.0/go.mod h1:RW4hyBjTWSYDOxapodpNEtX0g5Eb16sxklBqmd2RHcE= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/internal/adapter/repository/mock/booking.go b/internal/adapter/repository/mock/booking.go index 9f5399f..023ff16 100644 --- a/internal/adapter/repository/mock/booking.go +++ b/internal/adapter/repository/mock/booking.go @@ -1,107 +1,112 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: internal/entity/repository/booking_verifier.go - +// Source: booking.go +// +// Generated by this command: +// +// mockgen -source=booking.go -destination=../../adapter/repository/mock/booking.go -package=mock +// // Package mock is a generated GoMock package. package mock import ( - gomock "github.com/golang/mock/gomock" - model "github.com/mgerasimchuk/space-trouble/internal/entity" reflect "reflect" + + entity "github.com/mgerasimchuk/space-trouble/internal/entity" + gomock "go.uber.org/mock/gomock" ) -// MockBookingRepository is a mock of BookingRepository interface +// MockBookingRepository is a mock of BookingRepository interface. type MockBookingRepository struct { ctrl *gomock.Controller recorder *MockBookingRepositoryMockRecorder } -// MockBookingRepositoryMockRecorder is the mock recorder for MockBookingRepository +// MockBookingRepositoryMockRecorder is the mock recorder for MockBookingRepository. type MockBookingRepositoryMockRecorder struct { mock *MockBookingRepository } -// NewMockBookingRepository creates a new mock instance +// NewMockBookingRepository creates a new mock instance. func NewMockBookingRepository(ctrl *gomock.Controller) *MockBookingRepository { mock := &MockBookingRepository{ctrl: ctrl} mock.recorder = &MockBookingRepositoryMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockBookingRepository) EXPECT() *MockBookingRepositoryMockRecorder { return m.recorder } -// Create mocks base method -func (m *MockBookingRepository) Create(b *model.Booking) (*model.Booking, error) { +// Create mocks base method. +func (m *MockBookingRepository) Create(b *entity.Booking) (*entity.Booking, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Create", b) - ret0, _ := ret[0].(*model.Booking) + ret0, _ := ret[0].(*entity.Booking) ret1, _ := ret[1].(error) return ret0, ret1 } -// Create indicates an expected call of Create -func (mr *MockBookingRepositoryMockRecorder) Create(b interface{}) *gomock.Call { +// Create indicates an expected call of Create. +func (mr *MockBookingRepositoryMockRecorder) Create(b any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockBookingRepository)(nil).Create), b) } -// Save mocks base method -func (m *MockBookingRepository) Save(b *model.Booking) error { +// Delete mocks base method. +func (m *MockBookingRepository) Delete(id string) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Save", b) + ret := m.ctrl.Call(m, "Delete", id) ret0, _ := ret[0].(error) return ret0 } -// Save indicates an expected call of Save -func (mr *MockBookingRepositoryMockRecorder) Save(b interface{}) *gomock.Call { +// Delete indicates an expected call of Delete. +func (mr *MockBookingRepositoryMockRecorder) Delete(id any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Save", reflect.TypeOf((*MockBookingRepository)(nil).Save), b) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockBookingRepository)(nil).Delete), id) } -// GetList mocks base method -func (m *MockBookingRepository) GetList(status *string, limit, offset *int) ([]*model.Booking, error) { +// GetAndModify mocks base method. +func (m *MockBookingRepository) GetAndModify(searchStatus, modifyStatus string) (*entity.Booking, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetList", status, limit, offset) - ret0, _ := ret[0].([]*model.Booking) + ret := m.ctrl.Call(m, "GetAndModify", searchStatus, modifyStatus) + ret0, _ := ret[0].(*entity.Booking) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetList indicates an expected call of GetList -func (mr *MockBookingRepositoryMockRecorder) GetList(status, limit, offset interface{}) *gomock.Call { +// GetAndModify indicates an expected call of GetAndModify. +func (mr *MockBookingRepositoryMockRecorder) GetAndModify(searchStatus, modifyStatus any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetList", reflect.TypeOf((*MockBookingRepository)(nil).GetList), status, limit, offset) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAndModify", reflect.TypeOf((*MockBookingRepository)(nil).GetAndModify), searchStatus, modifyStatus) } -// Delete mocks base method -func (m *MockBookingRepository) Delete(id string) error { +// GetList mocks base method. +func (m *MockBookingRepository) GetList(status *string, limit, offset *int) ([]*entity.Booking, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", id) - ret0, _ := ret[0].(error) - return ret0 + ret := m.ctrl.Call(m, "GetList", status, limit, offset) + ret0, _ := ret[0].([]*entity.Booking) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// Delete indicates an expected call of Delete -func (mr *MockBookingRepositoryMockRecorder) Delete(id interface{}) *gomock.Call { +// GetList indicates an expected call of GetList. +func (mr *MockBookingRepositoryMockRecorder) GetList(status, limit, offset any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockBookingRepository)(nil).Delete), id) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetList", reflect.TypeOf((*MockBookingRepository)(nil).GetList), status, limit, offset) } -// GetAndModify mocks base method -func (m *MockBookingRepository) GetAndModify(searchStatus, modifyStatus string) (*model.Booking, error) { +// Save mocks base method. +func (m *MockBookingRepository) Save(b *entity.Booking) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAndModify", searchStatus, modifyStatus) - ret0, _ := ret[0].(*model.Booking) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret := m.ctrl.Call(m, "Save", b) + ret0, _ := ret[0].(error) + return ret0 } -// GetAndModify indicates an expected call of GetAndModify -func (mr *MockBookingRepositoryMockRecorder) GetAndModify(searchStatus, modifyStatus interface{}) *gomock.Call { +// Save indicates an expected call of Save. +func (mr *MockBookingRepositoryMockRecorder) Save(b any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAndModify", reflect.TypeOf((*MockBookingRepository)(nil).GetAndModify), searchStatus, modifyStatus) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Save", reflect.TypeOf((*MockBookingRepository)(nil).Save), b) } diff --git a/internal/adapter/repository/mock/landpad.go b/internal/adapter/repository/mock/landpad.go index 7fe4353..bc6407d 100644 --- a/internal/adapter/repository/mock/landpad.go +++ b/internal/adapter/repository/mock/landpad.go @@ -1,63 +1,68 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: internal/entity/repository/landpad.go - +// Source: landpad.go +// +// Generated by this command: +// +// mockgen -source=landpad.go -destination=../../adapter/repository/mock/landpad.go -package=mock +// // Package mock is a generated GoMock package. package mock import ( - gomock "github.com/golang/mock/gomock" reflect "reflect" + + gomock "go.uber.org/mock/gomock" ) -// MockLandpadRepository is a mock of LandpadRepository interface +// MockLandpadRepository is a mock of LandpadRepository interface. type MockLandpadRepository struct { ctrl *gomock.Controller recorder *MockLandpadRepositoryMockRecorder } -// MockLandpadRepositoryMockRecorder is the mock recorder for MockLandpadRepository +// MockLandpadRepositoryMockRecorder is the mock recorder for MockLandpadRepository. type MockLandpadRepositoryMockRecorder struct { mock *MockLandpadRepository } -// NewMockLandpadRepository creates a new mock instance +// NewMockLandpadRepository creates a new mock instance. func NewMockLandpadRepository(ctrl *gomock.Controller) *MockLandpadRepository { mock := &MockLandpadRepository{ctrl: ctrl} mock.recorder = &MockLandpadRepositoryMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockLandpadRepository) EXPECT() *MockLandpadRepositoryMockRecorder { return m.recorder } -// IsExists mocks base method -func (m *MockLandpadRepository) IsExists(id string) (bool, error) { +// IsActive mocks base method. +func (m *MockLandpadRepository) IsActive(id string) (bool, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsExists", id) + ret := m.ctrl.Call(m, "IsActive", id) ret0, _ := ret[0].(bool) ret1, _ := ret[1].(error) return ret0, ret1 } -// IsExists indicates an expected call of IsExists -func (mr *MockLandpadRepositoryMockRecorder) IsExists(id interface{}) *gomock.Call { +// IsActive indicates an expected call of IsActive. +func (mr *MockLandpadRepositoryMockRecorder) IsActive(id any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsExists", reflect.TypeOf((*MockLandpadRepository)(nil).IsExists), id) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsActive", reflect.TypeOf((*MockLandpadRepository)(nil).IsActive), id) } -// IsActive mocks base method -func (m *MockLandpadRepository) IsActive(id string) (bool, error) { +// IsExists mocks base method. +func (m *MockLandpadRepository) IsExists(id string) (bool, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsActive", id) + ret := m.ctrl.Call(m, "IsExists", id) ret0, _ := ret[0].(bool) ret1, _ := ret[1].(error) return ret0, ret1 } -// IsActive indicates an expected call of IsActive -func (mr *MockLandpadRepositoryMockRecorder) IsActive(id interface{}) *gomock.Call { +// IsExists indicates an expected call of IsExists. +func (mr *MockLandpadRepositoryMockRecorder) IsExists(id any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsActive", reflect.TypeOf((*MockLandpadRepository)(nil).IsActive), id) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsExists", reflect.TypeOf((*MockLandpadRepository)(nil).IsExists), id) } diff --git a/internal/adapter/repository/mock/launchpad.go b/internal/adapter/repository/mock/launchpad.go index 6828064..689cc60 100644 --- a/internal/adapter/repository/mock/launchpad.go +++ b/internal/adapter/repository/mock/launchpad.go @@ -1,79 +1,84 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: internal/entity/repository/launchpad.go - +// Source: launchpad.go +// +// Generated by this command: +// +// mockgen -source=launchpad.go -destination=../../adapter/repository/mock/launchpad.go -package=mock +// // Package mock is a generated GoMock package. package mock import ( - gomock "github.com/golang/mock/gomock" reflect "reflect" time "time" + + gomock "go.uber.org/mock/gomock" ) -// MockLaunchpadRepository is a mock of LaunchpadRepository interface +// MockLaunchpadRepository is a mock of LaunchpadRepository interface. type MockLaunchpadRepository struct { ctrl *gomock.Controller recorder *MockLaunchpadRepositoryMockRecorder } -// MockLaunchpadRepositoryMockRecorder is the mock recorder for MockLaunchpadRepository +// MockLaunchpadRepositoryMockRecorder is the mock recorder for MockLaunchpadRepository. type MockLaunchpadRepositoryMockRecorder struct { mock *MockLaunchpadRepository } -// NewMockLaunchpadRepository creates a new mock instance +// NewMockLaunchpadRepository creates a new mock instance. func NewMockLaunchpadRepository(ctrl *gomock.Controller) *MockLaunchpadRepository { mock := &MockLaunchpadRepository{ctrl: ctrl} mock.recorder = &MockLaunchpadRepositoryMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockLaunchpadRepository) EXPECT() *MockLaunchpadRepositoryMockRecorder { return m.recorder } -// IsExists mocks base method -func (m *MockLaunchpadRepository) IsExists(id string) (bool, error) { +// IsActive mocks base method. +func (m *MockLaunchpadRepository) IsActive(id string) (bool, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsExists", id) + ret := m.ctrl.Call(m, "IsActive", id) ret0, _ := ret[0].(bool) ret1, _ := ret[1].(error) return ret0, ret1 } -// IsExists indicates an expected call of IsExists -func (mr *MockLaunchpadRepositoryMockRecorder) IsExists(id interface{}) *gomock.Call { +// IsActive indicates an expected call of IsActive. +func (mr *MockLaunchpadRepositoryMockRecorder) IsActive(id any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsExists", reflect.TypeOf((*MockLaunchpadRepository)(nil).IsExists), id) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsActive", reflect.TypeOf((*MockLaunchpadRepository)(nil).IsActive), id) } -// IsActive mocks base method -func (m *MockLaunchpadRepository) IsActive(id string) (bool, error) { +// IsDateAvailableForLaunch mocks base method. +func (m *MockLaunchpadRepository) IsDateAvailableForLaunch(launchpadID string, launchDate time.Time) (bool, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsActive", id) + ret := m.ctrl.Call(m, "IsDateAvailableForLaunch", launchpadID, launchDate) ret0, _ := ret[0].(bool) ret1, _ := ret[1].(error) return ret0, ret1 } -// IsActive indicates an expected call of IsActive -func (mr *MockLaunchpadRepositoryMockRecorder) IsActive(id interface{}) *gomock.Call { +// IsDateAvailableForLaunch indicates an expected call of IsDateAvailableForLaunch. +func (mr *MockLaunchpadRepositoryMockRecorder) IsDateAvailableForLaunch(launchpadID, launchDate any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsActive", reflect.TypeOf((*MockLaunchpadRepository)(nil).IsActive), id) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsDateAvailableForLaunch", reflect.TypeOf((*MockLaunchpadRepository)(nil).IsDateAvailableForLaunch), launchpadID, launchDate) } -// IsDateAvailableForLaunch mocks base method -func (m *MockLaunchpadRepository) IsDateAvailableForLaunch(launchpadID string, launchDate time.Time) (bool, error) { +// IsExists mocks base method. +func (m *MockLaunchpadRepository) IsExists(id string) (bool, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsDateAvailableForLaunch", launchpadID, launchDate) + ret := m.ctrl.Call(m, "IsExists", id) ret0, _ := ret[0].(bool) ret1, _ := ret[1].(error) return ret0, ret1 } -// IsDateAvailableForLaunch indicates an expected call of IsDateAvailableForLaunch -func (mr *MockLaunchpadRepositoryMockRecorder) IsDateAvailableForLaunch(launchpadID, launchDate interface{}) *gomock.Call { +// IsExists indicates an expected call of IsExists. +func (mr *MockLaunchpadRepositoryMockRecorder) IsExists(id any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsDateAvailableForLaunch", reflect.TypeOf((*MockLaunchpadRepository)(nil).IsDateAvailableForLaunch), launchpadID, launchDate) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsExists", reflect.TypeOf((*MockLaunchpadRepository)(nil).IsExists), id) } diff --git a/internal/usecase/booking_test.go b/internal/usecase/booking_test.go index cee3ae5..2e73c3d 100644 --- a/internal/usecase/booking_test.go +++ b/internal/usecase/booking_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/mgerasimchuk/space-trouble/internal/adapter/repository/mock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestBookingUsecase_VerifyBooking(t *testing.T) { diff --git a/internal/usecase/repository/booking.go b/internal/usecase/repository/booking.go index 798b93c..a2e23b9 100644 --- a/internal/usecase/repository/booking.go +++ b/internal/usecase/repository/booking.go @@ -4,6 +4,8 @@ import ( "github.com/mgerasimchuk/space-trouble/internal/entity" ) +//go:generate mockgen -source=booking.go -destination=../../adapter/repository/mock/booking.go -package=mock + const DefaultBookingGetListLimit = 20 type BookingRepository interface { diff --git a/internal/usecase/repository/landpad.go b/internal/usecase/repository/landpad.go index eebae1c..f2c55db 100644 --- a/internal/usecase/repository/landpad.go +++ b/internal/usecase/repository/landpad.go @@ -1,5 +1,7 @@ package repository +//go:generate mockgen -source=landpad.go -destination=../../adapter/repository/mock/landpad.go -package=mock + type LandpadRepository interface { IsExists(id string) (bool, error) IsActive(id string) (bool, error) diff --git a/internal/usecase/repository/launchpad.go b/internal/usecase/repository/launchpad.go index df7f9ef..fe819cf 100644 --- a/internal/usecase/repository/launchpad.go +++ b/internal/usecase/repository/launchpad.go @@ -2,6 +2,8 @@ package repository import "time" +//go:generate mockgen -source=launchpad.go -destination=../../adapter/repository/mock/launchpad.go -package=mock + type LaunchpadRepository interface { IsExists(id string) (bool, error) IsActive(id string) (bool, error) diff --git a/test/integration/api/bookings_test.go b/test/integration/api/bookings_test.go index 82a6f0c..9521e89 100644 --- a/test/integration/api/bookings_test.go +++ b/test/integration/api/bookings_test.go @@ -1,19 +1,15 @@ package main import ( - "github.com/bxcodec/faker/v3" "github.com/gavv/httpexpect/v2" + "github.com/go-faker/faker/v4" "net/http" "testing" "time" ) -func Test_Bookings_POST__ValidationError(t *testing.T) { - t.Parallel() - cfg := getConfig() - e := httpexpect.Default(t, cfg.ServerURL) - - e.POST("/v1/bookings"). +func Test_Bookings_POST__EmptyBody_ValidationError(t *testing.T) { + getExpect(t).POST("/v1/bookings"). WithJSON(map[string]string{}). Expect(). Status(http.StatusBadRequest). diff --git a/test/integration/api/util_test.go b/test/integration/api/util_test.go index d8d5775..18b75bc 100644 --- a/test/integration/api/util_test.go +++ b/test/integration/api/util_test.go @@ -1,7 +1,9 @@ package main import ( + "github.com/gavv/httpexpect/v2" "github.com/kelseyhightower/envconfig" + "testing" ) type config struct { @@ -15,3 +17,9 @@ func getConfig() *config { } return cfg } + +func getExpect(t *testing.T) *httpexpect.Expect { + t.Parallel() + cfg := getConfig() + return httpexpect.Default(t, cfg.ServerURL) +}