From 25ea367c9dff541db23b1cab74ce3875d07e60ab Mon Sep 17 00:00:00 2001 From: "Ahmed M. Ammar" Date: Thu, 12 Oct 2023 03:44:03 +0300 Subject: [PATCH] Restore --- .github/workflows/cr.yml | 22 + .github/workflows/mockery.yml | 19 - README.md | 7 + README_zh.md | 7 + auth/auth_test.go | 6 +- auth/console/jwt_secret_command_test.go | 4 +- auth/console/policy_make_command_test.go | 2 +- cache/driver_test.go | 32 +- cache/memory_test.go | 2 +- console/console/key_generate_command_test.go | 4 +- console/console/make_command_test.go | 2 +- contracts/auth/access/gate.go | 1 + .../auth/access/mocks}/Gate.go | 11 +- contracts/auth/auth.go | 1 + {mocks/auth => contracts/auth/mocks}/Auth.go | 31 +- contracts/cache/cache.go | 3 + .../cache => contracts/cache/mocks}/Cache.go | 31 +- .../cache => contracts/cache/mocks}/Driver.go | 31 +- .../cache => contracts/cache/mocks}/Lock.go | 11 +- contracts/config/config.go | 1 + .../config/mocks}/Config.go | 13 +- contracts/console/artisan.go | 1 + contracts/console/command.go | 1 + .../console/mocks}/Artisan.go | 11 +- .../console/mocks}/Context.go | 11 +- contracts/crypt/crypt.go | 1 + .../crypt => contracts/crypt/mocks}/Crypt.go | 21 +- contracts/database/gorm/wire_interface.go | 19 - contracts/database/orm/factory.go | 1 + .../database/orm/mocks}/Association.go | 2 +- .../database/orm/mocks}/Cursor.go | 2 +- .../database/orm/mocks}/Factory.go | 11 +- .../database/orm/mocks}/Orm.go | 2 +- .../database/orm/mocks}/Query.go | 2 +- .../database/orm/mocks}/Transaction.go | 2 +- contracts/database/orm/orm.go | 5 + .../database/seeder/mocks}/Facade.go | 2 +- contracts/database/seeder/seeder.go | 1 + contracts/event/events.go | 2 + .../event/mocks}/Instance.go | 11 +- .../event => contracts/event/mocks}/Task.go | 11 +- .../filesystem/mocks}/Driver.go | 2 +- .../filesystem/mocks}/File.go | 85 +--- .../filesystem/mocks}/Storage.go | 37 +- contracts/filesystem/storage.go | 3 + contracts/foundation/application.go | 1 + .../foundation/mocks}/Application.go | 21 +- contracts/grpc/grpc.go | 1 + {mocks/grpc => contracts/grpc/mocks}/Grpc.go | 16 +- contracts/hash/hash.go | 1 + {mocks/hash => contracts/hash/mocks}/Hash.go | 16 +- contracts/http/context.go | 1 + .../http => contracts/http/mocks}/Context.go | 16 +- .../http/mocks}/ContextRequest.go | 2 +- .../http/mocks}/ContextResponse.go | 2 +- .../http/mocks}/RateLimiter.go | 11 +- .../http => contracts/http/mocks}/Response.go | 2 +- .../http/mocks}/ResponseOrigin.go | 2 +- .../http/mocks}/ResponseStatus.go | 2 +- .../http/mocks}/ResponseSuccess.go | 2 +- {mocks/http => contracts/http/mocks}/View.go | 2 +- contracts/http/rate_limiter.go | 1 + contracts/http/request.go | 1 + contracts/http/response.go | 5 + contracts/http/view.go | 1 + contracts/log/log.go | 5 + {mocks/log => contracts/log/mocks}/Entry.go | 2 +- {mocks/log => contracts/log/mocks}/Hook.go | 2 +- {mocks/log => contracts/log/mocks}/Log.go | 2 +- {mocks/log => contracts/log/mocks}/Logger.go | 2 +- {mocks/log => contracts/log/mocks}/Writer.go | 2 +- contracts/mail/mail.go | 1 + {mocks/mail => contracts/mail/mocks}/Mail.go | 11 +- .../queue => contracts/queue/mocks}/Queue.go | 11 +- .../queue => contracts/queue/mocks}/Task.go | 11 +- contracts/queue/queue.go | 1 + contracts/queue/task.go | 1 + .../route => contracts/route/mocks}/Route.go | 2 +- .../route => contracts/route/mocks}/Router.go | 2 +- contracts/route/route.go | 2 + contracts/schedule/event.go | 1 + .../schedule/mocks}/Event.go | 11 +- .../schedule/mocks}/Schedule.go | 11 +- contracts/schedule/schedule.go | 1 + .../validation/mocks}/Errors.go | 11 +- .../validation/mocks}/Validation.go | 16 +- .../validation/mocks}/Validator.go | 11 +- contracts/validation/validation.go | 3 + crypt/aes_test.go | 2 +- database/console/factory_make_command_test.go | 2 +- database/console/migrate_command_test.go | 4 +- database/console/migrate_creator_test.go | 2 +- .../console/migrate_fresh_command_test.go | 4 +- database/console/migrate_make_command_test.go | 4 +- .../console/migrate_refresh_command_test.go | 4 +- .../console/migrate_reset_command_test.go | 4 +- .../console/migrate_rollback_command_test.go | 4 +- .../console/migrate_status_command_test.go | 4 +- database/console/model_make_command_test.go | 2 +- .../console/observer_make_command_test.go | 2 +- database/console/seed_command_test.go | 6 +- database/console/seeder_make_command_test.go | 2 +- database/db/config_test.go | 2 +- database/db/dsn.go | 4 +- database/db/dsn_test.go | 6 +- database/gorm/cursor.go | 15 +- database/gorm/dialector_test.go | 6 +- database/gorm/event.go | 5 +- database/gorm/event_test.go | 28 +- database/gorm/gorm.go | 9 +- .../gorm/mocks}/Initialize.go | 36 +- database/gorm/query.go | 81 +-- database/gorm/query_test.go | 17 +- database/gorm/test_utils.go | 2 +- database/gorm/transaction.go | 5 +- database/gorm/utils_test.go | 4 +- database/gorm/wire_interface.go | 27 + database/wire_interface.go | 24 - event/console/event_make_command_test.go | 2 +- event/console/listener_make_command_test.go | 2 +- event/task_test.go | 2 +- filesystem/file_test.go | 2 +- filesystem/local_test.go | 2 +- foundation/application_test.go | 14 +- .../console/package_make_command_test.go | 2 +- foundation/console/test_make_command_test.go | 2 +- go.mod | 60 +-- go.sum | 135 ++--- grpc/application_test.go | 2 +- hash/application_test.go | 2 +- http/console/controller_make_command_test.go | 2 +- http/console/middleware_make_command_test.go | 2 +- http/console/request_make_command_test.go | 2 +- http/middleware/throttle_test.go | 6 +- log/formatter/general_test.go | 2 +- log/logrus_writer_test.go | 2 +- mail/application_test.go | 2 +- mocks/auth/access/Response.go | 52 -- mocks/console/Command.go | 85 ---- mocks/console/command/Flag.go | 38 -- mocks/database/factory/Factory.go | 40 -- mocks/database/factory/Model.go | 43 -- mocks/database/gorm/Gorm.go | 53 -- mocks/database/orm/ConnectionModel.go | 38 -- mocks/database/orm/DispatchesEvents.go | 43 -- mocks/database/orm/Event.go | 141 ------ mocks/database/orm/Observer.go | 181 ------- mocks/database/seeder/Seeder.go | 52 -- mocks/event/Event.go | 53 -- mocks/event/Listener.go | 73 --- mocks/foundation/Container.go | 475 ------------------ mocks/foundation/ServiceProvider.go | 37 -- mocks/http/FormRequest.go | 105 ---- mocks/http/HandlerFunc.go | 43 -- mocks/http/Limit.go | 59 --- mocks/http/Middleware.go | 32 -- mocks/http/ResourceController.go | 107 ---- mocks/http/ResponseView.go | 65 --- mocks/queue/Job.go | 54 -- mocks/queue/Worker.go | 38 -- mocks/route/GroupFunc.go | 32 -- mocks/testing/Database.go | 86 ---- mocks/testing/DatabaseDriver.go | 89 ---- mocks/testing/Docker.go | 59 --- mocks/testing/Testing.go | 43 -- mocks/validation/Data.go | 64 --- mocks/validation/Option.go | 29 -- mocks/validation/Rule.go | 72 --- queue/application_test.go | 4 +- queue/config_test.go | 2 +- queue/console/job_make_command_test.go | 2 +- queue/machinery_test.go | 2 +- schedule/application_test.go | 6 +- support/constant.go | 2 +- support/database/database.go | 2 +- testing/docker/database.go | 2 +- testing/docker/database_test.go | 8 +- testing/docker/docker.go | 6 +- testing/docker/docker_test.go | 4 +- testing/docker/mysql_test.go | 2 +- testing/docker/postgresql_test.go | 2 +- testing/docker/sqlite_test.go | 2 +- testing/docker/sqlserver_test.go | 2 +- testing/mock/mock.go | 34 +- testing/test_case_test.go | 2 +- validation/console/rule_make_command_test.go | 2 +- 186 files changed, 669 insertions(+), 3075 deletions(-) create mode 100644 .github/workflows/cr.yml delete mode 100644 .github/workflows/mockery.yml rename {mocks/auth/access => contracts/auth/access/mocks}/Gate.go (95%) rename {mocks/auth => contracts/auth/mocks}/Auth.go (85%) rename {mocks/cache => contracts/cache/mocks}/Cache.go (93%) rename {mocks/cache => contracts/cache/mocks}/Driver.go (93%) rename {mocks/cache => contracts/cache/mocks}/Lock.go (92%) rename {mocks/config => contracts/config/mocks}/Config.go (92%) rename {mocks/console => contracts/console/mocks}/Artisan.go (86%) rename {mocks/console => contracts/console/mocks}/Context.go (95%) rename {mocks/crypt => contracts/crypt/mocks}/Crypt.go (80%) delete mode 100644 contracts/database/gorm/wire_interface.go rename {mocks/database/orm => contracts/database/orm/mocks}/Association.go (97%) rename {mocks/database/orm => contracts/database/orm/mocks}/Cursor.go (94%) rename {mocks/database/orm => contracts/database/orm/mocks}/Factory.go (93%) rename {mocks/database/orm => contracts/database/orm/mocks}/Orm.go (98%) rename {mocks/database/orm => contracts/database/orm/mocks}/Query.go (99%) rename {mocks/database/orm => contracts/database/orm/mocks}/Transaction.go (99%) rename {mocks/database/seeder => contracts/database/seeder/mocks}/Facade.go (97%) rename {mocks/event => contracts/event/mocks}/Instance.go (89%) rename {mocks/event => contracts/event/mocks}/Task.go (81%) rename {mocks/filesystem => contracts/filesystem/mocks}/Driver.go (99%) rename {mocks/filesystem => contracts/filesystem/mocks}/File.go (70%) rename {mocks/filesystem => contracts/filesystem/mocks}/Storage.go (93%) rename {mocks/foundation => contracts/foundation/mocks}/Application.go (97%) rename {mocks/grpc => contracts/grpc/mocks}/Grpc.go (88%) rename {mocks/hash => contracts/hash/mocks}/Hash.go (86%) rename {mocks/http => contracts/http/mocks}/Context.go (92%) rename {mocks/http => contracts/http/mocks}/ContextRequest.go (99%) rename {mocks/http => contracts/http/mocks}/ContextResponse.go (99%) rename {mocks/http => contracts/http/mocks}/RateLimiter.go (87%) rename {mocks/http => contracts/http/mocks}/Response.go (93%) rename {mocks/http => contracts/http/mocks}/ResponseOrigin.go (97%) rename {mocks/http => contracts/http/mocks}/ResponseStatus.go (97%) rename {mocks/http => contracts/http/mocks}/ResponseSuccess.go (97%) rename {mocks/http => contracts/http/mocks}/View.go (97%) rename {mocks/log => contracts/log/mocks}/Entry.go (97%) rename {mocks/log => contracts/log/mocks}/Hook.go (95%) rename {mocks/log => contracts/log/mocks}/Log.go (99%) rename {mocks/log => contracts/log/mocks}/Logger.go (95%) rename {mocks/log => contracts/log/mocks}/Writer.go (99%) rename {mocks/mail => contracts/mail/mocks}/Mail.go (94%) rename {mocks/queue => contracts/queue/mocks}/Queue.go (92%) rename {mocks/queue => contracts/queue/mocks}/Task.go (92%) rename {mocks/route => contracts/route/mocks}/Route.go (99%) rename {mocks/route => contracts/route/mocks}/Router.go (98%) rename {mocks/schedule => contracts/schedule/mocks}/Event.go (98%) rename {mocks/schedule => contracts/schedule/mocks}/Schedule.go (89%) rename {mocks/validation => contracts/validation/mocks}/Errors.go (91%) rename {mocks/validation => contracts/validation/mocks}/Validation.go (86%) rename {mocks/validation => contracts/validation/mocks}/Validator.go (88%) rename {mocks/database/gorm => database/gorm/mocks}/Initialize.go (66%) create mode 100644 database/gorm/wire_interface.go delete mode 100644 database/wire_interface.go delete mode 100644 mocks/auth/access/Response.go delete mode 100644 mocks/console/Command.go delete mode 100644 mocks/console/command/Flag.go delete mode 100644 mocks/database/factory/Factory.go delete mode 100644 mocks/database/factory/Model.go delete mode 100644 mocks/database/gorm/Gorm.go delete mode 100644 mocks/database/orm/ConnectionModel.go delete mode 100644 mocks/database/orm/DispatchesEvents.go delete mode 100644 mocks/database/orm/Event.go delete mode 100644 mocks/database/orm/Observer.go delete mode 100644 mocks/database/seeder/Seeder.go delete mode 100644 mocks/event/Event.go delete mode 100644 mocks/event/Listener.go delete mode 100644 mocks/foundation/Container.go delete mode 100644 mocks/foundation/ServiceProvider.go delete mode 100644 mocks/http/FormRequest.go delete mode 100644 mocks/http/HandlerFunc.go delete mode 100644 mocks/http/Limit.go delete mode 100644 mocks/http/Middleware.go delete mode 100644 mocks/http/ResourceController.go delete mode 100644 mocks/http/ResponseView.go delete mode 100644 mocks/queue/Job.go delete mode 100644 mocks/queue/Worker.go delete mode 100644 mocks/route/GroupFunc.go delete mode 100644 mocks/testing/Database.go delete mode 100644 mocks/testing/DatabaseDriver.go delete mode 100644 mocks/testing/Docker.go delete mode 100644 mocks/testing/Testing.go delete mode 100644 mocks/validation/Data.go delete mode 100644 mocks/validation/Option.go delete mode 100644 mocks/validation/Rule.go diff --git a/.github/workflows/cr.yml b/.github/workflows/cr.yml new file mode 100644 index 000000000..849b1baf8 --- /dev/null +++ b/.github/workflows/cr.yml @@ -0,0 +1,22 @@ +name: Code Review + +permissions: + contents: read + pull-requests: write + +on: + pull_request: + types: [ opened, reopened, synchronize, labeled ] + +jobs: + test: + if: ${{ contains(github.event.pull_request.labels.*.name, '🚀 Review Ready') }} + runs-on: ubuntu-latest + steps: + - uses: anc95/ChatGPT-CodeReview@main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + OPENAI_API_ENDPOINT: https://api.openai-sb.com/v1 + MODEL: gpt-3.5-turbo + PROMPT: "Below is a code patch, please help me do a brief code review on it. Only answer important bug risks and/or important improvement suggestions, Answer must be concisely and short: " diff --git a/.github/workflows/mockery.yml b/.github/workflows/mockery.yml deleted file mode 100644 index a73921250..000000000 --- a/.github/workflows/mockery.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Mockery -on: - pull_request: -jobs: - mockery: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Install Mockery - run: | - go install github.com/vektra/mockery/v2@v2.34.2 - - name: Generate Mocks - run: | - ~/go/bin/mockery --all --keeptree --dir=contracts - - uses: stefanzweifel/git-auto-commit-action@v5 - name: Commit changes - with: - commit_message: "chore: update mocks" diff --git a/README.md b/README.md index 3f7dc046a..3105d0474 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,13 @@ This project exists thanks to all the people who contribute, to participate in t + + +## Sponsor + +Better development of the project is inseparable from your support, reward us by [Open Collective](https://opencollective.com/goravel). + +

## Group diff --git a/README_zh.md b/README_zh.md index 6effb16dc..ef37dfac9 100644 --- a/README_zh.md +++ b/README_zh.md @@ -67,6 +67,13 @@ Laravel! + + +## 打赏 + +开源项目的发展离不开您的支持,感谢微信打赏。 + +

## 群组 diff --git a/auth/auth_test.go b/auth/auth_test.go index 31ede125f..50202c3a3 100644 --- a/auth/auth_test.go +++ b/auth/auth_test.go @@ -13,11 +13,11 @@ import ( "gorm.io/gorm/clause" authcontract "github.com/goravel/framework/contracts/auth" + cachemock "github.com/goravel/framework/contracts/cache/mocks" + configmock "github.com/goravel/framework/contracts/config/mocks" + ormmock "github.com/goravel/framework/contracts/database/orm/mocks" "github.com/goravel/framework/contracts/http" "github.com/goravel/framework/database/orm" - cachemock "github.com/goravel/framework/mocks/cache" - configmock "github.com/goravel/framework/mocks/config" - ormmock "github.com/goravel/framework/mocks/database/orm" "github.com/goravel/framework/support/carbon" ) diff --git a/auth/console/jwt_secret_command_test.go b/auth/console/jwt_secret_command_test.go index 9a31b3263..33ab17070 100644 --- a/auth/console/jwt_secret_command_test.go +++ b/auth/console/jwt_secret_command_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - configmock "github.com/goravel/framework/mocks/config" - consolemocks "github.com/goravel/framework/mocks/console" + configmock "github.com/goravel/framework/contracts/config/mocks" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support" "github.com/goravel/framework/support/file" ) diff --git a/auth/console/policy_make_command_test.go b/auth/console/policy_make_command_test.go index a550c7ce1..b379b8559 100644 --- a/auth/console/policy_make_command_test.go +++ b/auth/console/policy_make_command_test.go @@ -3,7 +3,7 @@ package console import ( "testing" - consolemocks "github.com/goravel/framework/mocks/console" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support/file" "github.com/stretchr/testify/assert" diff --git a/cache/driver_test.go b/cache/driver_test.go index 2503ad65c..296c58fc1 100644 --- a/cache/driver_test.go +++ b/cache/driver_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/suite" "github.com/goravel/framework/contracts/cache" - configmock "github.com/goravel/framework/mocks/config" - logmock "github.com/goravel/framework/mocks/log" + configmock "github.com/goravel/framework/contracts/config/mocks" + logmock "github.com/goravel/framework/contracts/log/mocks" ) type DriverTestSuite struct { @@ -74,7 +74,7 @@ func (s *DriverTestSuite) TestStore() { type Store struct { } -// Add Store an item in the cache if the key does not exist. +//Add Store an item in the cache if the key does not exist. func (r *Store) Add(key string, value any, seconds time.Duration) bool { return true } @@ -83,47 +83,47 @@ func (r *Store) Decrement(key string, value ...int) (int, error) { return 1, nil } -// Forever Store an item in the cache indefinitely. +//Forever Store an item in the cache indefinitely. func (r *Store) Forever(key string, value any) bool { return true } -// Forget Remove an item from the cache. +//Forget Remove an item from the cache. func (r *Store) Forget(key string) bool { return true } -// Flush Remove all items from the cache. +//Flush Remove all items from the cache. func (r *Store) Flush() bool { return true } -// Get Retrieve an item from the cache by key. +//Get Retrieve an item from the cache by key. func (r *Store) Get(key string, def ...any) any { return key } -// Get Retrieve an item from the cache by key. +//Get Retrieve an item from the cache by key. func (r *Store) GetBool(key string, def ...bool) bool { return false } -// Get Retrieve an item from the cache by key. +//Get Retrieve an item from the cache by key. func (r *Store) GetInt(key string, def ...int) int { return 1 } -// Get Retrieve an item from the cache by key. +//Get Retrieve an item from the cache by key. func (r *Store) GetInt64(key string, def ...int64) int64 { return 1 } -// Get Retrieve an item from the cache by key. +//Get Retrieve an item from the cache by key. func (r *Store) GetString(key string, def ...string) string { return "" } -// Has Check an item exists in the cache. +//Has Check an item exists in the cache. func (r *Store) Has(key string) bool { return true } @@ -136,22 +136,22 @@ func (r *Store) Lock(key string, second ...time.Duration) cache.Lock { return nil } -// Pull Retrieve an item from the cache and delete it. +//Pull Retrieve an item from the cache and delete it. func (r *Store) Pull(key string, def ...any) any { return def } -// Put Store an item in the cache for a given number of seconds. +//Put Store an item in the cache for a given number of seconds. func (r *Store) Put(key string, value any, seconds time.Duration) error { return nil } -// Remember Get an item from the cache, or execute the given Closure and store the result. +//Remember Get an item from the cache, or execute the given Closure and store the result. func (r *Store) Remember(key string, ttl time.Duration, callback func() (any, error)) (any, error) { return "", nil } -// RememberForever Get an item from the cache, or execute the given Closure and store the result forever. +//RememberForever Get an item from the cache, or execute the given Closure and store the result forever. func (r *Store) RememberForever(key string, callback func() (any, error)) (any, error) { return "", nil } diff --git a/cache/memory_test.go b/cache/memory_test.go index c234e4b7b..58b215902 100644 --- a/cache/memory_test.go +++ b/cache/memory_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/suite" - configmock "github.com/goravel/framework/mocks/config" + configmock "github.com/goravel/framework/contracts/config/mocks" ) type MemoryTestSuite struct { diff --git a/console/console/key_generate_command_test.go b/console/console/key_generate_command_test.go index 849ee410f..f8f609499 100644 --- a/console/console/key_generate_command_test.go +++ b/console/console/key_generate_command_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - configmock "github.com/goravel/framework/mocks/config" - consolemocks "github.com/goravel/framework/mocks/console" + configmock "github.com/goravel/framework/contracts/config/mocks" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support" "github.com/goravel/framework/support/file" ) diff --git a/console/console/make_command_test.go b/console/console/make_command_test.go index af1f6350d..a3946481c 100644 --- a/console/console/make_command_test.go +++ b/console/console/make_command_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - consolemocks "github.com/goravel/framework/mocks/console" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support/file" ) diff --git a/contracts/auth/access/gate.go b/contracts/auth/access/gate.go index 981cd4910..c27290e0b 100644 --- a/contracts/auth/access/gate.go +++ b/contracts/auth/access/gate.go @@ -2,6 +2,7 @@ package access import "context" +//go:generate mockery --name=Gate type Gate interface { // WithContext returns a new Gate instance with the given context. WithContext(ctx context.Context) Gate diff --git a/mocks/auth/access/Gate.go b/contracts/auth/access/mocks/Gate.go similarity index 95% rename from mocks/auth/access/Gate.go rename to contracts/auth/access/mocks/Gate.go index 376efc099..df04d0655 100644 --- a/mocks/auth/access/Gate.go +++ b/contracts/auth/access/mocks/Gate.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -118,12 +118,13 @@ func (_m *Gate) WithContext(ctx context.Context) access.Gate { return r0 } -// NewGate creates a new instance of Gate. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewGate(t interface { +type mockConstructorTestingTNewGate interface { mock.TestingT Cleanup(func()) -}) *Gate { +} + +// NewGate creates a new instance of Gate. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewGate(t mockConstructorTestingTNewGate) *Gate { mock := &Gate{} mock.Mock.Test(t) diff --git a/contracts/auth/auth.go b/contracts/auth/auth.go index 778c42b21..8b368e336 100644 --- a/contracts/auth/auth.go +++ b/contracts/auth/auth.go @@ -6,6 +6,7 @@ import ( "github.com/goravel/framework/contracts/http" ) +//go:generate mockery --name=Auth type Auth interface { // Guard attempts to get the guard against the local cache. Guard(name string) Auth diff --git a/mocks/auth/Auth.go b/contracts/auth/mocks/Auth.go similarity index 85% rename from mocks/auth/Auth.go rename to contracts/auth/mocks/Auth.go index ef8e228cc..7b6fb5c77 100644 --- a/mocks/auth/Auth.go +++ b/contracts/auth/mocks/Auth.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -35,16 +35,13 @@ func (_m *Auth) Login(ctx http.Context, user interface{}) (string, error) { ret := _m.Called(ctx, user) var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(http.Context, interface{}) (string, error)); ok { - return rf(ctx, user) - } if rf, ok := ret.Get(0).(func(http.Context, interface{}) string); ok { r0 = rf(ctx, user) } else { r0 = ret.Get(0).(string) } + var r1 error if rf, ok := ret.Get(1).(func(http.Context, interface{}) error); ok { r1 = rf(ctx, user) } else { @@ -59,16 +56,13 @@ func (_m *Auth) LoginUsingID(ctx http.Context, id interface{}) (string, error) { ret := _m.Called(ctx, id) var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(http.Context, interface{}) (string, error)); ok { - return rf(ctx, id) - } if rf, ok := ret.Get(0).(func(http.Context, interface{}) string); ok { r0 = rf(ctx, id) } else { r0 = ret.Get(0).(string) } + var r1 error if rf, ok := ret.Get(1).(func(http.Context, interface{}) error); ok { r1 = rf(ctx, id) } else { @@ -97,10 +91,6 @@ func (_m *Auth) Parse(ctx http.Context, token string) (*auth.Payload, error) { ret := _m.Called(ctx, token) var r0 *auth.Payload - var r1 error - if rf, ok := ret.Get(0).(func(http.Context, string) (*auth.Payload, error)); ok { - return rf(ctx, token) - } if rf, ok := ret.Get(0).(func(http.Context, string) *auth.Payload); ok { r0 = rf(ctx, token) } else { @@ -109,6 +99,7 @@ func (_m *Auth) Parse(ctx http.Context, token string) (*auth.Payload, error) { } } + var r1 error if rf, ok := ret.Get(1).(func(http.Context, string) error); ok { r1 = rf(ctx, token) } else { @@ -123,16 +114,13 @@ func (_m *Auth) Refresh(ctx http.Context) (string, error) { ret := _m.Called(ctx) var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(http.Context) (string, error)); ok { - return rf(ctx) - } if rf, ok := ret.Get(0).(func(http.Context) string); ok { r0 = rf(ctx) } else { r0 = ret.Get(0).(string) } + var r1 error if rf, ok := ret.Get(1).(func(http.Context) error); ok { r1 = rf(ctx) } else { @@ -156,12 +144,13 @@ func (_m *Auth) User(ctx http.Context, user interface{}) error { return r0 } -// NewAuth creates a new instance of Auth. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewAuth(t interface { +type mockConstructorTestingTNewAuth interface { mock.TestingT Cleanup(func()) -}) *Auth { +} + +// NewAuth creates a new instance of Auth. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewAuth(t mockConstructorTestingTNewAuth) *Auth { mock := &Auth{} mock.Mock.Test(t) diff --git a/contracts/cache/cache.go b/contracts/cache/cache.go index c2e5483a7..9f35d80fa 100644 --- a/contracts/cache/cache.go +++ b/contracts/cache/cache.go @@ -5,11 +5,13 @@ import ( "time" ) +//go:generate mockery --name=Cache type Cache interface { Driver Store(name string) Driver } +//go:generate mockery --name=Driver type Driver interface { // Add an item in the cache if the key does not exist. Add(key string, value any, t time.Duration) bool @@ -49,6 +51,7 @@ type Driver interface { WithContext(ctx context.Context) Driver } +//go:generate mockery --name=Lock type Lock interface { // Block attempt to acquire the lock for the given number of seconds. Block(t time.Duration, callback ...func()) bool diff --git a/mocks/cache/Cache.go b/contracts/cache/mocks/Cache.go similarity index 93% rename from mocks/cache/Cache.go rename to contracts/cache/mocks/Cache.go index e0b0b9838..94abe8f60 100644 --- a/mocks/cache/Cache.go +++ b/contracts/cache/mocks/Cache.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -43,16 +43,13 @@ func (_m *Cache) Decrement(key string, value ...int) (int, error) { ret := _m.Called(_ca...) var r0 int - var r1 error - if rf, ok := ret.Get(0).(func(string, ...int) (int, error)); ok { - return rf(key, value...) - } if rf, ok := ret.Get(0).(func(string, ...int) int); ok { r0 = rf(key, value...) } else { r0 = ret.Get(0).(int) } + var r1 error if rf, ok := ret.Get(1).(func(string, ...int) error); ok { r1 = rf(key, value...) } else { @@ -233,16 +230,13 @@ func (_m *Cache) Increment(key string, value ...int) (int, error) { ret := _m.Called(_ca...) var r0 int - var r1 error - if rf, ok := ret.Get(0).(func(string, ...int) (int, error)); ok { - return rf(key, value...) - } if rf, ok := ret.Get(0).(func(string, ...int) int); ok { r0 = rf(key, value...) } else { r0 = ret.Get(0).(int) } + var r1 error if rf, ok := ret.Get(1).(func(string, ...int) error); ok { r1 = rf(key, value...) } else { @@ -313,10 +307,6 @@ func (_m *Cache) Remember(key string, ttl time.Duration, callback func() (interf ret := _m.Called(key, ttl, callback) var r0 interface{} - var r1 error - if rf, ok := ret.Get(0).(func(string, time.Duration, func() (interface{}, error)) (interface{}, error)); ok { - return rf(key, ttl, callback) - } if rf, ok := ret.Get(0).(func(string, time.Duration, func() (interface{}, error)) interface{}); ok { r0 = rf(key, ttl, callback) } else { @@ -325,6 +315,7 @@ func (_m *Cache) Remember(key string, ttl time.Duration, callback func() (interf } } + var r1 error if rf, ok := ret.Get(1).(func(string, time.Duration, func() (interface{}, error)) error); ok { r1 = rf(key, ttl, callback) } else { @@ -339,10 +330,6 @@ func (_m *Cache) RememberForever(key string, callback func() (interface{}, error ret := _m.Called(key, callback) var r0 interface{} - var r1 error - if rf, ok := ret.Get(0).(func(string, func() (interface{}, error)) (interface{}, error)); ok { - return rf(key, callback) - } if rf, ok := ret.Get(0).(func(string, func() (interface{}, error)) interface{}); ok { r0 = rf(key, callback) } else { @@ -351,6 +338,7 @@ func (_m *Cache) RememberForever(key string, callback func() (interface{}, error } } + var r1 error if rf, ok := ret.Get(1).(func(string, func() (interface{}, error)) error); ok { r1 = rf(key, callback) } else { @@ -392,12 +380,13 @@ func (_m *Cache) WithContext(ctx context.Context) cache.Driver { return r0 } -// NewCache creates a new instance of Cache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewCache(t interface { +type mockConstructorTestingTNewCache interface { mock.TestingT Cleanup(func()) -}) *Cache { +} + +// NewCache creates a new instance of Cache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewCache(t mockConstructorTestingTNewCache) *Cache { mock := &Cache{} mock.Mock.Test(t) diff --git a/mocks/cache/Driver.go b/contracts/cache/mocks/Driver.go similarity index 93% rename from mocks/cache/Driver.go rename to contracts/cache/mocks/Driver.go index fd5404eab..24032fe8d 100644 --- a/mocks/cache/Driver.go +++ b/contracts/cache/mocks/Driver.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -43,16 +43,13 @@ func (_m *Driver) Decrement(key string, value ...int) (int, error) { ret := _m.Called(_ca...) var r0 int - var r1 error - if rf, ok := ret.Get(0).(func(string, ...int) (int, error)); ok { - return rf(key, value...) - } if rf, ok := ret.Get(0).(func(string, ...int) int); ok { r0 = rf(key, value...) } else { r0 = ret.Get(0).(int) } + var r1 error if rf, ok := ret.Get(1).(func(string, ...int) error); ok { r1 = rf(key, value...) } else { @@ -233,16 +230,13 @@ func (_m *Driver) Increment(key string, value ...int) (int, error) { ret := _m.Called(_ca...) var r0 int - var r1 error - if rf, ok := ret.Get(0).(func(string, ...int) (int, error)); ok { - return rf(key, value...) - } if rf, ok := ret.Get(0).(func(string, ...int) int); ok { r0 = rf(key, value...) } else { r0 = ret.Get(0).(int) } + var r1 error if rf, ok := ret.Get(1).(func(string, ...int) error); ok { r1 = rf(key, value...) } else { @@ -313,10 +307,6 @@ func (_m *Driver) Remember(key string, ttl time.Duration, callback func() (inter ret := _m.Called(key, ttl, callback) var r0 interface{} - var r1 error - if rf, ok := ret.Get(0).(func(string, time.Duration, func() (interface{}, error)) (interface{}, error)); ok { - return rf(key, ttl, callback) - } if rf, ok := ret.Get(0).(func(string, time.Duration, func() (interface{}, error)) interface{}); ok { r0 = rf(key, ttl, callback) } else { @@ -325,6 +315,7 @@ func (_m *Driver) Remember(key string, ttl time.Duration, callback func() (inter } } + var r1 error if rf, ok := ret.Get(1).(func(string, time.Duration, func() (interface{}, error)) error); ok { r1 = rf(key, ttl, callback) } else { @@ -339,10 +330,6 @@ func (_m *Driver) RememberForever(key string, callback func() (interface{}, erro ret := _m.Called(key, callback) var r0 interface{} - var r1 error - if rf, ok := ret.Get(0).(func(string, func() (interface{}, error)) (interface{}, error)); ok { - return rf(key, callback) - } if rf, ok := ret.Get(0).(func(string, func() (interface{}, error)) interface{}); ok { r0 = rf(key, callback) } else { @@ -351,6 +338,7 @@ func (_m *Driver) RememberForever(key string, callback func() (interface{}, erro } } + var r1 error if rf, ok := ret.Get(1).(func(string, func() (interface{}, error)) error); ok { r1 = rf(key, callback) } else { @@ -376,12 +364,13 @@ func (_m *Driver) WithContext(ctx context.Context) cache.Driver { return r0 } -// NewDriver creates a new instance of Driver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewDriver(t interface { +type mockConstructorTestingTNewDriver interface { mock.TestingT Cleanup(func()) -}) *Driver { +} + +// NewDriver creates a new instance of Driver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewDriver(t mockConstructorTestingTNewDriver) *Driver { mock := &Driver{} mock.Mock.Test(t) diff --git a/mocks/cache/Lock.go b/contracts/cache/mocks/Lock.go similarity index 92% rename from mocks/cache/Lock.go rename to contracts/cache/mocks/Lock.go index b9787937e..afb5ada52 100644 --- a/mocks/cache/Lock.go +++ b/contracts/cache/mocks/Lock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -82,12 +82,13 @@ func (_m *Lock) Release() bool { return r0 } -// NewLock creates a new instance of Lock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewLock(t interface { +type mockConstructorTestingTNewLock interface { mock.TestingT Cleanup(func()) -}) *Lock { +} + +// NewLock creates a new instance of Lock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewLock(t mockConstructorTestingTNewLock) *Lock { mock := &Lock{} mock.Mock.Test(t) diff --git a/contracts/config/config.go b/contracts/config/config.go index 1b1430ea1..f5ed30d37 100644 --- a/contracts/config/config.go +++ b/contracts/config/config.go @@ -1,5 +1,6 @@ package config +//go:generate mockery --name=Config type Config interface { // Env get config from env. Env(envName string, defaultValue ...any) any diff --git a/mocks/config/Config.go b/contracts/config/mocks/Config.go similarity index 92% rename from mocks/config/Config.go rename to contracts/config/mocks/Config.go index 93c2faaa5..86059875d 100644 --- a/mocks/config/Config.go +++ b/contracts/config/mocks/Config.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -10,7 +10,7 @@ type Config struct { } // Add provides a mock function with given fields: name, configuration -func (_m *Config) Add(name string, configuration interface{}) { +func (_m *Config) Add(name string, configuration any) { _m.Called(name, configuration) } @@ -103,12 +103,13 @@ func (_m *Config) GetString(path string, defaultValue ...interface{}) string { return r0 } -// NewConfig creates a new instance of Config. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewConfig(t interface { +type mockConstructorTestingTNewConfig interface { mock.TestingT Cleanup(func()) -}) *Config { +} + +// NewConfig creates a new instance of Config. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewConfig(t mockConstructorTestingTNewConfig) *Config { mock := &Config{} mock.Mock.Test(t) diff --git a/contracts/console/artisan.go b/contracts/console/artisan.go index 565efd666..a1ee5357e 100644 --- a/contracts/console/artisan.go +++ b/contracts/console/artisan.go @@ -1,5 +1,6 @@ package console +//go:generate mockery --name=Artisan type Artisan interface { // Register commands. Register(commands []Command) diff --git a/contracts/console/command.go b/contracts/console/command.go index 2aa251439..cdc89f176 100644 --- a/contracts/console/command.go +++ b/contracts/console/command.go @@ -15,6 +15,7 @@ type Command interface { Handle(ctx Context) error } +//go:generate mockery --name=Context type Context interface { // Argument get the value of a command argument. Argument(index int) string diff --git a/mocks/console/Artisan.go b/contracts/console/mocks/Artisan.go similarity index 86% rename from mocks/console/Artisan.go rename to contracts/console/mocks/Artisan.go index 3247a58a4..15a5d588f 100644 --- a/mocks/console/Artisan.go +++ b/contracts/console/mocks/Artisan.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -32,12 +32,13 @@ func (_m *Artisan) Run(args []string, exitIfArtisan bool) { _m.Called(args, exitIfArtisan) } -// NewArtisan creates a new instance of Artisan. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewArtisan(t interface { +type mockConstructorTestingTNewArtisan interface { mock.TestingT Cleanup(func()) -}) *Artisan { +} + +// NewArtisan creates a new instance of Artisan. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewArtisan(t mockConstructorTestingTNewArtisan) *Artisan { mock := &Artisan{} mock.Mock.Test(t) diff --git a/mocks/console/Context.go b/contracts/console/mocks/Context.go similarity index 95% rename from mocks/console/Context.go rename to contracts/console/mocks/Context.go index 64f340e72..04721587f 100644 --- a/mocks/console/Context.go +++ b/contracts/console/mocks/Context.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -173,12 +173,13 @@ func (_m *Context) OptionSlice(key string) []string { return r0 } -// NewContext creates a new instance of Context. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewContext(t interface { +type mockConstructorTestingTNewContext interface { mock.TestingT Cleanup(func()) -}) *Context { +} + +// NewContext creates a new instance of Context. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewContext(t mockConstructorTestingTNewContext) *Context { mock := &Context{} mock.Mock.Test(t) diff --git a/contracts/crypt/crypt.go b/contracts/crypt/crypt.go index fc5ff1d05..dc7f05774 100644 --- a/contracts/crypt/crypt.go +++ b/contracts/crypt/crypt.go @@ -1,5 +1,6 @@ package crypt +//go:generate mockery --name=Crypt type Crypt interface { // EncryptString encrypts the given string value, returning the encrypted string and an error if any. EncryptString(value string) (string, error) diff --git a/mocks/crypt/Crypt.go b/contracts/crypt/mocks/Crypt.go similarity index 80% rename from mocks/crypt/Crypt.go rename to contracts/crypt/mocks/Crypt.go index 36ed47520..de1fda318 100644 --- a/mocks/crypt/Crypt.go +++ b/contracts/crypt/mocks/Crypt.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.19.0. DO NOT EDIT. package mocks @@ -14,16 +14,13 @@ func (_m *Crypt) DecryptString(payload string) (string, error) { ret := _m.Called(payload) var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(string) (string, error)); ok { - return rf(payload) - } if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(payload) } else { r0 = ret.Get(0).(string) } + var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(payload) } else { @@ -38,16 +35,13 @@ func (_m *Crypt) EncryptString(value string) (string, error) { ret := _m.Called(value) var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(string) (string, error)); ok { - return rf(value) - } if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(value) } else { r0 = ret.Get(0).(string) } + var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(value) } else { @@ -57,12 +51,13 @@ func (_m *Crypt) EncryptString(value string) (string, error) { return r0, r1 } -// NewCrypt creates a new instance of Crypt. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewCrypt(t interface { +type mockConstructorTestingTNewCrypt interface { mock.TestingT Cleanup(func()) -}) *Crypt { +} + +// NewCrypt creates a new instance of Crypt. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewCrypt(t mockConstructorTestingTNewCrypt) *Crypt { mock := &Crypt{} mock.Mock.Test(t) diff --git a/contracts/database/gorm/wire_interface.go b/contracts/database/gorm/wire_interface.go deleted file mode 100644 index 841eeb3ce..000000000 --- a/contracts/database/gorm/wire_interface.go +++ /dev/null @@ -1,19 +0,0 @@ -package gorm - -import ( - "context" - - gormio "gorm.io/gorm" - - "github.com/goravel/framework/contracts/config" - "github.com/goravel/framework/contracts/database/orm" -) - -type Gorm interface { - Make() (*gormio.DB, error) -} - -type Initialize interface { - InitializeGorm(config config.Config, connection string) Gorm - InitializeQuery(ctx context.Context, config config.Config, connection string) (orm.Query, error) -} diff --git a/contracts/database/orm/factory.go b/contracts/database/orm/factory.go index 165672a01..7e679eae4 100644 --- a/contracts/database/orm/factory.go +++ b/contracts/database/orm/factory.go @@ -1,5 +1,6 @@ package orm +//go:generate mockery --name=Factory type Factory interface { // Count sets the number of models that should be generated. Count(count int) Factory diff --git a/mocks/database/orm/Association.go b/contracts/database/orm/mocks/Association.go similarity index 97% rename from mocks/database/orm/Association.go rename to contracts/database/orm/mocks/Association.go index 25c9e857e..aa00ffce2 100644 --- a/mocks/database/orm/Association.go +++ b/contracts/database/orm/mocks/Association.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.30.1. DO NOT EDIT. package mocks diff --git a/mocks/database/orm/Cursor.go b/contracts/database/orm/mocks/Cursor.go similarity index 94% rename from mocks/database/orm/Cursor.go rename to contracts/database/orm/mocks/Cursor.go index 2e493ac4d..756d9310b 100644 --- a/mocks/database/orm/Cursor.go +++ b/contracts/database/orm/mocks/Cursor.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.30.1. DO NOT EDIT. package mocks diff --git a/mocks/database/orm/Factory.go b/contracts/database/orm/mocks/Factory.go similarity index 93% rename from mocks/database/orm/Factory.go rename to contracts/database/orm/mocks/Factory.go index 1fdf9088a..269c2e9d8 100644 --- a/mocks/database/orm/Factory.go +++ b/contracts/database/orm/mocks/Factory.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -91,12 +91,13 @@ func (_m *Factory) Make(value interface{}, attributes ...map[string]interface{}) return r0 } -// NewFactory creates a new instance of Factory. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewFactory(t interface { +type mockConstructorTestingTNewFactory interface { mock.TestingT Cleanup(func()) -}) *Factory { +} + +// NewFactory creates a new instance of Factory. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewFactory(t mockConstructorTestingTNewFactory) *Factory { mock := &Factory{} mock.Mock.Test(t) diff --git a/mocks/database/orm/Orm.go b/contracts/database/orm/mocks/Orm.go similarity index 98% rename from mocks/database/orm/Orm.go rename to contracts/database/orm/mocks/Orm.go index aa0acd3a6..a0c653267 100644 --- a/mocks/database/orm/Orm.go +++ b/contracts/database/orm/mocks/Orm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.30.1. DO NOT EDIT. package mocks diff --git a/mocks/database/orm/Query.go b/contracts/database/orm/mocks/Query.go similarity index 99% rename from mocks/database/orm/Query.go rename to contracts/database/orm/mocks/Query.go index 1a6b88f0d..aa7aa4b7f 100644 --- a/mocks/database/orm/Query.go +++ b/contracts/database/orm/mocks/Query.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.30.1. DO NOT EDIT. package mocks diff --git a/mocks/database/orm/Transaction.go b/contracts/database/orm/mocks/Transaction.go similarity index 99% rename from mocks/database/orm/Transaction.go rename to contracts/database/orm/mocks/Transaction.go index 2aa42939d..30c61ccfb 100644 --- a/mocks/database/orm/Transaction.go +++ b/contracts/database/orm/mocks/Transaction.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.30.1. DO NOT EDIT. package mocks diff --git a/contracts/database/orm/orm.go b/contracts/database/orm/orm.go index 73ca3f835..8e18e7faf 100644 --- a/contracts/database/orm/orm.go +++ b/contracts/database/orm/orm.go @@ -5,6 +5,7 @@ import ( "database/sql" ) +//go:generate mockery --name=Orm type Orm interface { // Connection gets an Orm instance from the connection pool. Connection(name string) Orm @@ -22,6 +23,7 @@ type Orm interface { WithContext(ctx context.Context) Orm } +//go:generate mockery --name=Transaction type Transaction interface { Query // Commit commits the changes in a transaction. @@ -30,6 +32,7 @@ type Transaction interface { Rollback() error } +//go:generate mockery --name=Query type Query interface { // Association gets an association instance by name. Association(association string) Association @@ -131,6 +134,7 @@ type Query interface { With(query string, args ...any) Query } +//go:generate mockery --name=Association type Association interface { // Find finds records that match given conditions. Find(out any, conds ...any) error @@ -151,6 +155,7 @@ type ConnectionModel interface { Connection() string } +//go:generate mockery --name=Cursor type Cursor interface { // Scan scans the current row into the given destination. Scan(value any) error diff --git a/mocks/database/seeder/Facade.go b/contracts/database/seeder/mocks/Facade.go similarity index 97% rename from mocks/database/seeder/Facade.go rename to contracts/database/seeder/mocks/Facade.go index 870143464..33beaa45c 100644 --- a/mocks/database/seeder/Facade.go +++ b/contracts/database/seeder/mocks/Facade.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.30.1. DO NOT EDIT. package mocks diff --git a/contracts/database/seeder/seeder.go b/contracts/database/seeder/seeder.go index eff9cd434..8e6f6c1b3 100644 --- a/contracts/database/seeder/seeder.go +++ b/contracts/database/seeder/seeder.go @@ -1,5 +1,6 @@ package seeder +//go:generate mockery --name=Facade type Facade interface { // Register registers seeders. Register(seeders []Seeder) diff --git a/contracts/event/events.go b/contracts/event/events.go index 5b1e96a44..4c47913cb 100644 --- a/contracts/event/events.go +++ b/contracts/event/events.go @@ -1,5 +1,6 @@ package event +//go:generate mockery --name=Instance type Instance interface { // Register event listeners to the application. Register(map[Event][]Listener) @@ -23,6 +24,7 @@ type Listener interface { Handle(args ...any) error } +//go:generate mockery --name=Task type Task interface { // Dispatch an event and call the listeners. Dispatch() error diff --git a/mocks/event/Instance.go b/contracts/event/mocks/Instance.go similarity index 89% rename from mocks/event/Instance.go rename to contracts/event/mocks/Instance.go index 7bcef81c8..fa32f2f23 100644 --- a/mocks/event/Instance.go +++ b/contracts/event/mocks/Instance.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -49,12 +49,13 @@ func (_m *Instance) Register(_a0 map[event.Event][]event.Listener) { _m.Called(_a0) } -// NewInstance creates a new instance of Instance. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewInstance(t interface { +type mockConstructorTestingTNewInstance interface { mock.TestingT Cleanup(func()) -}) *Instance { +} + +// NewInstance creates a new instance of Instance. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewInstance(t mockConstructorTestingTNewInstance) *Instance { mock := &Instance{} mock.Mock.Test(t) diff --git a/mocks/event/Task.go b/contracts/event/mocks/Task.go similarity index 81% rename from mocks/event/Task.go rename to contracts/event/mocks/Task.go index 884f94fa5..d7672d2f1 100644 --- a/mocks/event/Task.go +++ b/contracts/event/mocks/Task.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -23,12 +23,13 @@ func (_m *Task) Dispatch() error { return r0 } -// NewTask creates a new instance of Task. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewTask(t interface { +type mockConstructorTestingTNewTask interface { mock.TestingT Cleanup(func()) -}) *Task { +} + +// NewTask creates a new instance of Task. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewTask(t mockConstructorTestingTNewTask) *Task { mock := &Task{} mock.Mock.Test(t) diff --git a/mocks/filesystem/Driver.go b/contracts/filesystem/mocks/Driver.go similarity index 99% rename from mocks/filesystem/Driver.go rename to contracts/filesystem/mocks/Driver.go index 04f9c70be..b3824b6db 100644 --- a/mocks/filesystem/Driver.go +++ b/contracts/filesystem/mocks/Driver.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.33.2. DO NOT EDIT. package mocks diff --git a/mocks/filesystem/File.go b/contracts/filesystem/mocks/File.go similarity index 70% rename from mocks/filesystem/File.go rename to contracts/filesystem/mocks/File.go index 1006644cc..34b75f304 100644 --- a/mocks/filesystem/File.go +++ b/contracts/filesystem/mocks/File.go @@ -1,12 +1,10 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.20.0. DO NOT EDIT. package mocks import ( filesystem "github.com/goravel/framework/contracts/filesystem" mock "github.com/stretchr/testify/mock" - - time "time" ) // File is an autogenerated mock type for the File type @@ -116,78 +114,6 @@ func (_m *File) HashName(path ...string) string { return r0 } -// LastModified provides a mock function with given fields: -func (_m *File) LastModified() (time.Time, error) { - ret := _m.Called() - - var r0 time.Time - var r1 error - if rf, ok := ret.Get(0).(func() (time.Time, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() time.Time); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(time.Time) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MimeType provides a mock function with given fields: -func (_m *File) MimeType() (string, error) { - ret := _m.Called() - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func() (string, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Size provides a mock function with given fields: -func (_m *File) Size() (int64, error) { - ret := _m.Called() - - var r0 int64 - var r1 error - if rf, ok := ret.Get(0).(func() (int64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - // Store provides a mock function with given fields: path func (_m *File) Store(path string) (string, error) { ret := _m.Called(path) @@ -236,12 +162,13 @@ func (_m *File) StoreAs(path string, name string) (string, error) { return r0, r1 } -// NewFile creates a new instance of File. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewFile(t interface { +type mockConstructorTestingTNewFile interface { mock.TestingT Cleanup(func()) -}) *File { +} + +// NewFile creates a new instance of File. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewFile(t mockConstructorTestingTNewFile) *File { mock := &File{} mock.Mock.Test(t) diff --git a/mocks/filesystem/Storage.go b/contracts/filesystem/mocks/Storage.go similarity index 93% rename from mocks/filesystem/Storage.go rename to contracts/filesystem/mocks/Storage.go index b31b7f8c3..e42f9000a 100644 --- a/mocks/filesystem/Storage.go +++ b/contracts/filesystem/mocks/Storage.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.20.0. DO NOT EDIT. package mocks @@ -222,32 +222,6 @@ func (_m *Storage) Get(file string) (string, error) { return r0, r1 } -// GetBytes provides a mock function with given fields: file -func (_m *Storage) GetBytes(file string) ([]byte, error) { - ret := _m.Called(file) - - var r0 []byte - var r1 error - if rf, ok := ret.Get(0).(func(string) ([]byte, error)); ok { - return rf(file) - } - if rf, ok := ret.Get(0).(func(string) []byte); ok { - r0 = rf(file) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(file) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - // LastModified provides a mock function with given fields: file func (_m *Storage) LastModified(file string) (time.Time, error) { ret := _m.Called(file) @@ -492,12 +466,13 @@ func (_m *Storage) WithContext(ctx context.Context) filesystem.Driver { return r0 } -// NewStorage creates a new instance of Storage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewStorage(t interface { +type mockConstructorTestingTNewStorage interface { mock.TestingT Cleanup(func()) -}) *Storage { +} + +// NewStorage creates a new instance of Storage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewStorage(t mockConstructorTestingTNewStorage) *Storage { mock := &Storage{} mock.Mock.Test(t) diff --git a/contracts/filesystem/storage.go b/contracts/filesystem/storage.go index 88530503e..c56dd2486 100644 --- a/contracts/filesystem/storage.go +++ b/contracts/filesystem/storage.go @@ -5,12 +5,14 @@ import ( "time" ) +//go:generate mockery --name=Storage type Storage interface { Driver // Disk gets the instance of the given disk. Disk(disk string) Driver } +//go:generate mockery --name=Driver type Driver interface { // AllDirectories gets all the directories within a given directory(recursive). AllDirectories(path string) ([]string, error) @@ -60,6 +62,7 @@ type Driver interface { Url(file string) string } +//go:generate mockery --name=File type File interface { // Disk gets the instance of the given disk. Disk(disk string) File diff --git a/contracts/foundation/application.go b/contracts/foundation/application.go index d67c2f06d..e5e0ddf25 100644 --- a/contracts/foundation/application.go +++ b/contracts/foundation/application.go @@ -4,6 +4,7 @@ import ( "github.com/goravel/framework/contracts/console" ) +//go:generate mockery --name=Application type Application interface { Container // Boot register and bootstrap configured service providers. diff --git a/mocks/foundation/Application.go b/contracts/foundation/mocks/Application.go similarity index 97% rename from mocks/foundation/Application.go rename to contracts/foundation/mocks/Application.go index d296b8f77..b807f3045 100644 --- a/mocks/foundation/Application.go +++ b/contracts/foundation/mocks/Application.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -124,10 +124,6 @@ func (_m *Application) Make(key interface{}) (interface{}, error) { ret := _m.Called(key) var r0 interface{} - var r1 error - if rf, ok := ret.Get(0).(func(interface{}) (interface{}, error)); ok { - return rf(key) - } if rf, ok := ret.Get(0).(func(interface{}) interface{}); ok { r0 = rf(key) } else { @@ -136,6 +132,7 @@ func (_m *Application) Make(key interface{}) (interface{}, error) { } } + var r1 error if rf, ok := ret.Get(1).(func(interface{}) error); ok { r1 = rf(key) } else { @@ -486,10 +483,6 @@ func (_m *Application) MakeWith(key interface{}, parameters map[string]interface ret := _m.Called(key, parameters) var r0 interface{} - var r1 error - if rf, ok := ret.Get(0).(func(interface{}, map[string]interface{}) (interface{}, error)); ok { - return rf(key, parameters) - } if rf, ok := ret.Get(0).(func(interface{}, map[string]interface{}) interface{}); ok { r0 = rf(key, parameters) } else { @@ -498,6 +491,7 @@ func (_m *Application) MakeWith(key interface{}, parameters map[string]interface } } + var r1 error if rf, ok := ret.Get(1).(func(interface{}, map[string]interface{}) error); ok { r1 = rf(key, parameters) } else { @@ -566,12 +560,13 @@ func (_m *Application) StoragePath(path string) string { return r0 } -// NewApplication creates a new instance of Application. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewApplication(t interface { +type mockConstructorTestingTNewApplication interface { mock.TestingT Cleanup(func()) -}) *Application { +} + +// NewApplication creates a new instance of Application. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewApplication(t mockConstructorTestingTNewApplication) *Application { mock := &Application{} mock.Mock.Test(t) diff --git a/contracts/grpc/grpc.go b/contracts/grpc/grpc.go index 84b42b6e8..c1f4ad5d2 100644 --- a/contracts/grpc/grpc.go +++ b/contracts/grpc/grpc.go @@ -6,6 +6,7 @@ import ( "google.golang.org/grpc" ) +//go:generate mockery --name=Grpc type Grpc interface { // Run starts the gRPC server. Run(host ...string) error diff --git a/mocks/grpc/Grpc.go b/contracts/grpc/mocks/Grpc.go similarity index 88% rename from mocks/grpc/Grpc.go rename to contracts/grpc/mocks/Grpc.go index 5c0ae592f..341d87935 100644 --- a/mocks/grpc/Grpc.go +++ b/contracts/grpc/mocks/Grpc.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -20,10 +20,6 @@ func (_m *Grpc) Client(ctx context.Context, name string) (*grpc.ClientConn, erro ret := _m.Called(ctx, name) var r0 *grpc.ClientConn - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*grpc.ClientConn, error)); ok { - return rf(ctx, name) - } if rf, ok := ret.Get(0).(func(context.Context, string) *grpc.ClientConn); ok { r0 = rf(ctx, name) } else { @@ -32,6 +28,7 @@ func (_m *Grpc) Client(ctx context.Context, name string) (*grpc.ClientConn, erro } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, name) } else { @@ -87,12 +84,13 @@ func (_m *Grpc) UnaryServerInterceptors(_a0 []grpc.UnaryServerInterceptor) { _m.Called(_a0) } -// NewGrpc creates a new instance of Grpc. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewGrpc(t interface { +type mockConstructorTestingTNewGrpc interface { mock.TestingT Cleanup(func()) -}) *Grpc { +} + +// NewGrpc creates a new instance of Grpc. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewGrpc(t mockConstructorTestingTNewGrpc) *Grpc { mock := &Grpc{} mock.Mock.Test(t) diff --git a/contracts/hash/hash.go b/contracts/hash/hash.go index 76b64b0e1..b08e36b3b 100644 --- a/contracts/hash/hash.go +++ b/contracts/hash/hash.go @@ -1,5 +1,6 @@ package hash +//go:generate mockery --name=Hash type Hash interface { // Make returns the hashed value of the given string. Make(value string) (string, error) diff --git a/mocks/hash/Hash.go b/contracts/hash/mocks/Hash.go similarity index 86% rename from mocks/hash/Hash.go rename to contracts/hash/mocks/Hash.go index 0e3b6cd86..de564f588 100644 --- a/mocks/hash/Hash.go +++ b/contracts/hash/mocks/Hash.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.19.0. DO NOT EDIT. package mocks @@ -28,16 +28,13 @@ func (_m *Hash) Make(value string) (string, error) { ret := _m.Called(value) var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(string) (string, error)); ok { - return rf(value) - } if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(value) } else { r0 = ret.Get(0).(string) } + var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(value) } else { @@ -61,12 +58,13 @@ func (_m *Hash) NeedsRehash(hashedValue string) bool { return r0 } -// NewHash creates a new instance of Hash. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewHash(t interface { +type mockConstructorTestingTNewHash interface { mock.TestingT Cleanup(func()) -}) *Hash { +} + +// NewHash creates a new instance of Hash. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewHash(t mockConstructorTestingTNewHash) *Hash { mock := &Hash{} mock.Mock.Test(t) diff --git a/contracts/http/context.go b/contracts/http/context.go index 6bfe3a18d..2ec0ee27c 100644 --- a/contracts/http/context.go +++ b/contracts/http/context.go @@ -19,6 +19,7 @@ type ResourceController interface { Destroy(Context) Response } +//go:generate mockery --name=Context type Context interface { context.Context // Context returns the Context diff --git a/mocks/http/Context.go b/contracts/http/mocks/Context.go similarity index 92% rename from mocks/http/Context.go rename to contracts/http/mocks/Context.go index 47109b5bd..0ff7628b6 100644 --- a/mocks/http/Context.go +++ b/contracts/http/mocks/Context.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -37,16 +37,13 @@ func (_m *Context) Deadline() (time.Time, bool) { ret := _m.Called() var r0 time.Time - var r1 bool - if rf, ok := ret.Get(0).(func() (time.Time, bool)); ok { - return rf() - } if rf, ok := ret.Get(0).(func() time.Time); ok { r0 = rf() } else { r0 = ret.Get(0).(time.Time) } + var r1 bool if rf, ok := ret.Get(1).(func() bool); ok { r1 = rf() } else { @@ -139,12 +136,13 @@ func (_m *Context) WithValue(key string, value interface{}) { _m.Called(key, value) } -// NewContext creates a new instance of Context. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewContext(t interface { +type mockConstructorTestingTNewContext interface { mock.TestingT Cleanup(func()) -}) *Context { +} + +// NewContext creates a new instance of Context. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewContext(t mockConstructorTestingTNewContext) *Context { mock := &Context{} mock.Mock.Test(t) diff --git a/mocks/http/ContextRequest.go b/contracts/http/mocks/ContextRequest.go similarity index 99% rename from mocks/http/ContextRequest.go rename to contracts/http/mocks/ContextRequest.go index 935b8520b..c20f9b51f 100644 --- a/mocks/http/ContextRequest.go +++ b/contracts/http/mocks/ContextRequest.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.33.1. DO NOT EDIT. package mocks diff --git a/mocks/http/ContextResponse.go b/contracts/http/mocks/ContextResponse.go similarity index 99% rename from mocks/http/ContextResponse.go rename to contracts/http/mocks/ContextResponse.go index b02625120..8b858764c 100644 --- a/mocks/http/ContextResponse.go +++ b/contracts/http/mocks/ContextResponse.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.33.1. DO NOT EDIT. package mocks diff --git a/mocks/http/RateLimiter.go b/contracts/http/mocks/RateLimiter.go similarity index 87% rename from mocks/http/RateLimiter.go rename to contracts/http/mocks/RateLimiter.go index 2a19090dd..97e1f6c2d 100644 --- a/mocks/http/RateLimiter.go +++ b/contracts/http/mocks/RateLimiter.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -38,12 +38,13 @@ func (_m *RateLimiter) Limiter(name string) func(http.Context) []http.Limit { return r0 } -// NewRateLimiter creates a new instance of RateLimiter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewRateLimiter(t interface { +type mockConstructorTestingTNewRateLimiter interface { mock.TestingT Cleanup(func()) -}) *RateLimiter { +} + +// NewRateLimiter creates a new instance of RateLimiter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewRateLimiter(t mockConstructorTestingTNewRateLimiter) *RateLimiter { mock := &RateLimiter{} mock.Mock.Test(t) diff --git a/mocks/http/Response.go b/contracts/http/mocks/Response.go similarity index 93% rename from mocks/http/Response.go rename to contracts/http/mocks/Response.go index 4d94d2fe6..4118cc51c 100644 --- a/mocks/http/Response.go +++ b/contracts/http/mocks/Response.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.33.1. DO NOT EDIT. package mocks diff --git a/mocks/http/ResponseOrigin.go b/contracts/http/mocks/ResponseOrigin.go similarity index 97% rename from mocks/http/ResponseOrigin.go rename to contracts/http/mocks/ResponseOrigin.go index 7ada6d658..17b06d70b 100644 --- a/mocks/http/ResponseOrigin.go +++ b/contracts/http/mocks/ResponseOrigin.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.33.1. DO NOT EDIT. package mocks diff --git a/mocks/http/ResponseStatus.go b/contracts/http/mocks/ResponseStatus.go similarity index 97% rename from mocks/http/ResponseStatus.go rename to contracts/http/mocks/ResponseStatus.go index f26b374aa..bb16768a1 100644 --- a/mocks/http/ResponseStatus.go +++ b/contracts/http/mocks/ResponseStatus.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.33.1. DO NOT EDIT. package mocks diff --git a/mocks/http/ResponseSuccess.go b/contracts/http/mocks/ResponseSuccess.go similarity index 97% rename from mocks/http/ResponseSuccess.go rename to contracts/http/mocks/ResponseSuccess.go index ccabf4a28..245057382 100644 --- a/mocks/http/ResponseSuccess.go +++ b/contracts/http/mocks/ResponseSuccess.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.33.1. DO NOT EDIT. package mocks diff --git a/mocks/http/View.go b/contracts/http/mocks/View.go similarity index 97% rename from mocks/http/View.go rename to contracts/http/mocks/View.go index 0c7bdf8b2..f2c09202d 100644 --- a/mocks/http/View.go +++ b/contracts/http/mocks/View.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.33.1. DO NOT EDIT. package mocks diff --git a/contracts/http/rate_limiter.go b/contracts/http/rate_limiter.go index 4ff07890a..eebffa1b2 100644 --- a/contracts/http/rate_limiter.go +++ b/contracts/http/rate_limiter.go @@ -1,5 +1,6 @@ package http +//go:generate mockery --name=RateLimiter type RateLimiter interface { // For register a new rate limiter. For(name string, callback func(ctx Context) Limit) diff --git a/contracts/http/request.go b/contracts/http/request.go index a8e84de51..a45ebb328 100644 --- a/contracts/http/request.go +++ b/contracts/http/request.go @@ -7,6 +7,7 @@ import ( "github.com/goravel/framework/contracts/validation" ) +//go:generate mockery --name=ContextRequest type ContextRequest interface { // Header retrieves the value of the specified HTTP header by its key. // If the header is not found, it returns the optional default value (if provided). diff --git a/contracts/http/response.go b/contracts/http/response.go index 860224f9c..8fcfe4a50 100644 --- a/contracts/http/response.go +++ b/contracts/http/response.go @@ -7,10 +7,12 @@ import ( type Json map[string]any +//go:generate mockery --name=Response type Response interface { Render() error } +//go:generate mockery --name=ContextResponse type ContextResponse interface { // Data write the given data to the response. Data(code int, contentType string, data []byte) Response @@ -41,6 +43,7 @@ type ContextResponse interface { Flush() } +//go:generate mockery --name=ResponseStatus type ResponseStatus interface { // Data write the given data to the Response. Data(contentType string, data []byte) Response @@ -50,6 +53,7 @@ type ResponseStatus interface { String(format string, values ...any) Response } +//go:generate mockery --name=ResponseSuccess type ResponseSuccess interface { // Data write the given data to the Response. Data(contentType string, data []byte) Response @@ -59,6 +63,7 @@ type ResponseSuccess interface { String(format string, values ...any) Response } +//go:generate mockery --name=ResponseOrigin type ResponseOrigin interface { // Body returns the response's body content as a *bytes.Buffer. Body() *bytes.Buffer diff --git a/contracts/http/view.go b/contracts/http/view.go index d93aece63..4c82769d6 100644 --- a/contracts/http/view.go +++ b/contracts/http/view.go @@ -1,5 +1,6 @@ package http +//go:generate mockery --name=View type View interface { // Exists checks if a view with the specified name exists. Exists(view string) bool diff --git a/contracts/log/log.go b/contracts/log/log.go index d33a2921d..7bffec635 100644 --- a/contracts/log/log.go +++ b/contracts/log/log.go @@ -23,12 +23,14 @@ const ( DebugLevel ) +//go:generate mockery --name=Log type Log interface { // WithContext adds a context to the logger. WithContext(ctx context.Context) Writer Writer } +//go:generate mockery --name=Writer type Writer interface { // Debug logs a message at DebugLevel. Debug(args ...any) @@ -77,11 +79,13 @@ type Writer interface { With(data map[string]any) Writer } +//go:generate mockery --name=Logger type Logger interface { // Handle pass a channel config path here Handle(channel string) (Hook, error) } +//go:generate mockery --name=Hook type Hook interface { // Levels monitoring level Levels() []Level @@ -89,6 +93,7 @@ type Hook interface { Fire(Entry) error } +//go:generate mockery --name=Entry type Entry interface { // Context returns the context of the entry. Context() context.Context diff --git a/mocks/log/Entry.go b/contracts/log/mocks/Entry.go similarity index 97% rename from mocks/log/Entry.go rename to contracts/log/mocks/Entry.go index ed2ed69af..40fab5127 100644 --- a/mocks/log/Entry.go +++ b/contracts/log/mocks/Entry.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.33.1. DO NOT EDIT. package mocks diff --git a/mocks/log/Hook.go b/contracts/log/mocks/Hook.go similarity index 95% rename from mocks/log/Hook.go rename to contracts/log/mocks/Hook.go index 360366276..6d5809d28 100644 --- a/mocks/log/Hook.go +++ b/contracts/log/mocks/Hook.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.33.1. DO NOT EDIT. package mocks diff --git a/mocks/log/Log.go b/contracts/log/mocks/Log.go similarity index 99% rename from mocks/log/Log.go rename to contracts/log/mocks/Log.go index 7cf8d63e4..7317cb73f 100644 --- a/mocks/log/Log.go +++ b/contracts/log/mocks/Log.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.33.1. DO NOT EDIT. package mocks diff --git a/mocks/log/Logger.go b/contracts/log/mocks/Logger.go similarity index 95% rename from mocks/log/Logger.go rename to contracts/log/mocks/Logger.go index a0ba15eaa..4b8607a2b 100644 --- a/mocks/log/Logger.go +++ b/contracts/log/mocks/Logger.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.33.1. DO NOT EDIT. package mocks diff --git a/mocks/log/Writer.go b/contracts/log/mocks/Writer.go similarity index 99% rename from mocks/log/Writer.go rename to contracts/log/mocks/Writer.go index 030a8c460..2fc944f39 100644 --- a/mocks/log/Writer.go +++ b/contracts/log/mocks/Writer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.33.1. DO NOT EDIT. package mocks diff --git a/contracts/mail/mail.go b/contracts/mail/mail.go index deae468d6..aa1bcec2c 100644 --- a/contracts/mail/mail.go +++ b/contracts/mail/mail.go @@ -1,5 +1,6 @@ package mail +//go:generate mockery --name=Mail type Mail interface { // Content set the content of Mail. Content(content Content) Mail diff --git a/mocks/mail/Mail.go b/contracts/mail/mocks/Mail.go similarity index 94% rename from mocks/mail/Mail.go rename to contracts/mail/mocks/Mail.go index e71349751..40842efd0 100644 --- a/mocks/mail/Mail.go +++ b/contracts/mail/mocks/Mail.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -136,12 +136,13 @@ func (_m *Mail) To(addresses []string) mail.Mail { return r0 } -// NewMail creates a new instance of Mail. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMail(t interface { +type mockConstructorTestingTNewMail interface { mock.TestingT Cleanup(func()) -}) *Mail { +} + +// NewMail creates a new instance of Mail. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewMail(t mockConstructorTestingTNewMail) *Mail { mock := &Mail{} mock.Mock.Test(t) diff --git a/mocks/queue/Queue.go b/contracts/queue/mocks/Queue.go similarity index 92% rename from mocks/queue/Queue.go rename to contracts/queue/mocks/Queue.go index b4b1eedd9..91765e66b 100644 --- a/mocks/queue/Queue.go +++ b/contracts/queue/mocks/Queue.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -81,12 +81,13 @@ func (_m *Queue) Worker(args *queue.Args) queue.Worker { return r0 } -// NewQueue creates a new instance of Queue. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewQueue(t interface { +type mockConstructorTestingTNewQueue interface { mock.TestingT Cleanup(func()) -}) *Queue { +} + +// NewQueue creates a new instance of Queue. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewQueue(t mockConstructorTestingTNewQueue) *Queue { mock := &Queue{} mock.Mock.Test(t) diff --git a/mocks/queue/Task.go b/contracts/queue/mocks/Task.go similarity index 92% rename from mocks/queue/Task.go rename to contracts/queue/mocks/Task.go index d35089871..b8cac98ba 100644 --- a/mocks/queue/Task.go +++ b/contracts/queue/mocks/Task.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -90,12 +90,13 @@ func (_m *Task) OnQueue(_a0 string) queue.Task { return r0 } -// NewTask creates a new instance of Task. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewTask(t interface { +type mockConstructorTestingTNewTask interface { mock.TestingT Cleanup(func()) -}) *Task { +} + +// NewTask creates a new instance of Task. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewTask(t mockConstructorTestingTNewTask) *Task { mock := &Task{} mock.Mock.Test(t) diff --git a/contracts/queue/queue.go b/contracts/queue/queue.go index fd107791e..c703e6480 100644 --- a/contracts/queue/queue.go +++ b/contracts/queue/queue.go @@ -1,5 +1,6 @@ package queue +//go:generate mockery --name=Queue type Queue interface { Worker(args *Args) Worker // Register register jobs diff --git a/contracts/queue/task.go b/contracts/queue/task.go index ff7a1df5b..9e80da11c 100644 --- a/contracts/queue/task.go +++ b/contracts/queue/task.go @@ -4,6 +4,7 @@ import ( "time" ) +//go:generate mockery --name=Task type Task interface { // Dispatch dispatches the task. Dispatch() error diff --git a/mocks/route/Route.go b/contracts/route/mocks/Route.go similarity index 99% rename from mocks/route/Route.go rename to contracts/route/mocks/Route.go index 6d35aee8c..391d3d521 100644 --- a/mocks/route/Route.go +++ b/contracts/route/mocks/Route.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.33.1. DO NOT EDIT. package mocks diff --git a/mocks/route/Router.go b/contracts/route/mocks/Router.go similarity index 98% rename from mocks/route/Router.go rename to contracts/route/mocks/Router.go index 9b62197bc..425383bb2 100644 --- a/mocks/route/Router.go +++ b/contracts/route/mocks/Router.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.33.1. DO NOT EDIT. package mocks diff --git a/contracts/route/route.go b/contracts/route/route.go index 29a10c256..344df27c7 100644 --- a/contracts/route/route.go +++ b/contracts/route/route.go @@ -8,6 +8,7 @@ import ( type GroupFunc func(router Router) +//go:generate mockery --name=Route type Route interface { Router // Fallback registers a handler to be executed when no other route was matched. @@ -24,6 +25,7 @@ type Route interface { ServeHTTP(writer http.ResponseWriter, request *http.Request) } +//go:generate mockery --name=Router type Router interface { // Group creates a new router group with the specified handler. Group(handler GroupFunc) diff --git a/contracts/schedule/event.go b/contracts/schedule/event.go index 9c5163468..024eabc1d 100644 --- a/contracts/schedule/event.go +++ b/contracts/schedule/event.go @@ -1,5 +1,6 @@ package schedule +//go:generate mockery --name=Event type Event interface { // At schedule the event to run at the specified time. At(time string) Event diff --git a/mocks/schedule/Event.go b/contracts/schedule/mocks/Event.go similarity index 98% rename from mocks/schedule/Event.go rename to contracts/schedule/mocks/Event.go index 88793dcbd..575e5a6fd 100644 --- a/mocks/schedule/Event.go +++ b/contracts/schedule/mocks/Event.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -464,12 +464,13 @@ func (_m *Event) SkipIfStillRunning() schedule.Event { return r0 } -// NewEvent creates a new instance of Event. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewEvent(t interface { +type mockConstructorTestingTNewEvent interface { mock.TestingT Cleanup(func()) -}) *Event { +} + +// NewEvent creates a new instance of Event. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewEvent(t mockConstructorTestingTNewEvent) *Event { mock := &Event{} mock.Mock.Test(t) diff --git a/mocks/schedule/Schedule.go b/contracts/schedule/mocks/Schedule.go similarity index 89% rename from mocks/schedule/Schedule.go rename to contracts/schedule/mocks/Schedule.go index 6e0530a16..cf6e04cfe 100644 --- a/mocks/schedule/Schedule.go +++ b/contracts/schedule/mocks/Schedule.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -54,12 +54,13 @@ func (_m *Schedule) Run() { _m.Called() } -// NewSchedule creates a new instance of Schedule. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewSchedule(t interface { +type mockConstructorTestingTNewSchedule interface { mock.TestingT Cleanup(func()) -}) *Schedule { +} + +// NewSchedule creates a new instance of Schedule. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewSchedule(t mockConstructorTestingTNewSchedule) *Schedule { mock := &Schedule{} mock.Mock.Test(t) diff --git a/contracts/schedule/schedule.go b/contracts/schedule/schedule.go index 441f652e0..ef031bf32 100644 --- a/contracts/schedule/schedule.go +++ b/contracts/schedule/schedule.go @@ -1,5 +1,6 @@ package schedule +//go:generate mockery --name=Schedule type Schedule interface { // Call add a new callback event to the schedule. Call(callback func()) Event diff --git a/mocks/validation/Errors.go b/contracts/validation/mocks/Errors.go similarity index 91% rename from mocks/validation/Errors.go rename to contracts/validation/mocks/Errors.go index 2ecf934ab..238fa7d53 100644 --- a/mocks/validation/Errors.go +++ b/contracts/validation/mocks/Errors.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -75,12 +75,13 @@ func (_m *Errors) One(key ...string) string { return r0 } -// NewErrors creates a new instance of Errors. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewErrors(t interface { +type mockConstructorTestingTNewErrors interface { mock.TestingT Cleanup(func()) -}) *Errors { +} + +// NewErrors creates a new instance of Errors. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewErrors(t mockConstructorTestingTNewErrors) *Errors { mock := &Errors{} mock.Mock.Test(t) diff --git a/mocks/validation/Validation.go b/contracts/validation/mocks/Validation.go similarity index 86% rename from mocks/validation/Validation.go rename to contracts/validation/mocks/Validation.go index fef8d86eb..1aee37e62 100644 --- a/mocks/validation/Validation.go +++ b/contracts/validation/mocks/Validation.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -38,10 +38,6 @@ func (_m *Validation) Make(data interface{}, rules map[string]string, options .. ret := _m.Called(_ca...) var r0 validation.Validator - var r1 error - if rf, ok := ret.Get(0).(func(interface{}, map[string]string, ...validation.Option) (validation.Validator, error)); ok { - return rf(data, rules, options...) - } if rf, ok := ret.Get(0).(func(interface{}, map[string]string, ...validation.Option) validation.Validator); ok { r0 = rf(data, rules, options...) } else { @@ -50,6 +46,7 @@ func (_m *Validation) Make(data interface{}, rules map[string]string, options .. } } + var r1 error if rf, ok := ret.Get(1).(func(interface{}, map[string]string, ...validation.Option) error); ok { r1 = rf(data, rules, options...) } else { @@ -75,12 +72,13 @@ func (_m *Validation) Rules() []validation.Rule { return r0 } -// NewValidation creates a new instance of Validation. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewValidation(t interface { +type mockConstructorTestingTNewValidation interface { mock.TestingT Cleanup(func()) -}) *Validation { +} + +// NewValidation creates a new instance of Validation. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewValidation(t mockConstructorTestingTNewValidation) *Validation { mock := &Validation{} mock.Mock.Test(t) diff --git a/mocks/validation/Validator.go b/contracts/validation/mocks/Validator.go similarity index 88% rename from mocks/validation/Validator.go rename to contracts/validation/mocks/Validator.go index 7e79ad18f..5d4491fcc 100644 --- a/mocks/validation/Validator.go +++ b/contracts/validation/mocks/Validator.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -56,12 +56,13 @@ func (_m *Validator) Fails() bool { return r0 } -// NewValidator creates a new instance of Validator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewValidator(t interface { +type mockConstructorTestingTNewValidator interface { mock.TestingT Cleanup(func()) -}) *Validator { +} + +// NewValidator creates a new instance of Validator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewValidator(t mockConstructorTestingTNewValidator) *Validator { mock := &Validator{} mock.Mock.Test(t) diff --git a/contracts/validation/validation.go b/contracts/validation/validation.go index 089e0b319..94065e5a0 100644 --- a/contracts/validation/validation.go +++ b/contracts/validation/validation.go @@ -2,6 +2,7 @@ package validation type Option func(map[string]any) +//go:generate mockery --name=Validation type Validation interface { // Make create a new validator instance. Make(data any, rules map[string]string, options ...Option) (Validator, error) @@ -11,6 +12,7 @@ type Validation interface { Rules() []Rule } +//go:generate mockery --name=Validator type Validator interface { // Bind the data to the validation. Bind(ptr any) error @@ -20,6 +22,7 @@ type Validator interface { Fails() bool } +//go:generate mockery --name=Errors type Errors interface { // One gets the first error message for a given field. One(key ...string) string diff --git a/crypt/aes_test.go b/crypt/aes_test.go index 7ed36b2c8..9b048d269 100644 --- a/crypt/aes_test.go +++ b/crypt/aes_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/suite" - configmock "github.com/goravel/framework/mocks/config" + configmock "github.com/goravel/framework/contracts/config/mocks" ) type AesTestSuite struct { diff --git a/database/console/factory_make_command_test.go b/database/console/factory_make_command_test.go index c5a389d95..510a663a6 100644 --- a/database/console/factory_make_command_test.go +++ b/database/console/factory_make_command_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - consolemocks "github.com/goravel/framework/mocks/console" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support/file" ) diff --git a/database/console/migrate_command_test.go b/database/console/migrate_command_test.go index 1ca17637e..e88061a55 100644 --- a/database/console/migrate_command_test.go +++ b/database/console/migrate_command_test.go @@ -6,11 +6,11 @@ import ( "github.com/ory/dockertest/v3" "github.com/stretchr/testify/assert" + configmock "github.com/goravel/framework/contracts/config/mocks" + consolemock "github.com/goravel/framework/contracts/console/mocks" ormcontract "github.com/goravel/framework/contracts/database/orm" "github.com/goravel/framework/database/gorm" "github.com/goravel/framework/database/orm" - configmock "github.com/goravel/framework/mocks/config" - consolemock "github.com/goravel/framework/mocks/console" "github.com/goravel/framework/support/file" ) diff --git a/database/console/migrate_creator_test.go b/database/console/migrate_creator_test.go index 305b7f6ac..c9297b7a4 100644 --- a/database/console/migrate_creator_test.go +++ b/database/console/migrate_creator_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - configmock "github.com/goravel/framework/mocks/config" + configmock "github.com/goravel/framework/contracts/config/mocks" "github.com/goravel/framework/support/carbon" "github.com/goravel/framework/support/file" ) diff --git a/database/console/migrate_fresh_command_test.go b/database/console/migrate_fresh_command_test.go index 83e092135..87996e503 100644 --- a/database/console/migrate_fresh_command_test.go +++ b/database/console/migrate_fresh_command_test.go @@ -6,10 +6,10 @@ import ( "github.com/ory/dockertest/v3" "github.com/stretchr/testify/assert" + configmock "github.com/goravel/framework/contracts/config/mocks" + consolemocks "github.com/goravel/framework/contracts/console/mocks" ormcontract "github.com/goravel/framework/contracts/database/orm" "github.com/goravel/framework/database/gorm" - configmock "github.com/goravel/framework/mocks/config" - consolemocks "github.com/goravel/framework/mocks/console" ) func TestMigrateFreshCommand(t *testing.T) { diff --git a/database/console/migrate_make_command_test.go b/database/console/migrate_make_command_test.go index 1aa4027e5..80a82c32e 100644 --- a/database/console/migrate_make_command_test.go +++ b/database/console/migrate_make_command_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - configmock "github.com/goravel/framework/mocks/config" - consolemocks "github.com/goravel/framework/mocks/console" + configmock "github.com/goravel/framework/contracts/config/mocks" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support/carbon" "github.com/goravel/framework/support/file" ) diff --git a/database/console/migrate_refresh_command_test.go b/database/console/migrate_refresh_command_test.go index e600837c5..b48cc61b6 100644 --- a/database/console/migrate_refresh_command_test.go +++ b/database/console/migrate_refresh_command_test.go @@ -6,10 +6,10 @@ import ( "github.com/ory/dockertest/v3" "github.com/stretchr/testify/assert" + configmock "github.com/goravel/framework/contracts/config/mocks" + consolemocks "github.com/goravel/framework/contracts/console/mocks" ormcontract "github.com/goravel/framework/contracts/database/orm" "github.com/goravel/framework/database/gorm" - configmock "github.com/goravel/framework/mocks/config" - consolemocks "github.com/goravel/framework/mocks/console" ) func TestMigrateRefreshCommand(t *testing.T) { diff --git a/database/console/migrate_reset_command_test.go b/database/console/migrate_reset_command_test.go index 3e875d58f..cd3985c6a 100644 --- a/database/console/migrate_reset_command_test.go +++ b/database/console/migrate_reset_command_test.go @@ -6,10 +6,10 @@ import ( "github.com/ory/dockertest/v3" "github.com/stretchr/testify/assert" + configmock "github.com/goravel/framework/contracts/config/mocks" + consolemocks "github.com/goravel/framework/contracts/console/mocks" ormcontract "github.com/goravel/framework/contracts/database/orm" "github.com/goravel/framework/database/gorm" - configmock "github.com/goravel/framework/mocks/config" - consolemocks "github.com/goravel/framework/mocks/console" ) func TestMigrateResetCommand(t *testing.T) { diff --git a/database/console/migrate_rollback_command_test.go b/database/console/migrate_rollback_command_test.go index 75c243c04..b078ec5f6 100644 --- a/database/console/migrate_rollback_command_test.go +++ b/database/console/migrate_rollback_command_test.go @@ -6,10 +6,10 @@ import ( "github.com/ory/dockertest/v3" "github.com/stretchr/testify/assert" + configmock "github.com/goravel/framework/contracts/config/mocks" + consolemocks "github.com/goravel/framework/contracts/console/mocks" ormcontract "github.com/goravel/framework/contracts/database/orm" "github.com/goravel/framework/database/gorm" - configmock "github.com/goravel/framework/mocks/config" - consolemocks "github.com/goravel/framework/mocks/console" ) func TestMigrateRollbackCommand(t *testing.T) { diff --git a/database/console/migrate_status_command_test.go b/database/console/migrate_status_command_test.go index 05f60e934..d72e7a5cf 100644 --- a/database/console/migrate_status_command_test.go +++ b/database/console/migrate_status_command_test.go @@ -6,10 +6,10 @@ import ( "github.com/ory/dockertest/v3" "github.com/stretchr/testify/assert" + configmock "github.com/goravel/framework/contracts/config/mocks" + consolemocks "github.com/goravel/framework/contracts/console/mocks" ormcontract "github.com/goravel/framework/contracts/database/orm" "github.com/goravel/framework/database/gorm" - configmock "github.com/goravel/framework/mocks/config" - consolemocks "github.com/goravel/framework/mocks/console" ) func TestMigrateStatusCommand(t *testing.T) { diff --git a/database/console/model_make_command_test.go b/database/console/model_make_command_test.go index fe69a7789..c213414b6 100644 --- a/database/console/model_make_command_test.go +++ b/database/console/model_make_command_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - consolemocks "github.com/goravel/framework/mocks/console" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support/file" ) diff --git a/database/console/observer_make_command_test.go b/database/console/observer_make_command_test.go index 1d74ca939..50da17c0b 100644 --- a/database/console/observer_make_command_test.go +++ b/database/console/observer_make_command_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - consolemocks "github.com/goravel/framework/mocks/console" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support/file" ) diff --git a/database/console/seed_command_test.go b/database/console/seed_command_test.go index 38efc81b7..349ca77d1 100644 --- a/database/console/seed_command_test.go +++ b/database/console/seed_command_test.go @@ -5,10 +5,10 @@ import ( "github.com/stretchr/testify/suite" + configmocks "github.com/goravel/framework/contracts/config/mocks" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/contracts/database/seeder" - configmocks "github.com/goravel/framework/mocks/config" - consolemocks "github.com/goravel/framework/mocks/console" - seedermocks "github.com/goravel/framework/mocks/database/seeder" + seedermocks "github.com/goravel/framework/contracts/database/seeder/mocks" ) type SeedCommandTestSuite struct { diff --git a/database/console/seeder_make_command_test.go b/database/console/seeder_make_command_test.go index 9554b6979..22a17e5c5 100644 --- a/database/console/seeder_make_command_test.go +++ b/database/console/seeder_make_command_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - consolemocks "github.com/goravel/framework/mocks/console" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support/file" ) diff --git a/database/db/config_test.go b/database/db/config_test.go index fd3d986fd..04b66eb6f 100644 --- a/database/db/config_test.go +++ b/database/db/config_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/suite" + configmock "github.com/goravel/framework/contracts/config/mocks" databasecontract "github.com/goravel/framework/contracts/database" - configmock "github.com/goravel/framework/mocks/config" ) type ConfigTestSuite struct { diff --git a/database/db/dsn.go b/database/db/dsn.go index aa16aa054..c88c73951 100644 --- a/database/db/dsn.go +++ b/database/db/dsn.go @@ -48,8 +48,8 @@ func (d *DsnImpl) Postgresql(config databasecontract.Config) string { sslmode := d.config.GetString("database.connections." + d.connection + ".sslmode") timezone := d.config.GetString("database.connections." + d.connection + ".timezone") - return fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d sslmode=%s TimeZone=%s", - host, config.Username, config.Password, config.Database, config.Port, sslmode, timezone) + return fmt.Sprintf("postgres://%s:%s@%s:%d/%s?sslmode=%s&timezone=%s", + config.Username, config.Password, host, config.Port, config.Database, sslmode, timezone) } func (d *DsnImpl) Sqlite(config databasecontract.Config) string { diff --git a/database/db/dsn_test.go b/database/db/dsn_test.go index b816bc0cf..64ce27598 100644 --- a/database/db/dsn_test.go +++ b/database/db/dsn_test.go @@ -6,9 +6,9 @@ import ( "github.com/stretchr/testify/suite" + configmock "github.com/goravel/framework/contracts/config/mocks" databasecontract "github.com/goravel/framework/contracts/database" "github.com/goravel/framework/contracts/database/orm" - configmock "github.com/goravel/framework/mocks/config" ) const ( @@ -60,8 +60,8 @@ func (s *DsnTestSuite) TestPostgresql() { s.mockConfig.On("GetString", fmt.Sprintf("database.connections.%s.sslmode", connection)).Return(sslmode).Once() s.mockConfig.On("GetString", fmt.Sprintf("database.connections.%s.timezone", connection)).Return(timezone).Once() - s.Equal(fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d sslmode=%s TimeZone=%s", - testHost, testUsername, testPassword, testDatabase, testPort, sslmode, timezone), dsn.Postgresql(testConfig)) + s.Equal(fmt.Sprintf("postgres://%s:%s@%s:%d/%s?sslmode=%s&timezone=%s", + testUsername, testPassword, testHost, testPort, testDatabase, sslmode, timezone), dsn.Postgresql(testConfig)) } func (s *DsnTestSuite) TestSqlite() { diff --git a/database/gorm/cursor.go b/database/gorm/cursor.go index e783901f7..a60163cdb 100644 --- a/database/gorm/cursor.go +++ b/database/gorm/cursor.go @@ -13,7 +13,8 @@ import ( ) type CursorImpl struct { - row map[string]any + query *QueryImpl + row map[string]any } func (c *CursorImpl) Scan(value any) error { @@ -33,7 +34,17 @@ func (c *CursorImpl) Scan(value any) error { return err } - return decoder.Decode(c.row) + if err := decoder.Decode(c.row); err != nil { + return err + } + + for relation, args := range c.query.with { + if err := c.query.origin.Load(value, relation, args...); err != nil { + return err + } + } + + return nil } func ToTimeHookFunc() mapstructure.DecodeHookFunc { diff --git a/database/gorm/dialector_test.go b/database/gorm/dialector_test.go index 25da2a960..08d6b7f2d 100644 --- a/database/gorm/dialector_test.go +++ b/database/gorm/dialector_test.go @@ -10,9 +10,9 @@ import ( "gorm.io/driver/postgres" "gorm.io/driver/sqlserver" + configmock "github.com/goravel/framework/contracts/config/mocks" databasecontract "github.com/goravel/framework/contracts/database" "github.com/goravel/framework/contracts/database/orm" - configmock "github.com/goravel/framework/mocks/config" ) type DialectorTestSuite struct { @@ -63,8 +63,8 @@ func (s *DialectorTestSuite) TestPostgresql() { Return("UTC").Once() dialectors, err := dialector.Make([]databasecontract.Config{s.config}) s.Equal(postgres.New(postgres.Config{ - DSN: fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d sslmode=%s TimeZone=%s", - s.config.Host, s.config.Username, s.config.Password, s.config.Database, s.config.Port, "disable", "UTC"), + DSN: fmt.Sprintf("postgres://%s:%s@%s:%d/%s?sslmode=%s&timezone=%s", + s.config.Username, s.config.Password, s.config.Host, s.config.Port, s.config.Database, "disable", "UTC"), }), dialectors[0]) s.Nil(err) } diff --git a/database/gorm/event.go b/database/gorm/event.go index 4c257622c..bfeee1cf6 100644 --- a/database/gorm/event.go +++ b/database/gorm/event.go @@ -64,7 +64,10 @@ func (e *Event) IsClean(fields ...string) bool { } func (e *Event) Query() orm.Query { - return NewQueryWithWithoutEvents(e.query.instance.Session(&gorm.Session{NewDB: true}), false, e.query.config) + return NewQueryImplByInstance(e.query.instance.Session(&gorm.Session{NewDB: true}), &QueryImpl{ + config: e.query.config, + withoutEvents: false, + }) } func (e *Event) Context() context.Context { diff --git a/database/gorm/event_test.go b/database/gorm/event_test.go index 7f57ff614..1ec5dc76e 100644 --- a/database/gorm/event_test.go +++ b/database/gorm/event_test.go @@ -21,12 +21,15 @@ type TestEventModel struct { var testNow = time.Now().Add(-1 * time.Second) var testEventModel = TestEventModel{Name: "name", Avatar: "avatar", IsAdmin: true, IsManage: 0, AdminAt: testNow, ManageAt: testNow, high: 1} -var testQuery = NewQueryWithWithoutEvents(&gorm.DB{ +var testQuery = NewQueryImplByInstance(&gorm.DB{ Statement: &gorm.Statement{ Selects: []string{}, Omits: []string{}, }, -}, false, nil) +}, &QueryImpl{ + config: nil, + withoutEvents: false, +}) type EventTestSuite struct { suite.Suite @@ -48,13 +51,16 @@ func (s *EventTestSuite) SetupTest() { func (s *EventTestSuite) TestSetAttribute() { dest := map[string]any{"avatar": "avatar1"} - query := NewQueryWithWithoutEvents(&gorm.DB{ + query := NewQueryImplByInstance(&gorm.DB{ Statement: &gorm.Statement{ Selects: []string{}, Omits: []string{}, Dest: dest, }, - }, false, nil) + }, &QueryImpl{ + config: nil, + withoutEvents: false, + }) event := NewEvent(query, &testEventModel, dest) @@ -148,23 +154,29 @@ func (s *EventTestSuite) TestValidColumn() { s.True(event.validColumn("manage")) s.False(event.validColumn("age")) - event.query = NewQueryWithWithoutEvents(&gorm.DB{ + event.query = NewQueryImplByInstance(&gorm.DB{ Statement: &gorm.Statement{ Selects: []string{"name"}, Omits: []string{}, }, - }, false, nil) + }, &QueryImpl{ + config: nil, + withoutEvents: false, + }) s.True(event.validColumn("Name")) s.True(event.validColumn("name")) s.False(event.validColumn("avatar")) s.False(event.validColumn("Avatar")) - event.query = NewQueryWithWithoutEvents(&gorm.DB{ + event.query = NewQueryImplByInstance(&gorm.DB{ Statement: &gorm.Statement{ Selects: []string{}, Omits: []string{"name"}, }, - }, false, nil) + }, &QueryImpl{ + config: nil, + withoutEvents: false, + }) s.False(event.validColumn("Name")) s.False(event.validColumn("name")) s.True(event.validColumn("avatar")) diff --git a/database/gorm/gorm.go b/database/gorm/gorm.go index 8b657d381..05771e3c9 100644 --- a/database/gorm/gorm.go +++ b/database/gorm/gorm.go @@ -15,13 +15,16 @@ import ( "github.com/goravel/framework/contracts/config" databasecontract "github.com/goravel/framework/contracts/database" - "github.com/goravel/framework/contracts/database/gorm" "github.com/goravel/framework/database/db" "github.com/goravel/framework/support/carbon" ) -var GormSet = wire.NewSet(NewGormImpl, wire.Bind(new(gorm.Gorm), new(*GormImpl))) -var _ gorm.Gorm = &GormImpl{} +var GormSet = wire.NewSet(NewGormImpl, wire.Bind(new(Gorm), new(*GormImpl))) +var _ Gorm = &GormImpl{} + +type Gorm interface { + Make() (*gormio.DB, error) +} type GormImpl struct { config config.Config diff --git a/mocks/database/gorm/Initialize.go b/database/gorm/mocks/Initialize.go similarity index 66% rename from mocks/database/gorm/Initialize.go rename to database/gorm/mocks/Initialize.go index 191ba88d5..9993511f0 100644 --- a/mocks/database/gorm/Initialize.go +++ b/database/gorm/mocks/Initialize.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -7,11 +7,9 @@ import ( config "github.com/goravel/framework/contracts/config" - gorm "github.com/goravel/framework/contracts/database/gorm" + gorm "github.com/goravel/framework/database/gorm" mock "github.com/stretchr/testify/mock" - - orm "github.com/goravel/framework/contracts/database/orm" ) // Initialize is an autogenerated mock type for the Initialize type @@ -20,15 +18,15 @@ type Initialize struct { } // InitializeGorm provides a mock function with given fields: _a0, connection -func (_m *Initialize) InitializeGorm(_a0 config.Config, connection string) gorm.Gorm { +func (_m *Initialize) InitializeGorm(_a0 config.Config, connection string) *gorm.GormImpl { ret := _m.Called(_a0, connection) - var r0 gorm.Gorm - if rf, ok := ret.Get(0).(func(config.Config, string) gorm.Gorm); ok { + var r0 *gorm.GormImpl + if rf, ok := ret.Get(0).(func(config.Config, string) *gorm.GormImpl); ok { r0 = rf(_a0, connection) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(gorm.Gorm) + r0 = ret.Get(0).(*gorm.GormImpl) } } @@ -36,22 +34,19 @@ func (_m *Initialize) InitializeGorm(_a0 config.Config, connection string) gorm. } // InitializeQuery provides a mock function with given fields: ctx, _a1, connection -func (_m *Initialize) InitializeQuery(ctx context.Context, _a1 config.Config, connection string) (orm.Query, error) { +func (_m *Initialize) InitializeQuery(ctx context.Context, _a1 config.Config, connection string) (*gorm.QueryImpl, error) { ret := _m.Called(ctx, _a1, connection) - var r0 orm.Query - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, config.Config, string) (orm.Query, error)); ok { - return rf(ctx, _a1, connection) - } - if rf, ok := ret.Get(0).(func(context.Context, config.Config, string) orm.Query); ok { + var r0 *gorm.QueryImpl + if rf, ok := ret.Get(0).(func(context.Context, config.Config, string) *gorm.QueryImpl); ok { r0 = rf(ctx, _a1, connection) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(orm.Query) + r0 = ret.Get(0).(*gorm.QueryImpl) } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, config.Config, string) error); ok { r1 = rf(ctx, _a1, connection) } else { @@ -61,12 +56,13 @@ func (_m *Initialize) InitializeQuery(ctx context.Context, _a1 config.Config, co return r0, r1 } -// NewInitialize creates a new instance of Initialize. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewInitialize(t interface { +type mockConstructorTestingTNewInitialize interface { mock.TestingT Cleanup(func()) -}) *Initialize { +} + +// NewInitialize creates a new instance of Initialize. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewInitialize(t mockConstructorTestingTNewInitialize) *Initialize { mock := &Initialize{} mock.Mock.Test(t) diff --git a/database/gorm/query.go b/database/gorm/query.go index 5b84d7ae3..e607ce8f8 100644 --- a/database/gorm/query.go +++ b/database/gorm/query.go @@ -15,7 +15,6 @@ import ( "gorm.io/gorm/clause" "github.com/goravel/framework/contracts/config" - gormcontract "github.com/goravel/framework/contracts/database/gorm" ormcontract "github.com/goravel/framework/contracts/database/orm" "github.com/goravel/framework/database/gorm/hints" "github.com/goravel/framework/database/orm" @@ -29,10 +28,12 @@ type QueryImpl struct { config config.Config ctx context.Context instance *gormio.DB + origin *QueryImpl + with map[string][]any withoutEvents bool } -func NewQueryImpl(ctx context.Context, config config.Config, gorm gormcontract.Gorm) (*QueryImpl, error) { +func NewQueryImpl(ctx context.Context, config config.Config, gorm Gorm) (*QueryImpl, error) { db, err := gorm.Make() if err != nil { return nil, err @@ -48,8 +49,15 @@ func NewQueryImpl(ctx context.Context, config config.Config, gorm gormcontract.G }, nil } -func NewQueryWithWithoutEvents(instance *gormio.DB, withoutEvents bool, config config.Config) *QueryImpl { - return &QueryImpl{instance: instance, withoutEvents: withoutEvents, config: config, ctx: instance.Statement.Context} +func NewQueryImplByInstance(db *gormio.DB, instance *QueryImpl) *QueryImpl { + queryImpl := &QueryImpl{config: instance.config, ctx: db.Statement.Context, instance: db, origin: instance.origin, with: instance.with, withoutEvents: instance.withoutEvents} + + // The origin is used by the With method to load the relationship. + if instance.origin == nil && instance.instance != nil { + queryImpl.origin = instance + } + + return queryImpl } func (r *QueryImpl) Association(association string) ormcontract.Association { @@ -105,7 +113,7 @@ func (r *QueryImpl) Cursor() (chan ormcontract.Cursor, error) { if err != nil { return } - cursorChan <- &CursorImpl{row: val} + cursorChan <- &CursorImpl{row: val, query: r} } close(cursorChan) }() @@ -137,7 +145,7 @@ func (r *QueryImpl) Delete(dest any, conds ...any) (*ormcontract.Result, error) func (r *QueryImpl) Distinct(args ...any) ormcontract.Query { tx := r.instance.Distinct(args...) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } func (r *QueryImpl) Exec(sql string, values ...any) (*ormcontract.Result, error) { @@ -307,13 +315,13 @@ func (r *QueryImpl) Get(dest any) error { func (r *QueryImpl) Group(name string) ormcontract.Query { tx := r.instance.Group(name) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } func (r *QueryImpl) Having(query any, args ...any) ormcontract.Query { tx := r.instance.Having(query, args...) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } func (r *QueryImpl) Instance() *gormio.DB { @@ -322,13 +330,13 @@ func (r *QueryImpl) Instance() *gormio.DB { func (r *QueryImpl) Join(query string, args ...any) ormcontract.Query { tx := r.instance.Joins(query, args...) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } func (r *QueryImpl) Limit(limit int) ormcontract.Query { tx := r.instance.Limit(limit) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } func (r *QueryImpl) Load(model any, relation string, args ...any) error { @@ -346,8 +354,7 @@ func (r *QueryImpl) Load(model any, relation string, args ...any) error { } copyDest := copyStruct(model) - query := r.With(relation, args...) - err := query.Find(model) + err := r.With(relation, args...).Find(model) t := destType.Elem() v := reflect.ValueOf(model).Elem() @@ -406,11 +413,11 @@ func (r *QueryImpl) LockForUpdate() ormcontract.Query { if driver == mysqlDialector.Name() || driver == postgresqlDialector.Name() { tx := r.instance.Clauses(clause.Locking{Strength: "UPDATE"}) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } else if driver == sqlserverDialector.Name() { tx := r.instance.Clauses(hints.With("rowlock", "updlock", "holdlock")) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } return r @@ -422,31 +429,31 @@ func (r *QueryImpl) Model(value any) ormcontract.Query { } tx := r.instance.Model(value) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } func (r *QueryImpl) Offset(offset int) ormcontract.Query { tx := r.instance.Offset(offset) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } func (r *QueryImpl) Omit(columns ...string) ormcontract.Query { tx := r.instance.Omit(columns...) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } func (r *QueryImpl) Order(value any) ormcontract.Query { tx := r.instance.Order(value) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } func (r *QueryImpl) OrWhere(query any, args ...any) ormcontract.Query { tx := r.instance.Or(query, args...) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } func (r *QueryImpl) Paginate(page, limit int, dest any, total *int64) error { @@ -473,7 +480,7 @@ func (r *QueryImpl) Pluck(column string, dest any) error { func (r *QueryImpl) Raw(sql string, values ...any) ormcontract.Query { tx := r.instance.Raw(sql, values...) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } func (r *QueryImpl) Save(value any) error { @@ -546,14 +553,14 @@ func (r *QueryImpl) Scan(dest any) error { func (r *QueryImpl) Select(query any, args ...any) ormcontract.Query { tx := r.instance.Select(query, args...) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } func (r *QueryImpl) Scopes(funcs ...func(ormcontract.Query) ormcontract.Query) ormcontract.Query { var gormFuncs []func(*gormio.DB) *gormio.DB for _, item := range funcs { gormFuncs = append(gormFuncs, func(tx *gormio.DB) *gormio.DB { - item(NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config)) + item(NewQueryImplByInstance(tx, r)) return tx }) @@ -561,7 +568,7 @@ func (r *QueryImpl) Scopes(funcs ...func(ormcontract.Query) ormcontract.Query) o tx := r.instance.Scopes(gormFuncs...) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } func (r *QueryImpl) SharedLock() ormcontract.Query { @@ -573,11 +580,11 @@ func (r *QueryImpl) SharedLock() ormcontract.Query { if driver == mysqlDialector.Name() || driver == postgresqlDialector.Name() { tx := r.instance.Clauses(clause.Locking{Strength: "SHARE"}) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } else if driver == sqlserverDialector.Name() { tx := r.instance.Clauses(hints.With("rowlock", "holdlock")) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } return r @@ -590,7 +597,7 @@ func (r *QueryImpl) Sum(column string, dest any) error { func (r *QueryImpl) Table(name string, args ...any) ormcontract.Query { tx := r.instance.Table(name, args...) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } func (r *QueryImpl) Update(column any, value ...any) (*ormcontract.Result, error) { @@ -653,17 +660,20 @@ func (r *QueryImpl) UpdateOrCreate(dest any, attributes any, values any) error { func (r *QueryImpl) Where(query any, args ...any) ormcontract.Query { tx := r.instance.Where(query, args...) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } func (r *QueryImpl) WithoutEvents() ormcontract.Query { - return NewQueryWithWithoutEvents(r.instance, true, r.config) + return NewQueryImplByInstance(r.instance, &QueryImpl{ + config: r.config, + withoutEvents: true, + }) } func (r *QueryImpl) WithTrashed() ormcontract.Query { tx := r.instance.Unscoped() - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } func (r *QueryImpl) With(query string, args ...any) ormcontract.Query { @@ -672,7 +682,7 @@ func (r *QueryImpl) With(query string, args ...any) ormcontract.Query { case func(ormcontract.Query) ormcontract.Query: newArgs := []any{ func(tx *gormio.DB) *gormio.DB { - query := arg(NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config)) + query := arg(NewQueryImplByInstance(tx, r)) return query.(*QueryImpl).instance }, @@ -680,13 +690,20 @@ func (r *QueryImpl) With(query string, args ...any) ormcontract.Query { tx := r.instance.Preload(query, newArgs...) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + return NewQueryImplByInstance(tx, r) } } tx := r.instance.Preload(query, args...) - return NewQueryWithWithoutEvents(tx, r.withoutEvents, r.config) + queryImpl := NewQueryImplByInstance(tx, r) + if queryImpl.with == nil { + queryImpl.with = make(map[string][]any) + } + + queryImpl.with[query] = args + + return queryImpl } func (r *QueryImpl) refreshConnection(value any) error { diff --git a/database/gorm/query_test.go b/database/gorm/query_test.go index 3adce6123..373c936ae 100644 --- a/database/gorm/query_test.go +++ b/database/gorm/query_test.go @@ -769,8 +769,10 @@ func (s *QueryTestSuite) TestCreate() { func (s *QueryTestSuite) TestCursor() { for driver, query := range s.queries { s.Run(driver.String(), func() { - user := User{Name: "cursor_user", Avatar: "cursor_avatar"} - s.Nil(query.Create(&user)) + user := User{Name: "cursor_user", Avatar: "cursor_avatar", Address: &Address{Name: "cursor_address"}, Books: []*Book{ + {Name: "cursor_book"}, + }} + s.Nil(query.Select(orm.Associations).Create(&user)) s.True(user.ID > 0) user1 := User{Name: "cursor_user", Avatar: "cursor_avatar1"} @@ -784,9 +786,11 @@ func (s *QueryTestSuite) TestCursor() { s.Nil(err) s.Equal(int64(1), res.RowsAffected) - users, err := query.Model(&User{}).Where("name = ?", "cursor_user").WithTrashed().Cursor() + users, err := query.Model(&User{}).Where("name = ?", "cursor_user").WithTrashed().With("Address").With("Books").Cursor() s.Nil(err) var size int + var addressNum int + var bookNum int for row := range users { var tempUser User s.Nil(row.Scan(&tempUser)) @@ -796,8 +800,15 @@ func (s *QueryTestSuite) TestCursor() { s.NotEmpty(tempUser.UpdatedAt.String()) s.Equal(tempUser.DeletedAt.Valid, tempUser.ID == user2.ID) size++ + + if tempUser.Address != nil { + addressNum++ + } + bookNum += len(tempUser.Books) } s.Equal(3, size) + s.Equal(1, addressNum) + s.Equal(1, bookNum) }) } } diff --git a/database/gorm/test_utils.go b/database/gorm/test_utils.go index 453ae4fe7..7928b292c 100644 --- a/database/gorm/test_utils.go +++ b/database/gorm/test_utils.go @@ -6,9 +6,9 @@ import ( "github.com/ory/dockertest/v3" "github.com/spf13/cast" + configmock "github.com/goravel/framework/contracts/config/mocks" "github.com/goravel/framework/contracts/database" "github.com/goravel/framework/contracts/database/orm" - configmock "github.com/goravel/framework/mocks/config" testingdocker "github.com/goravel/framework/support/docker" ) diff --git a/database/gorm/transaction.go b/database/gorm/transaction.go index e72ffe958..61bb91ac6 100644 --- a/database/gorm/transaction.go +++ b/database/gorm/transaction.go @@ -13,7 +13,10 @@ type Transaction struct { } func NewTransaction(tx *gorm.DB, config config.Config) *Transaction { - return &Transaction{Query: NewQueryWithWithoutEvents(tx, false, config), instance: tx} + return &Transaction{Query: NewQueryImplByInstance(tx, &QueryImpl{ + config: config, + withoutEvents: false, + }), instance: tx} } func (r *Transaction) Commit() error { diff --git a/database/gorm/utils_test.go b/database/gorm/utils_test.go index 236d8c134..e6b352b1f 100644 --- a/database/gorm/utils_test.go +++ b/database/gorm/utils_test.go @@ -4,8 +4,6 @@ import ( "testing" "github.com/stretchr/testify/assert" - - "github.com/goravel/framework/support/debug" ) func TestCopyStruct(t *testing.T) { @@ -15,7 +13,7 @@ func TestCopyStruct(t *testing.T) { } data := copyStruct(Data{Name: "name", age: 18}) - debug.Dump(data) + assert.Equal(t, "name", data.Field(0).Interface().(string)) assert.Panics(t, func() { data.Field(1).Interface() diff --git a/database/gorm/wire_interface.go b/database/gorm/wire_interface.go new file mode 100644 index 000000000..b4c1675e4 --- /dev/null +++ b/database/gorm/wire_interface.go @@ -0,0 +1,27 @@ +package gorm + +import ( + "context" + + "github.com/goravel/framework/contracts/config" +) + +//go:generate mockery --name=Initialize +type Initialize interface { + InitializeGorm(config config.Config, connection string) *GormImpl + InitializeQuery(ctx context.Context, config config.Config, connection string) (*QueryImpl, error) +} + +type InitializeImpl struct{} + +func NewInitializeImpl() *InitializeImpl { + return &InitializeImpl{} +} + +func (receive *InitializeImpl) InitializeGorm(config config.Config, connection string) *GormImpl { + return InitializeGorm(config, connection) +} + +func (receive *InitializeImpl) InitializeQuery(ctx context.Context, config config.Config, connection string) (*QueryImpl, error) { + return InitializeQuery(ctx, config, connection) +} diff --git a/database/wire_interface.go b/database/wire_interface.go deleted file mode 100644 index a837d7212..000000000 --- a/database/wire_interface.go +++ /dev/null @@ -1,24 +0,0 @@ -package database - -import ( - "context" - - "github.com/goravel/framework/contracts/config" - contractsgorm "github.com/goravel/framework/contracts/database/gorm" - "github.com/goravel/framework/contracts/database/orm" - "github.com/goravel/framework/database/gorm" -) - -type InitializeImpl struct{} - -func NewInitializeImpl() *InitializeImpl { - return &InitializeImpl{} -} - -func (receive *InitializeImpl) InitializeGorm(config config.Config, connection string) contractsgorm.Gorm { - return gorm.InitializeGorm(config, connection) -} - -func (receive *InitializeImpl) InitializeQuery(ctx context.Context, config config.Config, connection string) (orm.Query, error) { - return gorm.InitializeQuery(ctx, config, connection) -} diff --git a/event/console/event_make_command_test.go b/event/console/event_make_command_test.go index 7fcc0279f..33abe6a2d 100644 --- a/event/console/event_make_command_test.go +++ b/event/console/event_make_command_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - consolemocks "github.com/goravel/framework/mocks/console" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support/file" ) diff --git a/event/console/listener_make_command_test.go b/event/console/listener_make_command_test.go index 642cd1a66..9c6eed614 100644 --- a/event/console/listener_make_command_test.go +++ b/event/console/listener_make_command_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - consolemocks "github.com/goravel/framework/mocks/console" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support/file" ) diff --git a/event/task_test.go b/event/task_test.go index a1c6e7702..1aad4d84e 100644 --- a/event/task_test.go +++ b/event/task_test.go @@ -8,7 +8,7 @@ import ( "github.com/goravel/framework/contracts/event" queuecontract "github.com/goravel/framework/contracts/queue" - queuemock "github.com/goravel/framework/mocks/queue" + queuemock "github.com/goravel/framework/contracts/queue/mocks" ) func TestDispatch(t *testing.T) { diff --git a/filesystem/file_test.go b/filesystem/file_test.go index cfdd255e1..9d10904b2 100644 --- a/filesystem/file_test.go +++ b/filesystem/file_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" - configmock "github.com/goravel/framework/mocks/config" + configmock "github.com/goravel/framework/contracts/config/mocks" "github.com/goravel/framework/support/file" ) diff --git a/filesystem/local_test.go b/filesystem/local_test.go index b3d91d244..147aca901 100644 --- a/filesystem/local_test.go +++ b/filesystem/local_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" - configmock "github.com/goravel/framework/mocks/config" + configmock "github.com/goravel/framework/contracts/config/mocks" "github.com/goravel/framework/support/carbon" "github.com/goravel/framework/support/env" "github.com/goravel/framework/support/file" diff --git a/foundation/application_test.go b/foundation/application_test.go index ff3c65840..7f4902961 100644 --- a/foundation/application_test.go +++ b/foundation/application_test.go @@ -11,8 +11,15 @@ import ( "github.com/goravel/framework/cache" "github.com/goravel/framework/config" "github.com/goravel/framework/console" + cachemocks "github.com/goravel/framework/contracts/cache/mocks" + configmocks "github.com/goravel/framework/contracts/config/mocks" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/contracts/database/orm" + ormmocks "github.com/goravel/framework/contracts/database/orm/mocks" "github.com/goravel/framework/contracts/foundation" + logmocks "github.com/goravel/framework/contracts/log/mocks" + queuemocks "github.com/goravel/framework/contracts/queue/mocks" + routemocks "github.com/goravel/framework/contracts/route/mocks" "github.com/goravel/framework/crypt" "github.com/goravel/framework/database" "github.com/goravel/framework/database/gorm" @@ -23,13 +30,6 @@ import ( "github.com/goravel/framework/http" "github.com/goravel/framework/log" "github.com/goravel/framework/mail" - cachemocks "github.com/goravel/framework/mocks/cache" - configmocks "github.com/goravel/framework/mocks/config" - consolemocks "github.com/goravel/framework/mocks/console" - ormmocks "github.com/goravel/framework/mocks/database/orm" - logmocks "github.com/goravel/framework/mocks/log" - queuemocks "github.com/goravel/framework/mocks/queue" - routemocks "github.com/goravel/framework/mocks/route" "github.com/goravel/framework/queue" "github.com/goravel/framework/schedule" "github.com/goravel/framework/support/file" diff --git a/foundation/console/package_make_command_test.go b/foundation/console/package_make_command_test.go index 1f4b72b5f..ab575eae0 100644 --- a/foundation/console/package_make_command_test.go +++ b/foundation/console/package_make_command_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - consolemocks "github.com/goravel/framework/mocks/console" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support/file" ) diff --git a/foundation/console/test_make_command_test.go b/foundation/console/test_make_command_test.go index 892ae8a11..1ede35b7c 100644 --- a/foundation/console/test_make_command_test.go +++ b/foundation/console/test_make_command_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - consolemocks "github.com/goravel/framework/mocks/console" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support/file" ) diff --git a/go.mod b/go.mod index 6abf38652..c516c9591 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,8 @@ go 1.20 require ( github.com/RichardKnop/machinery/v2 v2.0.11 - github.com/bytedance/sonic v1.10.2 - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc + github.com/bytedance/sonic v1.10.1 + github.com/davecgh/go-spew v1.1.1 github.com/gabriel-vasile/mimetype v1.4.2 github.com/glebarez/go-sqlite v1.21.2 github.com/glebarez/sqlite v1.9.0 @@ -13,7 +13,7 @@ require ( github.com/go-sql-driver/mysql v1.7.1 github.com/golang-jwt/jwt/v5 v5.0.0 github.com/golang-migrate/migrate/v4 v4.16.2 - github.com/golang-module/carbon/v2 v2.2.9 + github.com/golang-module/carbon/v2 v2.2.8 github.com/golang/protobuf v1.5.3 github.com/google/uuid v1.3.1 github.com/google/wire v0.5.0 @@ -31,12 +31,12 @@ require ( github.com/rotisserie/eris v0.5.4 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cast v1.5.1 - github.com/spf13/viper v1.17.0 + github.com/spf13/viper v1.16.0 github.com/stretchr/testify v1.8.4 github.com/urfave/cli/v2 v2.25.7 go.uber.org/atomic v1.11.0 - golang.org/x/crypto v0.14.0 - golang.org/x/exp v0.0.0-20230905200255-921286631fa9 + golang.org/x/crypto v0.13.0 + golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0 google.golang.org/grpc v1.58.2 gorm.io/driver/mysql v1.5.1 gorm.io/driver/postgres v1.5.2 @@ -46,18 +46,11 @@ require ( ) require ( - github.com/sagikazarmark/locafero v0.3.0 // indirect - github.com/sagikazarmark/slog-shim v0.1.0 // indirect - github.com/sourcegraph/conc v0.3.0 // indirect - go.uber.org/multierr v1.9.0 // indirect -) - -require ( - cloud.google.com/go v0.110.7 // indirect - cloud.google.com/go/compute v1.23.0 // indirect + cloud.google.com/go v0.110.4 // indirect + cloud.google.com/go/compute v1.21.0 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v1.1.1 // indirect - cloud.google.com/go/pubsub v1.33.0 // indirect + cloud.google.com/go/pubsub v1.32.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/Azure/go-autorest v14.2.0+incompatible // indirect github.com/Azure/go-autorest/autorest/adal v0.9.16 // indirect @@ -92,10 +85,10 @@ require ( github.com/golang/snappy v0.0.4 // indirect github.com/gomodule/redigo v2.0.0+incompatible // indirect github.com/google/go-cmp v0.5.9 // indirect - github.com/google/s2a-go v0.1.7 // indirect + github.com/google/s2a-go v0.1.4 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.1 // indirect - github.com/googleapis/gax-go/v2 v2.12.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect + github.com/googleapis/gax-go/v2 v2.11.0 // indirect github.com/gookit/filter v1.2.0 // indirect github.com/gookit/goutil v0.6.12 // indirect github.com/goravel/file-rotatelogs v0.0.0-20211215053220-2ab31dd9575c // indirect @@ -109,7 +102,7 @@ require ( github.com/jinzhu/now v1.1.5 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/kelseyhightower/envconfig v1.4.0 // indirect - github.com/klauspost/compress v1.17.0 // indirect + github.com/klauspost/compress v1.16.5 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/lestrrat-go/strftime v1.0.5 // indirect github.com/lib/pq v1.10.2 // indirect @@ -122,15 +115,16 @@ require ( github.com/opencontainers/image-spec v1.0.2 // indirect github.com/opencontainers/runc v1.1.5 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/spf13/afero v1.10.0 // indirect + github.com/spf13/afero v1.9.5 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/streadway/amqp v1.0.0 // indirect github.com/stretchr/objx v0.5.0 // indirect - github.com/subosito/gotenv v1.6.0 // indirect + github.com/subosito/gotenv v1.4.2 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.1 // indirect @@ -144,18 +138,18 @@ require ( go.mongodb.org/mongo-driver v1.7.5 // indirect go.opencensus.io v0.24.0 // indirect golang.org/x/arch v0.3.0 // indirect - golang.org/x/mod v0.12.0 // indirect - golang.org/x/net v0.15.0 // indirect - golang.org/x/oauth2 v0.12.0 // indirect + golang.org/x/mod v0.10.0 // indirect + golang.org/x/net v0.12.0 // indirect + golang.org/x/oauth2 v0.10.0 // indirect golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.13.0 // indirect + golang.org/x/sys v0.12.0 // indirect golang.org/x/text v0.13.0 - golang.org/x/tools v0.13.0 // indirect - google.golang.org/api v0.143.0 // indirect + golang.org/x/tools v0.9.1 // indirect + google.golang.org/api v0.126.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect + google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 52364058b..089973e21 100644 --- a/go.sum +++ b/go.sum @@ -17,30 +17,30 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.110.7 h1:rJyC7nWRg2jWGZ4wSJ5nY65GTdYJkg0cd/uXb+ACI6o= -cloud.google.com/go v0.110.7/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= +cloud.google.com/go v0.110.4 h1:1JYyxKMN9hd5dR2MYTPWkGUgcoxVVhg0LKNKEo0qvmk= +cloud.google.com/go v0.110.4/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= -cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute v1.21.0 h1:JNBsyXVoOoNJtTQcnEY5uYpZIbeCTYIeDe0Xh1bySMk= +cloud.google.com/go/compute v1.21.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/iam v1.1.1 h1:lW7fzj15aVIXYHREOqjRBV9PsH0Z6u8Y46a1YGvQP4Y= cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= -cloud.google.com/go/kms v1.15.0 h1:xYl5WEaSekKYN5gGRyhjvZKM22GVBBCzegGNVPy+aIs= +cloud.google.com/go/kms v1.12.1 h1:xZmZuwy2cwzsocmKDOPu4BL7umg8QXagQx6fKVmf45U= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/pubsub v1.10.0/go.mod h1:eNpTrkOy7dCpkNyaSNetMa6udbgecJMd0ZsTJS/cuNo= -cloud.google.com/go/pubsub v1.33.0 h1:6SPCPvWav64tj0sVX/+npCBKhUi/UjJehy9op/V3p2g= -cloud.google.com/go/pubsub v1.33.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc= +cloud.google.com/go/pubsub v1.32.0 h1:JOEkgEYBuUTHSyHS4TcqOFuWr+vD6qO/imsFqShUCp4= +cloud.google.com/go/pubsub v1.32.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= @@ -76,6 +76,7 @@ github.com/RichardKnop/logging v0.0.0-20190827224416-1a693bdd4fae h1:DcFpTQBYQ9C github.com/RichardKnop/logging v0.0.0-20190827224416-1a693bdd4fae/go.mod h1:rJJ84PyA/Wlmw1hO+xTzV2wsSUon6J5ktg0g8BF2PuU= github.com/RichardKnop/machinery/v2 v2.0.11 h1:BTfLGOmOju3W/OtlZmLX26OjYNZsU4PJo04pQReycdc= github.com/RichardKnop/machinery/v2 v2.0.11/go.mod h1:b5Q6cT/w7YLlIl4Vi+jpdEoyYiqhTgx+0USoKb1wzqU= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/aws/aws-sdk-go v1.37.16 h1:Q4YOP2s00NpB9wfmTDZArdcLRuG9ijbnoAwTW3ivleI= github.com/aws/aws-sdk-go v1.37.16/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= @@ -85,8 +86,8 @@ github.com/brianvoe/gofakeit/v6 v6.23.2 h1:lVde18uhad5wII/f5RMVFLtdQNE0HaGFuBUXm github.com/brianvoe/gofakeit/v6 v6.23.2/go.mod h1:Ow6qC71xtwm79anlwKRlWZW6zVq9D2XHE4QSSMP/rU8= 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/bytedance/sonic v1.10.1 h1:7a1wuFXL1cMy7a3f7/VFcEtriuXQnUBhtoVfOZiaysc= +github.com/bytedance/sonic v1.10.1/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -108,6 +109,10 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= @@ -118,9 +123,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= 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= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dhui/dktest v0.3.16 h1:i6gq2YQEtcrjKbeJpBkWjE8MmLZPYllcjOFbTZuPDnw= @@ -143,6 +147,7 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239/go.mod h1:Gdwt2ce0yfBxPvZrHkprdPPTTS3N5rwmLE8T22KBXlw= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= @@ -153,6 +158,7 @@ github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4 github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/glebarez/go-sqlite v1.21.2 h1:3a6LFC4sKahUunAmynQKLZceZCOzUthkRkEAl9gAXWo= github.com/glebarez/go-sqlite v1.21.2/go.mod h1:sfxdZyhQjTM2Wry3gVYWaW072Ri1WMdWJi0k6+3382k= github.com/glebarez/sqlite v1.9.0 h1:Aj6bPA12ZEx5GbSF6XADmCkYXlljPNUY+Zf1EQxynXs= @@ -215,8 +221,8 @@ github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJ github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang-migrate/migrate/v4 v4.16.2 h1:8coYbMKUyInrFk1lfGfRovTLAW7PhWp8qQDT2iKfuoA= github.com/golang-migrate/migrate/v4 v4.16.2/go.mod h1:pfcJX4nPHaVdc5nmdCikFBWtm+UBpiZjRNNsyBbp0/o= -github.com/golang-module/carbon/v2 v2.2.9 h1:N1CGVM3MizAQTY4xOOlkBT6xZt9EPfjNOCfxv7UqacU= -github.com/golang-module/carbon/v2 v2.2.9/go.mod h1:XDALX7KgqmHk95xyLeaqX9/LJGbfLATyruTziq68SZ8= +github.com/golang-module/carbon/v2 v2.2.8 h1:a1VxHHKAR7fc1ho7sYXhS1s5S4x7+oqAf2EY5p8C46A= +github.com/golang-module/carbon/v2 v2.2.8/go.mod h1:XDALX7KgqmHk95xyLeaqX9/LJGbfLATyruTziq68SZ8= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= @@ -249,6 +255,7 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -287,8 +294,8 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= -github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= +github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= +github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= @@ -299,12 +306,12 @@ github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8= github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= -github.com/googleapis/enterprise-certificate-proxy v0.3.1 h1:SBWmZhjUDRorQxrN0nwzf+AHBxnbFjViHQS4P0yVpmQ= -github.com/googleapis/enterprise-certificate-proxy v0.3.1/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= +github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= +github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= -github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= +github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4= +github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0= github.com/gookit/color v1.5.4/go.mod h1:pZJOeOS8DM43rXbp4AZo1n9zCU2qjpcRko0b6/QJi9w= @@ -322,6 +329,7 @@ github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+ github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -377,8 +385,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= -github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= +github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= @@ -448,17 +456,16 @@ github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnz github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -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/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= @@ -467,6 +474,7 @@ github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 h1:mZHayPoR0lNmnH github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5/go.mod h1:GEXHk5HgEKCvEIIrSpFI3ozzG5xOKA2DVlEX/gGnewM= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -476,10 +484,6 @@ github.com/rotisserie/eris v0.5.4/go.mod h1:Z/kgYTJiJtocxCbFfvRmO+QejApzG6zpyky9 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ= -github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U= -github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= -github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -488,18 +492,18 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= -github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= -github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= -github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= +github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= -github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -516,12 +520,13 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 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.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= 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/stvp/tempredis v0.0.0-20181119212430-b82af8480203 h1:QVqDTf3h2WHt08YuiTGPZLls0Wq99X9bWd0Q5ZSBesM= github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203/go.mod h1:oqN97ltKNihBbwlX8dLpwxCl3+HnXKV/R0e+sRLd9C8= -github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= -github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= +github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tebeka/strftime v0.1.3/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIUJUJH6XQ= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= @@ -578,13 +583,12 @@ go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9 go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0= go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE= go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= @@ -601,12 +605,13 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -617,8 +622,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= +golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0 h1:pVgRXcIictcr+lBQIFeiwuwtDIs4eL21OuM9nyAADmo= +golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -644,8 +649,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -688,8 +693,8 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -700,8 +705,8 @@ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210113205817-d3ed898aa8a3/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= -golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= +golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= +golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -781,14 +786,14 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc 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.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -798,6 +803,7 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/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.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= @@ -865,8 +871,8 @@ golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= +golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -891,8 +897,8 @@ google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.39.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.143.0 h1:o8cekTkqhywkbZT6p1UHJPZ9+9uuCAJs/KYomxZB8fA= -google.golang.org/api v0.143.0/go.mod h1:FoX9DO9hT7DLNn97OuoZAGSDuNAXdJRuGK98rSUgurk= +google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o= +google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -925,6 +931,7 @@ google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= @@ -939,12 +946,12 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210207032614-bba0dbe2a9ea/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb h1:XFBgcDwm7irdHTbz4Zk2h7Mh+eis4nfJEFQFYzJzuIA= -google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= -google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb h1:lK0oleSc7IQsUxO3U5TjL9DWlsxpEBemh+zpB7IqhWI= -google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 h1:N3bU/SQDCDyD6R528GJ/PwW9KjYcJA3dgyH+MovAkIM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:KSqppvjFjtoCI+KGd4PELB0qLNxdJHRGqRI09mB6pQA= +google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 h1:Z0hjGZePRE0ZBWotvtrwxFNrNE9CUAGtplaDK5NNI/g= +google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98/go.mod h1:S7mY02OqCJTD0E1OiQy1F72PWFB4bZJ87cAtLPYgDR0= +google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 h1:FmF5cCW94Ij59cfpoLiwTgodWmm60eEV0CjlsVg2fuw= +google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -958,9 +965,12 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -992,6 +1002,7 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/grpc/application_test.go b/grpc/application_test.go index 4c98a6601..2b8c27693 100644 --- a/grpc/application_test.go +++ b/grpc/application_test.go @@ -12,7 +12,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/metadata" - configmock "github.com/goravel/framework/mocks/config" + configmock "github.com/goravel/framework/contracts/config/mocks" ) type contextKey int diff --git a/hash/application_test.go b/hash/application_test.go index 38882cca4..87a48903b 100644 --- a/hash/application_test.go +++ b/hash/application_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/suite" + configmock "github.com/goravel/framework/contracts/config/mocks" "github.com/goravel/framework/contracts/hash" - configmock "github.com/goravel/framework/mocks/config" ) type ApplicationTestSuite struct { diff --git a/http/console/controller_make_command_test.go b/http/console/controller_make_command_test.go index 325b5ac4d..a17c76708 100644 --- a/http/console/controller_make_command_test.go +++ b/http/console/controller_make_command_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - consolemocks "github.com/goravel/framework/mocks/console" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support/file" ) diff --git a/http/console/middleware_make_command_test.go b/http/console/middleware_make_command_test.go index a22fb7cec..4e76416e9 100644 --- a/http/console/middleware_make_command_test.go +++ b/http/console/middleware_make_command_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - consolemocks "github.com/goravel/framework/mocks/console" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support/file" ) diff --git a/http/console/request_make_command_test.go b/http/console/request_make_command_test.go index f96cfcd72..9ba16fdb8 100644 --- a/http/console/request_make_command_test.go +++ b/http/console/request_make_command_test.go @@ -3,7 +3,7 @@ package console import ( "testing" - consolemocks "github.com/goravel/framework/mocks/console" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support/file" "github.com/stretchr/testify/assert" diff --git a/http/middleware/throttle_test.go b/http/middleware/throttle_test.go index 78d1380f0..0b4e45bac 100644 --- a/http/middleware/throttle_test.go +++ b/http/middleware/throttle_test.go @@ -12,14 +12,14 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + cachemocks "github.com/goravel/framework/contracts/cache/mocks" + configmocks "github.com/goravel/framework/contracts/config/mocks" "github.com/goravel/framework/contracts/filesystem" contractshttp "github.com/goravel/framework/contracts/http" + httpmocks "github.com/goravel/framework/contracts/http/mocks" "github.com/goravel/framework/contracts/validation" "github.com/goravel/framework/http" "github.com/goravel/framework/http/limit" - cachemocks "github.com/goravel/framework/mocks/cache" - configmocks "github.com/goravel/framework/mocks/config" - httpmocks "github.com/goravel/framework/mocks/http" "github.com/goravel/framework/support/carbon" ) diff --git a/log/formatter/general_test.go b/log/formatter/general_test.go index d3c3293d5..15d188126 100644 --- a/log/formatter/general_test.go +++ b/log/formatter/general_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" - configmock "github.com/goravel/framework/mocks/config" + configmock "github.com/goravel/framework/contracts/config/mocks" ) type GeneralTestSuite struct { diff --git a/log/logrus_writer_test.go b/log/logrus_writer_test.go index e139fb45e..2e0709cdb 100644 --- a/log/logrus_writer_test.go +++ b/log/logrus_writer_test.go @@ -12,10 +12,10 @@ import ( "github.com/stretchr/testify/assert" + configmock "github.com/goravel/framework/contracts/config/mocks" "github.com/goravel/framework/contracts/filesystem" contractshttp "github.com/goravel/framework/contracts/http" "github.com/goravel/framework/contracts/validation" - configmock "github.com/goravel/framework/mocks/config" "github.com/goravel/framework/support/carbon" "github.com/goravel/framework/support/file" ) diff --git a/mail/application_test.go b/mail/application_test.go index 8425cc6cf..b9f1e9714 100644 --- a/mail/application_test.go +++ b/mail/application_test.go @@ -12,9 +12,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" + configmock "github.com/goravel/framework/contracts/config/mocks" "github.com/goravel/framework/contracts/mail" queuecontract "github.com/goravel/framework/contracts/queue" - configmock "github.com/goravel/framework/mocks/config" "github.com/goravel/framework/queue" testingdocker "github.com/goravel/framework/support/docker" "github.com/goravel/framework/support/file" diff --git a/mocks/auth/access/Response.go b/mocks/auth/access/Response.go deleted file mode 100644 index 116a0f5a8..000000000 --- a/mocks/auth/access/Response.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// Response is an autogenerated mock type for the Response type -type Response struct { - mock.Mock -} - -// Allowed provides a mock function with given fields: -func (_m *Response) Allowed() bool { - ret := _m.Called() - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Message provides a mock function with given fields: -func (_m *Response) Message() string { - ret := _m.Called() - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// NewResponse creates a new instance of Response. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewResponse(t interface { - mock.TestingT - Cleanup(func()) -}) *Response { - mock := &Response{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/console/Command.go b/mocks/console/Command.go deleted file mode 100644 index 0a79eed4a..000000000 --- a/mocks/console/Command.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - console "github.com/goravel/framework/contracts/console" - command "github.com/goravel/framework/contracts/console/command" - - mock "github.com/stretchr/testify/mock" -) - -// Command is an autogenerated mock type for the Command type -type Command struct { - mock.Mock -} - -// Description provides a mock function with given fields: -func (_m *Command) Description() string { - ret := _m.Called() - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// Extend provides a mock function with given fields: -func (_m *Command) Extend() command.Extend { - ret := _m.Called() - - var r0 command.Extend - if rf, ok := ret.Get(0).(func() command.Extend); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(command.Extend) - } - - return r0 -} - -// Handle provides a mock function with given fields: ctx -func (_m *Command) Handle(ctx console.Context) error { - ret := _m.Called(ctx) - - var r0 error - if rf, ok := ret.Get(0).(func(console.Context) error); ok { - r0 = rf(ctx) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Signature provides a mock function with given fields: -func (_m *Command) Signature() string { - ret := _m.Called() - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// NewCommand creates a new instance of Command. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewCommand(t interface { - mock.TestingT - Cleanup(func()) -}) *Command { - mock := &Command{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/console/command/Flag.go b/mocks/console/command/Flag.go deleted file mode 100644 index ceaca4831..000000000 --- a/mocks/console/command/Flag.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// Flag is an autogenerated mock type for the Flag type -type Flag struct { - mock.Mock -} - -// Type provides a mock function with given fields: -func (_m *Flag) Type() string { - ret := _m.Called() - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// NewFlag creates a new instance of Flag. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewFlag(t interface { - mock.TestingT - Cleanup(func()) -}) *Flag { - mock := &Flag{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/database/factory/Factory.go b/mocks/database/factory/Factory.go deleted file mode 100644 index c40074671..000000000 --- a/mocks/database/factory/Factory.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// Factory is an autogenerated mock type for the Factory type -type Factory struct { - mock.Mock -} - -// Definition provides a mock function with given fields: -func (_m *Factory) Definition() map[string]interface{} { - ret := _m.Called() - - var r0 map[string]interface{} - if rf, ok := ret.Get(0).(func() map[string]interface{}); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string]interface{}) - } - } - - return r0 -} - -// NewFactory creates a new instance of Factory. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewFactory(t interface { - mock.TestingT - Cleanup(func()) -}) *Factory { - mock := &Factory{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/database/factory/Model.go b/mocks/database/factory/Model.go deleted file mode 100644 index 7a3c1237c..000000000 --- a/mocks/database/factory/Model.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - factory "github.com/goravel/framework/contracts/database/factory" - mock "github.com/stretchr/testify/mock" -) - -// Model is an autogenerated mock type for the Model type -type Model struct { - mock.Mock -} - -// Factory provides a mock function with given fields: -func (_m *Model) Factory() factory.Factory { - ret := _m.Called() - - var r0 factory.Factory - if rf, ok := ret.Get(0).(func() factory.Factory); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(factory.Factory) - } - } - - return r0 -} - -// NewModel creates a new instance of Model. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewModel(t interface { - mock.TestingT - Cleanup(func()) -}) *Model { - mock := &Model{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/database/gorm/Gorm.go b/mocks/database/gorm/Gorm.go deleted file mode 100644 index d54514ebc..000000000 --- a/mocks/database/gorm/Gorm.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - mock "github.com/stretchr/testify/mock" - gorm "gorm.io/gorm" -) - -// Gorm is an autogenerated mock type for the Gorm type -type Gorm struct { - mock.Mock -} - -// Make provides a mock function with given fields: -func (_m *Gorm) Make() (*gorm.DB, error) { - ret := _m.Called() - - var r0 *gorm.DB - var r1 error - if rf, ok := ret.Get(0).(func() (*gorm.DB, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() *gorm.DB); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*gorm.DB) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewGorm creates a new instance of Gorm. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewGorm(t interface { - mock.TestingT - Cleanup(func()) -}) *Gorm { - mock := &Gorm{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/database/orm/ConnectionModel.go b/mocks/database/orm/ConnectionModel.go deleted file mode 100644 index a79115a4d..000000000 --- a/mocks/database/orm/ConnectionModel.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// ConnectionModel is an autogenerated mock type for the ConnectionModel type -type ConnectionModel struct { - mock.Mock -} - -// Connection provides a mock function with given fields: -func (_m *ConnectionModel) Connection() string { - ret := _m.Called() - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// NewConnectionModel creates a new instance of ConnectionModel. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewConnectionModel(t interface { - mock.TestingT - Cleanup(func()) -}) *ConnectionModel { - mock := &ConnectionModel{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/database/orm/DispatchesEvents.go b/mocks/database/orm/DispatchesEvents.go deleted file mode 100644 index 3426fae2c..000000000 --- a/mocks/database/orm/DispatchesEvents.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - orm "github.com/goravel/framework/contracts/database/orm" - mock "github.com/stretchr/testify/mock" -) - -// DispatchesEvents is an autogenerated mock type for the DispatchesEvents type -type DispatchesEvents struct { - mock.Mock -} - -// DispatchesEvents provides a mock function with given fields: -func (_m *DispatchesEvents) DispatchesEvents() map[orm.EventType]func(orm.Event) error { - ret := _m.Called() - - var r0 map[orm.EventType]func(orm.Event) error - if rf, ok := ret.Get(0).(func() map[orm.EventType]func(orm.Event) error); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[orm.EventType]func(orm.Event) error) - } - } - - return r0 -} - -// NewDispatchesEvents creates a new instance of DispatchesEvents. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewDispatchesEvents(t interface { - mock.TestingT - Cleanup(func()) -}) *DispatchesEvents { - mock := &DispatchesEvents{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/database/orm/Event.go b/mocks/database/orm/Event.go deleted file mode 100644 index 3b85cb7a7..000000000 --- a/mocks/database/orm/Event.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - context "context" - - orm "github.com/goravel/framework/contracts/database/orm" - mock "github.com/stretchr/testify/mock" -) - -// Event is an autogenerated mock type for the Event type -type Event struct { - mock.Mock -} - -// Context provides a mock function with given fields: -func (_m *Event) Context() context.Context { - ret := _m.Called() - - var r0 context.Context - if rf, ok := ret.Get(0).(func() context.Context); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(context.Context) - } - } - - return r0 -} - -// GetAttribute provides a mock function with given fields: key -func (_m *Event) GetAttribute(key string) interface{} { - ret := _m.Called(key) - - var r0 interface{} - if rf, ok := ret.Get(0).(func(string) interface{}); ok { - r0 = rf(key) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) - } - } - - return r0 -} - -// GetOriginal provides a mock function with given fields: key, def -func (_m *Event) GetOriginal(key string, def ...interface{}) interface{} { - var _ca []interface{} - _ca = append(_ca, key) - _ca = append(_ca, def...) - ret := _m.Called(_ca...) - - var r0 interface{} - if rf, ok := ret.Get(0).(func(string, ...interface{}) interface{}); ok { - r0 = rf(key, def...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) - } - } - - return r0 -} - -// IsClean provides a mock function with given fields: columns -func (_m *Event) IsClean(columns ...string) bool { - _va := make([]interface{}, len(columns)) - for _i := range columns { - _va[_i] = columns[_i] - } - var _ca []interface{} - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 bool - if rf, ok := ret.Get(0).(func(...string) bool); ok { - r0 = rf(columns...) - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// IsDirty provides a mock function with given fields: columns -func (_m *Event) IsDirty(columns ...string) bool { - _va := make([]interface{}, len(columns)) - for _i := range columns { - _va[_i] = columns[_i] - } - var _ca []interface{} - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 bool - if rf, ok := ret.Get(0).(func(...string) bool); ok { - r0 = rf(columns...) - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Query provides a mock function with given fields: -func (_m *Event) Query() orm.Query { - ret := _m.Called() - - var r0 orm.Query - if rf, ok := ret.Get(0).(func() orm.Query); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(orm.Query) - } - } - - return r0 -} - -// SetAttribute provides a mock function with given fields: key, value -func (_m *Event) SetAttribute(key string, value interface{}) { - _m.Called(key, value) -} - -// NewEvent creates a new instance of Event. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewEvent(t interface { - mock.TestingT - Cleanup(func()) -}) *Event { - mock := &Event{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/database/orm/Observer.go b/mocks/database/orm/Observer.go deleted file mode 100644 index 6bd5b8f35..000000000 --- a/mocks/database/orm/Observer.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - orm "github.com/goravel/framework/contracts/database/orm" - mock "github.com/stretchr/testify/mock" -) - -// Observer is an autogenerated mock type for the Observer type -type Observer struct { - mock.Mock -} - -// Created provides a mock function with given fields: _a0 -func (_m *Observer) Created(_a0 orm.Event) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(orm.Event) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Creating provides a mock function with given fields: _a0 -func (_m *Observer) Creating(_a0 orm.Event) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(orm.Event) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Deleted provides a mock function with given fields: _a0 -func (_m *Observer) Deleted(_a0 orm.Event) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(orm.Event) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Deleting provides a mock function with given fields: _a0 -func (_m *Observer) Deleting(_a0 orm.Event) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(orm.Event) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ForceDeleted provides a mock function with given fields: _a0 -func (_m *Observer) ForceDeleted(_a0 orm.Event) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(orm.Event) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ForceDeleting provides a mock function with given fields: _a0 -func (_m *Observer) ForceDeleting(_a0 orm.Event) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(orm.Event) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Retrieved provides a mock function with given fields: _a0 -func (_m *Observer) Retrieved(_a0 orm.Event) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(orm.Event) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Saved provides a mock function with given fields: _a0 -func (_m *Observer) Saved(_a0 orm.Event) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(orm.Event) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Saving provides a mock function with given fields: _a0 -func (_m *Observer) Saving(_a0 orm.Event) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(orm.Event) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Updated provides a mock function with given fields: _a0 -func (_m *Observer) Updated(_a0 orm.Event) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(orm.Event) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Updating provides a mock function with given fields: _a0 -func (_m *Observer) Updating(_a0 orm.Event) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(orm.Event) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// NewObserver creates a new instance of Observer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewObserver(t interface { - mock.TestingT - Cleanup(func()) -}) *Observer { - mock := &Observer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/database/seeder/Seeder.go b/mocks/database/seeder/Seeder.go deleted file mode 100644 index 717aad41e..000000000 --- a/mocks/database/seeder/Seeder.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// Seeder is an autogenerated mock type for the Seeder type -type Seeder struct { - mock.Mock -} - -// Run provides a mock function with given fields: -func (_m *Seeder) Run() error { - ret := _m.Called() - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Signature provides a mock function with given fields: -func (_m *Seeder) Signature() string { - ret := _m.Called() - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// NewSeeder creates a new instance of Seeder. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewSeeder(t interface { - mock.TestingT - Cleanup(func()) -}) *Seeder { - mock := &Seeder{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/event/Event.go b/mocks/event/Event.go deleted file mode 100644 index 6e365d28d..000000000 --- a/mocks/event/Event.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - event "github.com/goravel/framework/contracts/event" - mock "github.com/stretchr/testify/mock" -) - -// Event is an autogenerated mock type for the Event type -type Event struct { - mock.Mock -} - -// Handle provides a mock function with given fields: args -func (_m *Event) Handle(args []event.Arg) ([]event.Arg, error) { - ret := _m.Called(args) - - var r0 []event.Arg - var r1 error - if rf, ok := ret.Get(0).(func([]event.Arg) ([]event.Arg, error)); ok { - return rf(args) - } - if rf, ok := ret.Get(0).(func([]event.Arg) []event.Arg); ok { - r0 = rf(args) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]event.Arg) - } - } - - if rf, ok := ret.Get(1).(func([]event.Arg) error); ok { - r1 = rf(args) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewEvent creates a new instance of Event. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewEvent(t interface { - mock.TestingT - Cleanup(func()) -}) *Event { - mock := &Event{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/event/Listener.go b/mocks/event/Listener.go deleted file mode 100644 index 4f3a94157..000000000 --- a/mocks/event/Listener.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - event "github.com/goravel/framework/contracts/event" - mock "github.com/stretchr/testify/mock" -) - -// Listener is an autogenerated mock type for the Listener type -type Listener struct { - mock.Mock -} - -// Handle provides a mock function with given fields: args -func (_m *Listener) Handle(args ...interface{}) error { - var _ca []interface{} - _ca = append(_ca, args...) - ret := _m.Called(_ca...) - - var r0 error - if rf, ok := ret.Get(0).(func(...interface{}) error); ok { - r0 = rf(args...) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Queue provides a mock function with given fields: args -func (_m *Listener) Queue(args ...interface{}) event.Queue { - var _ca []interface{} - _ca = append(_ca, args...) - ret := _m.Called(_ca...) - - var r0 event.Queue - if rf, ok := ret.Get(0).(func(...interface{}) event.Queue); ok { - r0 = rf(args...) - } else { - r0 = ret.Get(0).(event.Queue) - } - - return r0 -} - -// Signature provides a mock function with given fields: -func (_m *Listener) Signature() string { - ret := _m.Called() - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// NewListener creates a new instance of Listener. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewListener(t interface { - mock.TestingT - Cleanup(func()) -}) *Listener { - mock := &Listener{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/foundation/Container.go b/mocks/foundation/Container.go deleted file mode 100644 index ed95a19cc..000000000 --- a/mocks/foundation/Container.go +++ /dev/null @@ -1,475 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - auth "github.com/goravel/framework/contracts/auth" - access "github.com/goravel/framework/contracts/auth/access" - - cache "github.com/goravel/framework/contracts/cache" - - config "github.com/goravel/framework/contracts/config" - - console "github.com/goravel/framework/contracts/console" - - crypt "github.com/goravel/framework/contracts/crypt" - - event "github.com/goravel/framework/contracts/event" - - filesystem "github.com/goravel/framework/contracts/filesystem" - - foundation "github.com/goravel/framework/contracts/foundation" - - grpc "github.com/goravel/framework/contracts/grpc" - - hash "github.com/goravel/framework/contracts/hash" - - http "github.com/goravel/framework/contracts/http" - - log "github.com/goravel/framework/contracts/log" - - mail "github.com/goravel/framework/contracts/mail" - - mock "github.com/stretchr/testify/mock" - - orm "github.com/goravel/framework/contracts/database/orm" - - queue "github.com/goravel/framework/contracts/queue" - - route "github.com/goravel/framework/contracts/route" - - schedule "github.com/goravel/framework/contracts/schedule" - - seeder "github.com/goravel/framework/contracts/database/seeder" - - testing "github.com/goravel/framework/contracts/testing" - - validation "github.com/goravel/framework/contracts/validation" -) - -// Container is an autogenerated mock type for the Container type -type Container struct { - mock.Mock -} - -// Bind provides a mock function with given fields: key, callback -func (_m *Container) Bind(key interface{}, callback func(foundation.Application) (interface{}, error)) { - _m.Called(key, callback) -} - -// BindWith provides a mock function with given fields: key, callback -func (_m *Container) BindWith(key interface{}, callback func(foundation.Application, map[string]interface{}) (interface{}, error)) { - _m.Called(key, callback) -} - -// Instance provides a mock function with given fields: key, instance -func (_m *Container) Instance(key interface{}, instance interface{}) { - _m.Called(key, instance) -} - -// Make provides a mock function with given fields: key -func (_m *Container) Make(key interface{}) (interface{}, error) { - ret := _m.Called(key) - - var r0 interface{} - var r1 error - if rf, ok := ret.Get(0).(func(interface{}) (interface{}, error)); ok { - return rf(key) - } - if rf, ok := ret.Get(0).(func(interface{}) interface{}); ok { - r0 = rf(key) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) - } - } - - if rf, ok := ret.Get(1).(func(interface{}) error); ok { - r1 = rf(key) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MakeArtisan provides a mock function with given fields: -func (_m *Container) MakeArtisan() console.Artisan { - ret := _m.Called() - - var r0 console.Artisan - if rf, ok := ret.Get(0).(func() console.Artisan); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(console.Artisan) - } - } - - return r0 -} - -// MakeAuth provides a mock function with given fields: -func (_m *Container) MakeAuth() auth.Auth { - ret := _m.Called() - - var r0 auth.Auth - if rf, ok := ret.Get(0).(func() auth.Auth); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(auth.Auth) - } - } - - return r0 -} - -// MakeCache provides a mock function with given fields: -func (_m *Container) MakeCache() cache.Cache { - ret := _m.Called() - - var r0 cache.Cache - if rf, ok := ret.Get(0).(func() cache.Cache); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(cache.Cache) - } - } - - return r0 -} - -// MakeConfig provides a mock function with given fields: -func (_m *Container) MakeConfig() config.Config { - ret := _m.Called() - - var r0 config.Config - if rf, ok := ret.Get(0).(func() config.Config); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(config.Config) - } - } - - return r0 -} - -// MakeCrypt provides a mock function with given fields: -func (_m *Container) MakeCrypt() crypt.Crypt { - ret := _m.Called() - - var r0 crypt.Crypt - if rf, ok := ret.Get(0).(func() crypt.Crypt); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(crypt.Crypt) - } - } - - return r0 -} - -// MakeEvent provides a mock function with given fields: -func (_m *Container) MakeEvent() event.Instance { - ret := _m.Called() - - var r0 event.Instance - if rf, ok := ret.Get(0).(func() event.Instance); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(event.Instance) - } - } - - return r0 -} - -// MakeGate provides a mock function with given fields: -func (_m *Container) MakeGate() access.Gate { - ret := _m.Called() - - var r0 access.Gate - if rf, ok := ret.Get(0).(func() access.Gate); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(access.Gate) - } - } - - return r0 -} - -// MakeGrpc provides a mock function with given fields: -func (_m *Container) MakeGrpc() grpc.Grpc { - ret := _m.Called() - - var r0 grpc.Grpc - if rf, ok := ret.Get(0).(func() grpc.Grpc); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(grpc.Grpc) - } - } - - return r0 -} - -// MakeHash provides a mock function with given fields: -func (_m *Container) MakeHash() hash.Hash { - ret := _m.Called() - - var r0 hash.Hash - if rf, ok := ret.Get(0).(func() hash.Hash); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(hash.Hash) - } - } - - return r0 -} - -// MakeLog provides a mock function with given fields: -func (_m *Container) MakeLog() log.Log { - ret := _m.Called() - - var r0 log.Log - if rf, ok := ret.Get(0).(func() log.Log); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(log.Log) - } - } - - return r0 -} - -// MakeMail provides a mock function with given fields: -func (_m *Container) MakeMail() mail.Mail { - ret := _m.Called() - - var r0 mail.Mail - if rf, ok := ret.Get(0).(func() mail.Mail); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(mail.Mail) - } - } - - return r0 -} - -// MakeOrm provides a mock function with given fields: -func (_m *Container) MakeOrm() orm.Orm { - ret := _m.Called() - - var r0 orm.Orm - if rf, ok := ret.Get(0).(func() orm.Orm); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(orm.Orm) - } - } - - return r0 -} - -// MakeQueue provides a mock function with given fields: -func (_m *Container) MakeQueue() queue.Queue { - ret := _m.Called() - - var r0 queue.Queue - if rf, ok := ret.Get(0).(func() queue.Queue); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(queue.Queue) - } - } - - return r0 -} - -// MakeRateLimiter provides a mock function with given fields: -func (_m *Container) MakeRateLimiter() http.RateLimiter { - ret := _m.Called() - - var r0 http.RateLimiter - if rf, ok := ret.Get(0).(func() http.RateLimiter); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(http.RateLimiter) - } - } - - return r0 -} - -// MakeRoute provides a mock function with given fields: -func (_m *Container) MakeRoute() route.Route { - ret := _m.Called() - - var r0 route.Route - if rf, ok := ret.Get(0).(func() route.Route); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(route.Route) - } - } - - return r0 -} - -// MakeSchedule provides a mock function with given fields: -func (_m *Container) MakeSchedule() schedule.Schedule { - ret := _m.Called() - - var r0 schedule.Schedule - if rf, ok := ret.Get(0).(func() schedule.Schedule); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(schedule.Schedule) - } - } - - return r0 -} - -// MakeSeeder provides a mock function with given fields: -func (_m *Container) MakeSeeder() seeder.Facade { - ret := _m.Called() - - var r0 seeder.Facade - if rf, ok := ret.Get(0).(func() seeder.Facade); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(seeder.Facade) - } - } - - return r0 -} - -// MakeStorage provides a mock function with given fields: -func (_m *Container) MakeStorage() filesystem.Storage { - ret := _m.Called() - - var r0 filesystem.Storage - if rf, ok := ret.Get(0).(func() filesystem.Storage); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(filesystem.Storage) - } - } - - return r0 -} - -// MakeTesting provides a mock function with given fields: -func (_m *Container) MakeTesting() testing.Testing { - ret := _m.Called() - - var r0 testing.Testing - if rf, ok := ret.Get(0).(func() testing.Testing); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(testing.Testing) - } - } - - return r0 -} - -// MakeValidation provides a mock function with given fields: -func (_m *Container) MakeValidation() validation.Validation { - ret := _m.Called() - - var r0 validation.Validation - if rf, ok := ret.Get(0).(func() validation.Validation); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(validation.Validation) - } - } - - return r0 -} - -// MakeView provides a mock function with given fields: -func (_m *Container) MakeView() http.View { - ret := _m.Called() - - var r0 http.View - if rf, ok := ret.Get(0).(func() http.View); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(http.View) - } - } - - return r0 -} - -// MakeWith provides a mock function with given fields: key, parameters -func (_m *Container) MakeWith(key interface{}, parameters map[string]interface{}) (interface{}, error) { - ret := _m.Called(key, parameters) - - var r0 interface{} - var r1 error - if rf, ok := ret.Get(0).(func(interface{}, map[string]interface{}) (interface{}, error)); ok { - return rf(key, parameters) - } - if rf, ok := ret.Get(0).(func(interface{}, map[string]interface{}) interface{}); ok { - r0 = rf(key, parameters) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) - } - } - - if rf, ok := ret.Get(1).(func(interface{}, map[string]interface{}) error); ok { - r1 = rf(key, parameters) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Singleton provides a mock function with given fields: key, callback -func (_m *Container) Singleton(key interface{}, callback func(foundation.Application) (interface{}, error)) { - _m.Called(key, callback) -} - -// NewContainer creates a new instance of Container. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewContainer(t interface { - mock.TestingT - Cleanup(func()) -}) *Container { - mock := &Container{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/foundation/ServiceProvider.go b/mocks/foundation/ServiceProvider.go deleted file mode 100644 index 134b12fe3..000000000 --- a/mocks/foundation/ServiceProvider.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - foundation "github.com/goravel/framework/contracts/foundation" - mock "github.com/stretchr/testify/mock" -) - -// ServiceProvider is an autogenerated mock type for the ServiceProvider type -type ServiceProvider struct { - mock.Mock -} - -// Boot provides a mock function with given fields: app -func (_m *ServiceProvider) Boot(app foundation.Application) { - _m.Called(app) -} - -// Register provides a mock function with given fields: app -func (_m *ServiceProvider) Register(app foundation.Application) { - _m.Called(app) -} - -// NewServiceProvider creates a new instance of ServiceProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewServiceProvider(t interface { - mock.TestingT - Cleanup(func()) -}) *ServiceProvider { - mock := &ServiceProvider{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/http/FormRequest.go b/mocks/http/FormRequest.go deleted file mode 100644 index 4ae11112d..000000000 --- a/mocks/http/FormRequest.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - http "github.com/goravel/framework/contracts/http" - mock "github.com/stretchr/testify/mock" - - validation "github.com/goravel/framework/contracts/validation" -) - -// FormRequest is an autogenerated mock type for the FormRequest type -type FormRequest struct { - mock.Mock -} - -// Attributes provides a mock function with given fields: ctx -func (_m *FormRequest) Attributes(ctx http.Context) map[string]string { - ret := _m.Called(ctx) - - var r0 map[string]string - if rf, ok := ret.Get(0).(func(http.Context) map[string]string); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string]string) - } - } - - return r0 -} - -// Authorize provides a mock function with given fields: ctx -func (_m *FormRequest) Authorize(ctx http.Context) error { - ret := _m.Called(ctx) - - var r0 error - if rf, ok := ret.Get(0).(func(http.Context) error); ok { - r0 = rf(ctx) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Messages provides a mock function with given fields: ctx -func (_m *FormRequest) Messages(ctx http.Context) map[string]string { - ret := _m.Called(ctx) - - var r0 map[string]string - if rf, ok := ret.Get(0).(func(http.Context) map[string]string); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string]string) - } - } - - return r0 -} - -// PrepareForValidation provides a mock function with given fields: ctx, data -func (_m *FormRequest) PrepareForValidation(ctx http.Context, data validation.Data) error { - ret := _m.Called(ctx, data) - - var r0 error - if rf, ok := ret.Get(0).(func(http.Context, validation.Data) error); ok { - r0 = rf(ctx, data) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Rules provides a mock function with given fields: ctx -func (_m *FormRequest) Rules(ctx http.Context) map[string]string { - ret := _m.Called(ctx) - - var r0 map[string]string - if rf, ok := ret.Get(0).(func(http.Context) map[string]string); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string]string) - } - } - - return r0 -} - -// NewFormRequest creates a new instance of FormRequest. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewFormRequest(t interface { - mock.TestingT - Cleanup(func()) -}) *FormRequest { - mock := &FormRequest{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/http/HandlerFunc.go b/mocks/http/HandlerFunc.go deleted file mode 100644 index f6dbd3943..000000000 --- a/mocks/http/HandlerFunc.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - http "github.com/goravel/framework/contracts/http" - mock "github.com/stretchr/testify/mock" -) - -// HandlerFunc is an autogenerated mock type for the HandlerFunc type -type HandlerFunc struct { - mock.Mock -} - -// Execute provides a mock function with given fields: _a0 -func (_m *HandlerFunc) Execute(_a0 http.Context) http.Response { - ret := _m.Called(_a0) - - var r0 http.Response - if rf, ok := ret.Get(0).(func(http.Context) http.Response); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(http.Response) - } - } - - return r0 -} - -// NewHandlerFunc creates a new instance of HandlerFunc. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewHandlerFunc(t interface { - mock.TestingT - Cleanup(func()) -}) *HandlerFunc { - mock := &HandlerFunc{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/http/Limit.go b/mocks/http/Limit.go deleted file mode 100644 index a64e3e440..000000000 --- a/mocks/http/Limit.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - http "github.com/goravel/framework/contracts/http" - mock "github.com/stretchr/testify/mock" -) - -// Limit is an autogenerated mock type for the Limit type -type Limit struct { - mock.Mock -} - -// By provides a mock function with given fields: key -func (_m *Limit) By(key string) http.Limit { - ret := _m.Called(key) - - var r0 http.Limit - if rf, ok := ret.Get(0).(func(string) http.Limit); ok { - r0 = rf(key) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(http.Limit) - } - } - - return r0 -} - -// Response provides a mock function with given fields: _a0 -func (_m *Limit) Response(_a0 func(http.Context)) http.Limit { - ret := _m.Called(_a0) - - var r0 http.Limit - if rf, ok := ret.Get(0).(func(func(http.Context)) http.Limit); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(http.Limit) - } - } - - return r0 -} - -// NewLimit creates a new instance of Limit. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewLimit(t interface { - mock.TestingT - Cleanup(func()) -}) *Limit { - mock := &Limit{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/http/Middleware.go b/mocks/http/Middleware.go deleted file mode 100644 index e8fe5fe5b..000000000 --- a/mocks/http/Middleware.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - http "github.com/goravel/framework/contracts/http" - mock "github.com/stretchr/testify/mock" -) - -// Middleware is an autogenerated mock type for the Middleware type -type Middleware struct { - mock.Mock -} - -// Execute provides a mock function with given fields: _a0 -func (_m *Middleware) Execute(_a0 http.Context) { - _m.Called(_a0) -} - -// NewMiddleware creates a new instance of Middleware. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMiddleware(t interface { - mock.TestingT - Cleanup(func()) -}) *Middleware { - mock := &Middleware{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/http/ResourceController.go b/mocks/http/ResourceController.go deleted file mode 100644 index 842acd3ba..000000000 --- a/mocks/http/ResourceController.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - http "github.com/goravel/framework/contracts/http" - mock "github.com/stretchr/testify/mock" -) - -// ResourceController is an autogenerated mock type for the ResourceController type -type ResourceController struct { - mock.Mock -} - -// Destroy provides a mock function with given fields: _a0 -func (_m *ResourceController) Destroy(_a0 http.Context) http.Response { - ret := _m.Called(_a0) - - var r0 http.Response - if rf, ok := ret.Get(0).(func(http.Context) http.Response); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(http.Response) - } - } - - return r0 -} - -// Index provides a mock function with given fields: _a0 -func (_m *ResourceController) Index(_a0 http.Context) http.Response { - ret := _m.Called(_a0) - - var r0 http.Response - if rf, ok := ret.Get(0).(func(http.Context) http.Response); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(http.Response) - } - } - - return r0 -} - -// Show provides a mock function with given fields: _a0 -func (_m *ResourceController) Show(_a0 http.Context) http.Response { - ret := _m.Called(_a0) - - var r0 http.Response - if rf, ok := ret.Get(0).(func(http.Context) http.Response); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(http.Response) - } - } - - return r0 -} - -// Store provides a mock function with given fields: _a0 -func (_m *ResourceController) Store(_a0 http.Context) http.Response { - ret := _m.Called(_a0) - - var r0 http.Response - if rf, ok := ret.Get(0).(func(http.Context) http.Response); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(http.Response) - } - } - - return r0 -} - -// Update provides a mock function with given fields: _a0 -func (_m *ResourceController) Update(_a0 http.Context) http.Response { - ret := _m.Called(_a0) - - var r0 http.Response - if rf, ok := ret.Get(0).(func(http.Context) http.Response); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(http.Response) - } - } - - return r0 -} - -// NewResourceController creates a new instance of ResourceController. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewResourceController(t interface { - mock.TestingT - Cleanup(func()) -}) *ResourceController { - mock := &ResourceController{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/http/ResponseView.go b/mocks/http/ResponseView.go deleted file mode 100644 index fd24b7c88..000000000 --- a/mocks/http/ResponseView.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - http "github.com/goravel/framework/contracts/http" - mock "github.com/stretchr/testify/mock" -) - -// ResponseView is an autogenerated mock type for the ResponseView type -type ResponseView struct { - mock.Mock -} - -// First provides a mock function with given fields: views, data -func (_m *ResponseView) First(views []string, data ...interface{}) http.Response { - var _ca []interface{} - _ca = append(_ca, views) - _ca = append(_ca, data...) - ret := _m.Called(_ca...) - - var r0 http.Response - if rf, ok := ret.Get(0).(func([]string, ...interface{}) http.Response); ok { - r0 = rf(views, data...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(http.Response) - } - } - - return r0 -} - -// Make provides a mock function with given fields: view, data -func (_m *ResponseView) Make(view string, data ...interface{}) http.Response { - var _ca []interface{} - _ca = append(_ca, view) - _ca = append(_ca, data...) - ret := _m.Called(_ca...) - - var r0 http.Response - if rf, ok := ret.Get(0).(func(string, ...interface{}) http.Response); ok { - r0 = rf(view, data...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(http.Response) - } - } - - return r0 -} - -// NewResponseView creates a new instance of ResponseView. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewResponseView(t interface { - mock.TestingT - Cleanup(func()) -}) *ResponseView { - mock := &ResponseView{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/queue/Job.go b/mocks/queue/Job.go deleted file mode 100644 index 30282bb45..000000000 --- a/mocks/queue/Job.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// Job is an autogenerated mock type for the Job type -type Job struct { - mock.Mock -} - -// Handle provides a mock function with given fields: args -func (_m *Job) Handle(args ...interface{}) error { - var _ca []interface{} - _ca = append(_ca, args...) - ret := _m.Called(_ca...) - - var r0 error - if rf, ok := ret.Get(0).(func(...interface{}) error); ok { - r0 = rf(args...) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Signature provides a mock function with given fields: -func (_m *Job) Signature() string { - ret := _m.Called() - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// NewJob creates a new instance of Job. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewJob(t interface { - mock.TestingT - Cleanup(func()) -}) *Job { - mock := &Job{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/queue/Worker.go b/mocks/queue/Worker.go deleted file mode 100644 index fbf20a9bd..000000000 --- a/mocks/queue/Worker.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// Worker is an autogenerated mock type for the Worker type -type Worker struct { - mock.Mock -} - -// Run provides a mock function with given fields: -func (_m *Worker) Run() error { - ret := _m.Called() - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// NewWorker creates a new instance of Worker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewWorker(t interface { - mock.TestingT - Cleanup(func()) -}) *Worker { - mock := &Worker{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/route/GroupFunc.go b/mocks/route/GroupFunc.go deleted file mode 100644 index 11a0f6f8e..000000000 --- a/mocks/route/GroupFunc.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - route "github.com/goravel/framework/contracts/route" - mock "github.com/stretchr/testify/mock" -) - -// GroupFunc is an autogenerated mock type for the GroupFunc type -type GroupFunc struct { - mock.Mock -} - -// Execute provides a mock function with given fields: router -func (_m *GroupFunc) Execute(router route.Router) { - _m.Called(router) -} - -// NewGroupFunc creates a new instance of GroupFunc. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewGroupFunc(t interface { - mock.TestingT - Cleanup(func()) -}) *GroupFunc { - mock := &GroupFunc{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/testing/Database.go b/mocks/testing/Database.go deleted file mode 100644 index b3ba62f26..000000000 --- a/mocks/testing/Database.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - seeder "github.com/goravel/framework/contracts/database/seeder" - testing "github.com/goravel/framework/contracts/testing" - mock "github.com/stretchr/testify/mock" -) - -// Database is an autogenerated mock type for the Database type -type Database struct { - mock.Mock -} - -// Build provides a mock function with given fields: -func (_m *Database) Build() error { - ret := _m.Called() - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Clear provides a mock function with given fields: -func (_m *Database) Clear() error { - ret := _m.Called() - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Config provides a mock function with given fields: -func (_m *Database) Config() testing.Config { - ret := _m.Called() - - var r0 testing.Config - if rf, ok := ret.Get(0).(func() testing.Config); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(testing.Config) - } - - return r0 -} - -// Image provides a mock function with given fields: _a0 -func (_m *Database) Image(_a0 testing.Image) { - _m.Called(_a0) -} - -// Seed provides a mock function with given fields: seeds -func (_m *Database) Seed(seeds ...seeder.Seeder) { - _va := make([]interface{}, len(seeds)) - for _i := range seeds { - _va[_i] = seeds[_i] - } - var _ca []interface{} - _ca = append(_ca, _va...) - _m.Called(_ca...) -} - -// NewDatabase creates a new instance of Database. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewDatabase(t interface { - mock.TestingT - Cleanup(func()) -}) *Database { - mock := &Database{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/testing/DatabaseDriver.go b/mocks/testing/DatabaseDriver.go deleted file mode 100644 index cad73dcb6..000000000 --- a/mocks/testing/DatabaseDriver.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - dockertest "github.com/ory/dockertest/v3" - mock "github.com/stretchr/testify/mock" - - orm "github.com/goravel/framework/contracts/database/orm" - - testing "github.com/goravel/framework/contracts/testing" -) - -// DatabaseDriver is an autogenerated mock type for the DatabaseDriver type -type DatabaseDriver struct { - mock.Mock -} - -// Clear provides a mock function with given fields: pool, resource -func (_m *DatabaseDriver) Clear(pool *dockertest.Pool, resource *dockertest.Resource) error { - ret := _m.Called(pool, resource) - - var r0 error - if rf, ok := ret.Get(0).(func(*dockertest.Pool, *dockertest.Resource) error); ok { - r0 = rf(pool, resource) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Config provides a mock function with given fields: resource -func (_m *DatabaseDriver) Config(resource *dockertest.Resource) testing.Config { - ret := _m.Called(resource) - - var r0 testing.Config - if rf, ok := ret.Get(0).(func(*dockertest.Resource) testing.Config); ok { - r0 = rf(resource) - } else { - r0 = ret.Get(0).(testing.Config) - } - - return r0 -} - -// Image provides a mock function with given fields: -func (_m *DatabaseDriver) Image() *dockertest.RunOptions { - ret := _m.Called() - - var r0 *dockertest.RunOptions - if rf, ok := ret.Get(0).(func() *dockertest.RunOptions); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*dockertest.RunOptions) - } - } - - return r0 -} - -// Name provides a mock function with given fields: -func (_m *DatabaseDriver) Name() orm.Driver { - ret := _m.Called() - - var r0 orm.Driver - if rf, ok := ret.Get(0).(func() orm.Driver); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(orm.Driver) - } - - return r0 -} - -// NewDatabaseDriver creates a new instance of DatabaseDriver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewDatabaseDriver(t interface { - mock.TestingT - Cleanup(func()) -}) *DatabaseDriver { - mock := &DatabaseDriver{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/testing/Docker.go b/mocks/testing/Docker.go deleted file mode 100644 index e67ff884b..000000000 --- a/mocks/testing/Docker.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - testing "github.com/goravel/framework/contracts/testing" - mock "github.com/stretchr/testify/mock" -) - -// Docker is an autogenerated mock type for the Docker type -type Docker struct { - mock.Mock -} - -// Database provides a mock function with given fields: connection -func (_m *Docker) Database(connection ...string) (testing.Database, error) { - _va := make([]interface{}, len(connection)) - for _i := range connection { - _va[_i] = connection[_i] - } - var _ca []interface{} - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 testing.Database - var r1 error - if rf, ok := ret.Get(0).(func(...string) (testing.Database, error)); ok { - return rf(connection...) - } - if rf, ok := ret.Get(0).(func(...string) testing.Database); ok { - r0 = rf(connection...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(testing.Database) - } - } - - if rf, ok := ret.Get(1).(func(...string) error); ok { - r1 = rf(connection...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewDocker creates a new instance of Docker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewDocker(t interface { - mock.TestingT - Cleanup(func()) -}) *Docker { - mock := &Docker{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/testing/Testing.go b/mocks/testing/Testing.go deleted file mode 100644 index c2b1f2618..000000000 --- a/mocks/testing/Testing.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - testing "github.com/goravel/framework/contracts/testing" - mock "github.com/stretchr/testify/mock" -) - -// Testing is an autogenerated mock type for the Testing type -type Testing struct { - mock.Mock -} - -// Docker provides a mock function with given fields: -func (_m *Testing) Docker() testing.Docker { - ret := _m.Called() - - var r0 testing.Docker - if rf, ok := ret.Get(0).(func() testing.Docker); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(testing.Docker) - } - } - - return r0 -} - -// NewTesting creates a new instance of Testing. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewTesting(t interface { - mock.TestingT - Cleanup(func()) -}) *Testing { - mock := &Testing{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/validation/Data.go b/mocks/validation/Data.go deleted file mode 100644 index 607140441..000000000 --- a/mocks/validation/Data.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// Data is an autogenerated mock type for the Data type -type Data struct { - mock.Mock -} - -// Get provides a mock function with given fields: key -func (_m *Data) Get(key string) (interface{}, bool) { - ret := _m.Called(key) - - var r0 interface{} - var r1 bool - if rf, ok := ret.Get(0).(func(string) (interface{}, bool)); ok { - return rf(key) - } - if rf, ok := ret.Get(0).(func(string) interface{}); ok { - r0 = rf(key) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) - } - } - - if rf, ok := ret.Get(1).(func(string) bool); ok { - r1 = rf(key) - } else { - r1 = ret.Get(1).(bool) - } - - return r0, r1 -} - -// Set provides a mock function with given fields: key, val -func (_m *Data) Set(key string, val interface{}) error { - ret := _m.Called(key, val) - - var r0 error - if rf, ok := ret.Get(0).(func(string, interface{}) error); ok { - r0 = rf(key, val) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// NewData creates a new instance of Data. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewData(t interface { - mock.TestingT - Cleanup(func()) -}) *Data { - mock := &Data{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/validation/Option.go b/mocks/validation/Option.go deleted file mode 100644 index 623a1a6d2..000000000 --- a/mocks/validation/Option.go +++ /dev/null @@ -1,29 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// Option is an autogenerated mock type for the Option type -type Option struct { - mock.Mock -} - -// Execute provides a mock function with given fields: _a0 -func (_m *Option) Execute(_a0 map[string]interface{}) { - _m.Called(_a0) -} - -// NewOption creates a new instance of Option. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewOption(t interface { - mock.TestingT - Cleanup(func()) -}) *Option { - mock := &Option{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/validation/Rule.go b/mocks/validation/Rule.go deleted file mode 100644 index 83aa2c4bd..000000000 --- a/mocks/validation/Rule.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by mockery v2.34.2. DO NOT EDIT. - -package mocks - -import ( - validation "github.com/goravel/framework/contracts/validation" - mock "github.com/stretchr/testify/mock" -) - -// Rule is an autogenerated mock type for the Rule type -type Rule struct { - mock.Mock -} - -// Message provides a mock function with given fields: -func (_m *Rule) Message() string { - ret := _m.Called() - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// Passes provides a mock function with given fields: data, val, options -func (_m *Rule) Passes(data validation.Data, val interface{}, options ...interface{}) bool { - var _ca []interface{} - _ca = append(_ca, data, val) - _ca = append(_ca, options...) - ret := _m.Called(_ca...) - - var r0 bool - if rf, ok := ret.Get(0).(func(validation.Data, interface{}, ...interface{}) bool); ok { - r0 = rf(data, val, options...) - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Signature provides a mock function with given fields: -func (_m *Rule) Signature() string { - ret := _m.Called() - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// NewRule creates a new instance of Rule. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewRule(t interface { - mock.TestingT - Cleanup(func()) -}) *Rule { - mock := &Rule{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/queue/application_test.go b/queue/application_test.go index 7edbe3496..628bf8562 100644 --- a/queue/application_test.go +++ b/queue/application_test.go @@ -10,9 +10,9 @@ import ( "github.com/spf13/cast" "github.com/stretchr/testify/suite" + configmock "github.com/goravel/framework/contracts/config/mocks" "github.com/goravel/framework/contracts/queue" - configmock "github.com/goravel/framework/mocks/config" - queuemock "github.com/goravel/framework/mocks/queue" + queuemock "github.com/goravel/framework/contracts/queue/mocks" "github.com/goravel/framework/support/carbon" testingdocker "github.com/goravel/framework/support/docker" ) diff --git a/queue/config_test.go b/queue/config_test.go index 4aa7a2248..32d9a50d8 100644 --- a/queue/config_test.go +++ b/queue/config_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/suite" - configmock "github.com/goravel/framework/mocks/config" + configmock "github.com/goravel/framework/contracts/config/mocks" ) type ConfigTestSuite struct { diff --git a/queue/console/job_make_command_test.go b/queue/console/job_make_command_test.go index ff0a32d82..4b0d3fa7f 100644 --- a/queue/console/job_make_command_test.go +++ b/queue/console/job_make_command_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - consolemocks "github.com/goravel/framework/mocks/console" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support/file" ) diff --git a/queue/machinery_test.go b/queue/machinery_test.go index e13f41fae..cfcddb8f1 100644 --- a/queue/machinery_test.go +++ b/queue/machinery_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/suite" - configmock "github.com/goravel/framework/mocks/config" + configmock "github.com/goravel/framework/contracts/config/mocks" ) type MachineryTestSuite struct { diff --git a/schedule/application_test.go b/schedule/application_test.go index aa3fbf33c..65533fe94 100644 --- a/schedule/application_test.go +++ b/schedule/application_test.go @@ -8,10 +8,10 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" + cachemocks "github.com/goravel/framework/contracts/cache/mocks" + consolemocks "github.com/goravel/framework/contracts/console/mocks" + logmocks "github.com/goravel/framework/contracts/log/mocks" "github.com/goravel/framework/contracts/schedule" - cachemocks "github.com/goravel/framework/mocks/cache" - consolemocks "github.com/goravel/framework/mocks/console" - logmocks "github.com/goravel/framework/mocks/log" "github.com/goravel/framework/support/carbon" ) diff --git a/support/constant.go b/support/constant.go index 3ed7f418e..adf3488aa 100644 --- a/support/constant.go +++ b/support/constant.go @@ -1,6 +1,6 @@ package support -const Version string = "v1.13.1" +const Version string = "v1.13.2" const ( EnvRuntime = "runtime" diff --git a/support/database/database.go b/support/database/database.go index 7fd79cd66..f29786c74 100644 --- a/support/database/database.go +++ b/support/database/database.go @@ -30,7 +30,7 @@ func GetIDByReflect(t reflect.Type, v reflect.Value) any { if t.Field(i).Name == "Model" && v.Field(i).Type().Kind() == reflect.Struct { structField := v.Field(i).Type() for j := 0; j < structField.NumField(); j++ { - if !structField.Field(j).IsExported() { + if !structField.Field(i).IsExported() { continue } if strings.Contains(structField.Field(j).Tag.Get("gorm"), "primaryKey") { diff --git a/testing/docker/database.go b/testing/docker/database.go index 9310c079d..270a72801 100644 --- a/testing/docker/database.go +++ b/testing/docker/database.go @@ -7,12 +7,12 @@ import ( "github.com/ory/dockertest/v3" contractsconfig "github.com/goravel/framework/contracts/config" - "github.com/goravel/framework/contracts/database/gorm" contractsorm "github.com/goravel/framework/contracts/database/orm" "github.com/goravel/framework/contracts/database/seeder" "github.com/goravel/framework/contracts/foundation" "github.com/goravel/framework/contracts/testing" "github.com/goravel/framework/database" + "github.com/goravel/framework/database/gorm" "github.com/goravel/framework/support/docker" ) diff --git a/testing/docker/database_test.go b/testing/docker/database_test.go index 0d237a0a6..3e5511c77 100644 --- a/testing/docker/database_test.go +++ b/testing/docker/database_test.go @@ -9,12 +9,12 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" + configmocks "github.com/goravel/framework/contracts/config/mocks" + consolemocks "github.com/goravel/framework/contracts/console/mocks" contractsorm "github.com/goravel/framework/contracts/database/orm" + foundationmocks "github.com/goravel/framework/contracts/foundation/mocks" "github.com/goravel/framework/database" - configmocks "github.com/goravel/framework/mocks/config" - consolemocks "github.com/goravel/framework/mocks/console" - gormmocks "github.com/goravel/framework/mocks/database/gorm" - foundationmocks "github.com/goravel/framework/mocks/foundation" + gormmocks "github.com/goravel/framework/database/gorm/mocks" ) func TestNewDatabase(t *testing.T) { diff --git a/testing/docker/docker.go b/testing/docker/docker.go index fe3560f65..149b93c46 100644 --- a/testing/docker/docker.go +++ b/testing/docker/docker.go @@ -3,7 +3,7 @@ package docker import ( "github.com/goravel/framework/contracts/foundation" "github.com/goravel/framework/contracts/testing" - "github.com/goravel/framework/database" + "github.com/goravel/framework/database/gorm" ) type Docker struct { @@ -18,8 +18,8 @@ func NewDocker(app foundation.Application) *Docker { func (receiver *Docker) Database(connection ...string) (testing.Database, error) { if len(connection) == 0 { - return NewDatabase(receiver.app, "", database.NewInitializeImpl()) + return NewDatabase(receiver.app, "", gorm.NewInitializeImpl()) } else { - return NewDatabase(receiver.app, connection[0], database.NewInitializeImpl()) + return NewDatabase(receiver.app, connection[0], gorm.NewInitializeImpl()) } } diff --git a/testing/docker/docker_test.go b/testing/docker/docker_test.go index 2df910250..f3301f8ee 100644 --- a/testing/docker/docker_test.go +++ b/testing/docker/docker_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/suite" - configmocks "github.com/goravel/framework/mocks/config" - foundationmocks "github.com/goravel/framework/mocks/foundation" + configmocks "github.com/goravel/framework/contracts/config/mocks" + foundationmocks "github.com/goravel/framework/contracts/foundation/mocks" ) type DockerTestSuite struct { diff --git a/testing/docker/mysql_test.go b/testing/docker/mysql_test.go index 0b9c710a8..a5e019237 100644 --- a/testing/docker/mysql_test.go +++ b/testing/docker/mysql_test.go @@ -6,8 +6,8 @@ import ( "github.com/ory/dockertest/v3" "github.com/stretchr/testify/suite" + configmocks "github.com/goravel/framework/contracts/config/mocks" "github.com/goravel/framework/contracts/database/orm" - configmocks "github.com/goravel/framework/mocks/config" ) type MysqlTestSuite struct { diff --git a/testing/docker/postgresql_test.go b/testing/docker/postgresql_test.go index 99dadb21a..95bcee3fb 100644 --- a/testing/docker/postgresql_test.go +++ b/testing/docker/postgresql_test.go @@ -6,8 +6,8 @@ import ( "github.com/ory/dockertest/v3" "github.com/stretchr/testify/suite" + configmocks "github.com/goravel/framework/contracts/config/mocks" "github.com/goravel/framework/contracts/database/orm" - configmocks "github.com/goravel/framework/mocks/config" ) type PostgresqlTestSuite struct { diff --git a/testing/docker/sqlite_test.go b/testing/docker/sqlite_test.go index 5bdd8919e..6510d165b 100644 --- a/testing/docker/sqlite_test.go +++ b/testing/docker/sqlite_test.go @@ -6,8 +6,8 @@ import ( "github.com/ory/dockertest/v3" "github.com/stretchr/testify/suite" + configmocks "github.com/goravel/framework/contracts/config/mocks" "github.com/goravel/framework/contracts/database/orm" - configmocks "github.com/goravel/framework/mocks/config" ) type SqliteTestSuite struct { diff --git a/testing/docker/sqlserver_test.go b/testing/docker/sqlserver_test.go index dd857cdfc..d3c5ae768 100644 --- a/testing/docker/sqlserver_test.go +++ b/testing/docker/sqlserver_test.go @@ -6,8 +6,8 @@ import ( "github.com/ory/dockertest/v3" "github.com/stretchr/testify/suite" + configmocks "github.com/goravel/framework/contracts/config/mocks" "github.com/goravel/framework/contracts/database/orm" - configmocks "github.com/goravel/framework/mocks/config" ) type SqlserverTestSuite struct { diff --git a/testing/mock/mock.go b/testing/mock/mock.go index 6dee7e4da..3a8fdbfa9 100644 --- a/testing/mock/mock.go +++ b/testing/mock/mock.go @@ -1,24 +1,24 @@ package mock import ( + accessmocks "github.com/goravel/framework/contracts/auth/access/mocks" + authmocks "github.com/goravel/framework/contracts/auth/mocks" + cachemocks "github.com/goravel/framework/contracts/cache/mocks" + configmocks "github.com/goravel/framework/contracts/config/mocks" + consolemocks "github.com/goravel/framework/contracts/console/mocks" + cryptmocks "github.com/goravel/framework/contracts/crypt/mocks" + ormmocks "github.com/goravel/framework/contracts/database/orm/mocks" + seedermocks "github.com/goravel/framework/contracts/database/seeder/mocks" + eventmocks "github.com/goravel/framework/contracts/event/mocks" + filesystemmocks "github.com/goravel/framework/contracts/filesystem/mocks" + foundationmocks "github.com/goravel/framework/contracts/foundation/mocks" + grpcmocks "github.com/goravel/framework/contracts/grpc/mocks" + hashmocks "github.com/goravel/framework/contracts/hash/mocks" + httpmocks "github.com/goravel/framework/contracts/http/mocks" + mailmocks "github.com/goravel/framework/contracts/mail/mocks" + queuemocks "github.com/goravel/framework/contracts/queue/mocks" + validatemocks "github.com/goravel/framework/contracts/validation/mocks" "github.com/goravel/framework/foundation" - authmocks "github.com/goravel/framework/mocks/auth" - accessmocks "github.com/goravel/framework/mocks/auth/access" - cachemocks "github.com/goravel/framework/mocks/cache" - configmocks "github.com/goravel/framework/mocks/config" - consolemocks "github.com/goravel/framework/mocks/console" - cryptmocks "github.com/goravel/framework/mocks/crypt" - ormmocks "github.com/goravel/framework/mocks/database/orm" - seedermocks "github.com/goravel/framework/mocks/database/seeder" - eventmocks "github.com/goravel/framework/mocks/event" - filesystemmocks "github.com/goravel/framework/mocks/filesystem" - foundationmocks "github.com/goravel/framework/mocks/foundation" - grpcmocks "github.com/goravel/framework/mocks/grpc" - hashmocks "github.com/goravel/framework/mocks/hash" - httpmocks "github.com/goravel/framework/mocks/http" - mailmocks "github.com/goravel/framework/mocks/mail" - queuemocks "github.com/goravel/framework/mocks/queue" - validatemocks "github.com/goravel/framework/mocks/validation" ) var app *foundationmocks.Application diff --git a/testing/test_case_test.go b/testing/test_case_test.go index b115edff8..add09d75a 100644 --- a/testing/test_case_test.go +++ b/testing/test_case_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/suite" - consolemocks "github.com/goravel/framework/mocks/console" + consolemocks "github.com/goravel/framework/contracts/console/mocks" ) type TestCaseSuite struct { diff --git a/validation/console/rule_make_command_test.go b/validation/console/rule_make_command_test.go index f7d32b17d..d32a27749 100644 --- a/validation/console/rule_make_command_test.go +++ b/validation/console/rule_make_command_test.go @@ -3,7 +3,7 @@ package console import ( "testing" - consolemocks "github.com/goravel/framework/mocks/console" + consolemocks "github.com/goravel/framework/contracts/console/mocks" "github.com/goravel/framework/support/file" "github.com/stretchr/testify/assert"