From 487428034b474851fc2bc5b956ee85349cbe0fb3 Mon Sep 17 00:00:00 2001 From: Injun Song Date: Thu, 23 Nov 2023 14:34:10 +0900 Subject: [PATCH] build(deps): use go.uber.org/mock/mockgen instead of github.com/golang/mock/mockgen The `github.com/golang/mock/mockgen` is deprecated now. So this PR changes it to `go.uber.org/mock/mockgen`. See: https://github.com/golang/go/issues/61017 --- Makefile | 2 +- go.mod | 2 +- go.sum | 11 +- internal/admin/admin_test.go | 2 +- internal/admin/id_generator_test.go | 2 +- internal/admin/mrmanager/manager_mock.go | 36 +-- internal/admin/replica_selector_mock.go | 10 +- internal/admin/replica_selector_test.go | 2 +- internal/admin/snmanager/manager_mock.go | 34 +-- internal/admin/snmanager/manager_test.go | 2 +- internal/admin/snwatcher/snwatcher_mock.go | 12 +- internal/admin/snwatcher/snwatcher_test.go | 2 +- internal/admin/stats/repository_mock.go | 18 +- internal/admin/stats/repository_test.go | 2 +- internal/admin/testing.go | 2 +- internal/metarepos/reportcommit_test.go | 2 +- internal/reportcommitter/client_mock.go | 12 +- .../storagenode/client/log_client_test.go | 2 +- .../client/management_client_mock.go | 22 +- .../client/management_client_test.go | 2 +- internal/storagenode/client/manager_test.go | 2 +- .../executorsmap/executors_map_test.go | 2 +- .../logstream/replicate_client_test.go | 2 +- .../logstream/replicate_clients_test.go | 2 +- internal/storagenode/testing.go | 2 +- internal/varlogctl/controller_test.go | 2 +- pkg/mrc/metadata_repository_client_mock.go | 28 ++- pkg/mrc/metadata_repository_client_test.go | 4 +- ...adata_repository_management_client_mock.go | 14 +- ...adata_repository_management_client_test.go | 4 +- pkg/mrc/mrconnector/mrc_proxy_test.go | 2 +- pkg/varlog/admin_mock.go | 170 +++++++------- pkg/varlog/admin_test.go | 2 +- pkg/varlog/log_mock.go | 44 ++-- pkg/varlog/log_stream_appender_mock.go | 10 +- pkg/varlog/metadata_refresher_mock.go | 10 +- pkg/varlog/replicas_retriever_mock.go | 18 +- proto/admpb/admin_mock.go | 216 +++++++++--------- proto/mrpb/mock/mrpb_mock.go | 112 ++++----- proto/snpb/mock/snpb_mock.go | 212 ++++++++--------- tools/tools.go | 2 +- .../golang => go.uber.org}/mock/AUTHORS | 0 .../golang => go.uber.org}/mock/CONTRIBUTORS | 0 .../golang => go.uber.org}/mock/LICENSE | 0 .../mock/gomock/call.go | 127 +++++++--- .../mock/gomock/callset.go | 59 ++++- .../mock/gomock/controller.go | 136 +++++------ vendor/go.uber.org/mock/gomock/doc.go | 60 +++++ .../mock/gomock/matchers.go | 97 +++++--- .../mock/mockgen/model/model.go | 70 ++++-- vendor/modules.txt | 8 +- 51 files changed, 938 insertions(+), 658 deletions(-) rename vendor/{github.com/golang => go.uber.org}/mock/AUTHORS (100%) rename vendor/{github.com/golang => go.uber.org}/mock/CONTRIBUTORS (100%) rename vendor/{github.com/golang => go.uber.org}/mock/LICENSE (100%) rename vendor/{github.com/golang => go.uber.org}/mock/gomock/call.go (78%) rename vendor/{github.com/golang => go.uber.org}/mock/gomock/callset.go (70%) rename vendor/{github.com/golang => go.uber.org}/mock/gomock/controller.go (67%) create mode 100644 vendor/go.uber.org/mock/gomock/doc.go rename vendor/{github.com/golang => go.uber.org}/mock/gomock/matchers.go (76%) rename vendor/{github.com/golang => go.uber.org}/mock/mockgen/model/model.go (87%) diff --git a/Makefile b/Makefile index 6bfba087f..8337aef25 100644 --- a/Makefile +++ b/Makefile @@ -124,7 +124,7 @@ generate-check: tools: $(GO) install golang.org/x/tools/cmd/goimports@latest $(GO) install golang.org/x/lint/golint@latest - $(GO) install github.com/golang/mock/mockgen@v1.6.0 + $(GO) install go.uber.org/mock/mockgen@v0.3.0 fmt: @echo goimports diff --git a/go.mod b/go.mod index 5240dd072..826241d8a 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,6 @@ require ( github.com/docker/go-units v0.5.0 github.com/gogo/protobuf v1.3.2 github.com/gogo/status v1.1.1 - github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.3 github.com/lib/pq v1.10.9 github.com/pkg/errors v0.9.1 @@ -28,6 +27,7 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.21.0 go.uber.org/automaxprocs v1.5.3 go.uber.org/goleak v1.3.0 + go.uber.org/mock v0.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df diff --git a/go.sum b/go.sum index 58dbf1e27..c988ca12c 100644 --- a/go.sum +++ b/go.sum @@ -140,8 +140,6 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -349,7 +347,6 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= @@ -384,6 +381,8 @@ go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= +go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= @@ -429,7 +428,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/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.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= @@ -464,7 +462,6 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= @@ -487,7 +484,6 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= @@ -527,9 +523,7 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -601,7 +595,6 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= diff --git a/internal/admin/admin_test.go b/internal/admin/admin_test.go index 438de5df9..c838650e8 100644 --- a/internal/admin/admin_test.go +++ b/internal/admin/admin_test.go @@ -10,10 +10,10 @@ import ( "time" "github.com/gogo/protobuf/proto" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/goleak" + "go.uber.org/mock/gomock" "github.com/kakao/varlog/internal/admin" "github.com/kakao/varlog/internal/admin/mrmanager" diff --git a/internal/admin/id_generator_test.go b/internal/admin/id_generator_test.go index 64f8eed1b..caef221be 100644 --- a/internal/admin/id_generator_test.go +++ b/internal/admin/id_generator_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/golang/mock/gomock" "github.com/pkg/errors" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "github.com/kakao/varlog/internal/admin/mrmanager" "github.com/kakao/varlog/pkg/types" diff --git a/internal/admin/mrmanager/manager_mock.go b/internal/admin/mrmanager/manager_mock.go index 93f965670..f65647c5b 100644 --- a/internal/admin/mrmanager/manager_mock.go +++ b/internal/admin/mrmanager/manager_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kakao/varlog/internal/admin/mrmanager (interfaces: ClusterMetadataView,MetadataRepositoryManager) - +// +// Generated by this command: +// +// mockgen -build_flags -mod=vendor -self_package github.com/kakao/varlog/internal/admin/mrmanager -package mrmanager -destination manager_mock.go . ClusterMetadataView,MetadataRepositoryManager +// // Package mrmanager is a generated GoMock package. package mrmanager @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" types "github.com/kakao/varlog/pkg/types" mrpb "github.com/kakao/varlog/proto/mrpb" @@ -48,7 +52,7 @@ func (m *MockClusterMetadataView) ClusterMetadata(arg0 context.Context) (*varlog } // ClusterMetadata indicates an expected call of ClusterMetadata. -func (mr *MockClusterMetadataViewMockRecorder) ClusterMetadata(arg0 interface{}) *gomock.Call { +func (mr *MockClusterMetadataViewMockRecorder) ClusterMetadata(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClusterMetadata", reflect.TypeOf((*MockClusterMetadataView)(nil).ClusterMetadata), arg0) } @@ -63,7 +67,7 @@ func (m *MockClusterMetadataView) StorageNode(arg0 context.Context, arg1 types.S } // StorageNode indicates an expected call of StorageNode. -func (mr *MockClusterMetadataViewMockRecorder) StorageNode(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterMetadataViewMockRecorder) StorageNode(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StorageNode", reflect.TypeOf((*MockClusterMetadataView)(nil).StorageNode), arg0, arg1) } @@ -100,7 +104,7 @@ func (m *MockMetadataRepositoryManager) AddPeer(arg0 context.Context, arg1 types } // AddPeer indicates an expected call of AddPeer. -func (mr *MockMetadataRepositoryManagerMockRecorder) AddPeer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryManagerMockRecorder) AddPeer(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddPeer", reflect.TypeOf((*MockMetadataRepositoryManager)(nil).AddPeer), arg0, arg1, arg2, arg3) } @@ -143,7 +147,7 @@ func (m *MockMetadataRepositoryManager) GetClusterInfo(arg0 context.Context) (*m } // GetClusterInfo indicates an expected call of GetClusterInfo. -func (mr *MockMetadataRepositoryManagerMockRecorder) GetClusterInfo(arg0 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryManagerMockRecorder) GetClusterInfo(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClusterInfo", reflect.TypeOf((*MockMetadataRepositoryManager)(nil).GetClusterInfo), arg0) } @@ -171,7 +175,7 @@ func (m *MockMetadataRepositoryManager) RegisterLogStream(arg0 context.Context, } // RegisterLogStream indicates an expected call of RegisterLogStream. -func (mr *MockMetadataRepositoryManagerMockRecorder) RegisterLogStream(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryManagerMockRecorder) RegisterLogStream(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLogStream", reflect.TypeOf((*MockMetadataRepositoryManager)(nil).RegisterLogStream), arg0, arg1) } @@ -185,7 +189,7 @@ func (m *MockMetadataRepositoryManager) RegisterStorageNode(arg0 context.Context } // RegisterStorageNode indicates an expected call of RegisterStorageNode. -func (mr *MockMetadataRepositoryManagerMockRecorder) RegisterStorageNode(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryManagerMockRecorder) RegisterStorageNode(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterStorageNode", reflect.TypeOf((*MockMetadataRepositoryManager)(nil).RegisterStorageNode), arg0, arg1) } @@ -199,7 +203,7 @@ func (m *MockMetadataRepositoryManager) RegisterTopic(arg0 context.Context, arg1 } // RegisterTopic indicates an expected call of RegisterTopic. -func (mr *MockMetadataRepositoryManagerMockRecorder) RegisterTopic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryManagerMockRecorder) RegisterTopic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterTopic", reflect.TypeOf((*MockMetadataRepositoryManager)(nil).RegisterTopic), arg0, arg1) } @@ -213,7 +217,7 @@ func (m *MockMetadataRepositoryManager) RemovePeer(arg0 context.Context, arg1 ty } // RemovePeer indicates an expected call of RemovePeer. -func (mr *MockMetadataRepositoryManagerMockRecorder) RemovePeer(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryManagerMockRecorder) RemovePeer(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemovePeer", reflect.TypeOf((*MockMetadataRepositoryManager)(nil).RemovePeer), arg0, arg1) } @@ -228,7 +232,7 @@ func (m *MockMetadataRepositoryManager) Seal(arg0 context.Context, arg1 types.Lo } // Seal indicates an expected call of Seal. -func (mr *MockMetadataRepositoryManagerMockRecorder) Seal(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryManagerMockRecorder) Seal(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Seal", reflect.TypeOf((*MockMetadataRepositoryManager)(nil).Seal), arg0, arg1) } @@ -242,7 +246,7 @@ func (m *MockMetadataRepositoryManager) UnregisterLogStream(arg0 context.Context } // UnregisterLogStream indicates an expected call of UnregisterLogStream. -func (mr *MockMetadataRepositoryManagerMockRecorder) UnregisterLogStream(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryManagerMockRecorder) UnregisterLogStream(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterLogStream", reflect.TypeOf((*MockMetadataRepositoryManager)(nil).UnregisterLogStream), arg0, arg1) } @@ -256,7 +260,7 @@ func (m *MockMetadataRepositoryManager) UnregisterStorageNode(arg0 context.Conte } // UnregisterStorageNode indicates an expected call of UnregisterStorageNode. -func (mr *MockMetadataRepositoryManagerMockRecorder) UnregisterStorageNode(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryManagerMockRecorder) UnregisterStorageNode(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterStorageNode", reflect.TypeOf((*MockMetadataRepositoryManager)(nil).UnregisterStorageNode), arg0, arg1) } @@ -270,7 +274,7 @@ func (m *MockMetadataRepositoryManager) UnregisterTopic(arg0 context.Context, ar } // UnregisterTopic indicates an expected call of UnregisterTopic. -func (mr *MockMetadataRepositoryManagerMockRecorder) UnregisterTopic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryManagerMockRecorder) UnregisterTopic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterTopic", reflect.TypeOf((*MockMetadataRepositoryManager)(nil).UnregisterTopic), arg0, arg1) } @@ -284,7 +288,7 @@ func (m *MockMetadataRepositoryManager) Unseal(arg0 context.Context, arg1 types. } // Unseal indicates an expected call of Unseal. -func (mr *MockMetadataRepositoryManagerMockRecorder) Unseal(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryManagerMockRecorder) Unseal(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unseal", reflect.TypeOf((*MockMetadataRepositoryManager)(nil).Unseal), arg0, arg1) } @@ -298,7 +302,7 @@ func (m *MockMetadataRepositoryManager) UpdateLogStream(arg0 context.Context, ar } // UpdateLogStream indicates an expected call of UpdateLogStream. -func (mr *MockMetadataRepositoryManagerMockRecorder) UpdateLogStream(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryManagerMockRecorder) UpdateLogStream(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateLogStream", reflect.TypeOf((*MockMetadataRepositoryManager)(nil).UpdateLogStream), arg0, arg1) } diff --git a/internal/admin/replica_selector_mock.go b/internal/admin/replica_selector_mock.go index cba3acc3e..ef32d27cb 100644 --- a/internal/admin/replica_selector_mock.go +++ b/internal/admin/replica_selector_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kakao/varlog/internal/admin (interfaces: ReplicaSelector) - +// +// Generated by this command: +// +// mockgen -build_flags -mod=vendor -self_package github.com/kakao/varlog/internal/admin -package admin -destination replica_selector_mock.go . ReplicaSelector +// // Package admin is a generated GoMock package. package admin @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" varlogpb "github.com/kakao/varlog/proto/varlogpb" ) @@ -60,7 +64,7 @@ func (m *MockReplicaSelector) Select(arg0 context.Context) ([]*varlogpb.ReplicaD } // Select indicates an expected call of Select. -func (mr *MockReplicaSelectorMockRecorder) Select(arg0 interface{}) *gomock.Call { +func (mr *MockReplicaSelectorMockRecorder) Select(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Select", reflect.TypeOf((*MockReplicaSelector)(nil).Select), arg0) } diff --git a/internal/admin/replica_selector_test.go b/internal/admin/replica_selector_test.go index 15239d309..987e63fb1 100644 --- a/internal/admin/replica_selector_test.go +++ b/internal/admin/replica_selector_test.go @@ -5,8 +5,8 @@ import ( "sort" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "golang.org/x/exp/maps" "github.com/kakao/varlog/internal/admin/mrmanager" diff --git a/internal/admin/snmanager/manager_mock.go b/internal/admin/snmanager/manager_mock.go index 58c7c7450..61d9016a9 100644 --- a/internal/admin/snmanager/manager_mock.go +++ b/internal/admin/snmanager/manager_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kakao/varlog/internal/admin/snmanager (interfaces: StorageNodeManager) - +// +// Generated by this command: +// +// mockgen -build_flags -mod=vendor -self_package github.com/kakao/varlog/internal/admin/snmanager -package snmanager -destination manager_mock.go . StorageNodeManager +// // Package snmanager is a generated GoMock package. package snmanager @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" types "github.com/kakao/varlog/pkg/types" admpb "github.com/kakao/varlog/proto/admpb" @@ -49,7 +53,7 @@ func (m *MockStorageNodeManager) AddLogStream(arg0 context.Context, arg1 *varlog } // AddLogStream indicates an expected call of AddLogStream. -func (mr *MockStorageNodeManagerMockRecorder) AddLogStream(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagerMockRecorder) AddLogStream(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddLogStream", reflect.TypeOf((*MockStorageNodeManager)(nil).AddLogStream), arg0, arg1) } @@ -64,7 +68,7 @@ func (m *MockStorageNodeManager) AddLogStreamReplica(arg0 context.Context, arg1 } // AddLogStreamReplica indicates an expected call of AddLogStreamReplica. -func (mr *MockStorageNodeManagerMockRecorder) AddLogStreamReplica(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagerMockRecorder) AddLogStreamReplica(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddLogStreamReplica", reflect.TypeOf((*MockStorageNodeManager)(nil).AddLogStreamReplica), arg0, arg1, arg2, arg3, arg4) } @@ -76,7 +80,7 @@ func (m *MockStorageNodeManager) AddStorageNode(arg0 context.Context, arg1 types } // AddStorageNode indicates an expected call of AddStorageNode. -func (mr *MockStorageNodeManagerMockRecorder) AddStorageNode(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagerMockRecorder) AddStorageNode(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddStorageNode", reflect.TypeOf((*MockStorageNodeManager)(nil).AddStorageNode), arg0, arg1, arg2) } @@ -104,7 +108,7 @@ func (m *MockStorageNodeManager) Contains(arg0 types.StorageNodeID) bool { } // Contains indicates an expected call of Contains. -func (mr *MockStorageNodeManagerMockRecorder) Contains(arg0 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagerMockRecorder) Contains(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Contains", reflect.TypeOf((*MockStorageNodeManager)(nil).Contains), arg0) } @@ -118,7 +122,7 @@ func (m *MockStorageNodeManager) ContainsAddress(arg0 string) bool { } // ContainsAddress indicates an expected call of ContainsAddress. -func (mr *MockStorageNodeManagerMockRecorder) ContainsAddress(arg0 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagerMockRecorder) ContainsAddress(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainsAddress", reflect.TypeOf((*MockStorageNodeManager)(nil).ContainsAddress), arg0) } @@ -133,7 +137,7 @@ func (m *MockStorageNodeManager) GetMetadata(arg0 context.Context, arg1 types.St } // GetMetadata indicates an expected call of GetMetadata. -func (mr *MockStorageNodeManagerMockRecorder) GetMetadata(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagerMockRecorder) GetMetadata(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetadata", reflect.TypeOf((*MockStorageNodeManager)(nil).GetMetadata), arg0, arg1) } @@ -148,7 +152,7 @@ func (m *MockStorageNodeManager) GetMetadataByAddress(arg0 context.Context, arg1 } // GetMetadataByAddress indicates an expected call of GetMetadataByAddress. -func (mr *MockStorageNodeManagerMockRecorder) GetMetadataByAddress(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagerMockRecorder) GetMetadataByAddress(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetadataByAddress", reflect.TypeOf((*MockStorageNodeManager)(nil).GetMetadataByAddress), arg0, arg1, arg2) } @@ -162,7 +166,7 @@ func (m *MockStorageNodeManager) RemoveLogStreamReplica(arg0 context.Context, ar } // RemoveLogStreamReplica indicates an expected call of RemoveLogStreamReplica. -func (mr *MockStorageNodeManagerMockRecorder) RemoveLogStreamReplica(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagerMockRecorder) RemoveLogStreamReplica(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveLogStreamReplica", reflect.TypeOf((*MockStorageNodeManager)(nil).RemoveLogStreamReplica), arg0, arg1, arg2, arg3) } @@ -174,7 +178,7 @@ func (m *MockStorageNodeManager) RemoveStorageNode(arg0 types.StorageNodeID) { } // RemoveStorageNode indicates an expected call of RemoveStorageNode. -func (mr *MockStorageNodeManagerMockRecorder) RemoveStorageNode(arg0 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagerMockRecorder) RemoveStorageNode(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveStorageNode", reflect.TypeOf((*MockStorageNodeManager)(nil).RemoveStorageNode), arg0) } @@ -189,7 +193,7 @@ func (m *MockStorageNodeManager) Seal(arg0 context.Context, arg1 types.TopicID, } // Seal indicates an expected call of Seal. -func (mr *MockStorageNodeManagerMockRecorder) Seal(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagerMockRecorder) Seal(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Seal", reflect.TypeOf((*MockStorageNodeManager)(nil).Seal), arg0, arg1, arg2, arg3) } @@ -204,7 +208,7 @@ func (m *MockStorageNodeManager) Sync(arg0 context.Context, arg1 types.TopicID, } // Sync indicates an expected call of Sync. -func (mr *MockStorageNodeManagerMockRecorder) Sync(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagerMockRecorder) Sync(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sync", reflect.TypeOf((*MockStorageNodeManager)(nil).Sync), arg0, arg1, arg2, arg3, arg4, arg5) } @@ -219,7 +223,7 @@ func (m *MockStorageNodeManager) Trim(arg0 context.Context, arg1 types.TopicID, } // Trim indicates an expected call of Trim. -func (mr *MockStorageNodeManagerMockRecorder) Trim(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagerMockRecorder) Trim(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trim", reflect.TypeOf((*MockStorageNodeManager)(nil).Trim), arg0, arg1, arg2) } @@ -233,7 +237,7 @@ func (m *MockStorageNodeManager) Unseal(arg0 context.Context, arg1 types.TopicID } // Unseal indicates an expected call of Unseal. -func (mr *MockStorageNodeManagerMockRecorder) Unseal(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagerMockRecorder) Unseal(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unseal", reflect.TypeOf((*MockStorageNodeManager)(nil).Unseal), arg0, arg1, arg2) } diff --git a/internal/admin/snmanager/manager_test.go b/internal/admin/snmanager/manager_test.go index f8e5936b0..36654f2b7 100644 --- a/internal/admin/snmanager/manager_test.go +++ b/internal/admin/snmanager/manager_test.go @@ -6,8 +6,8 @@ import ( "testing" pbtypes "github.com/gogo/protobuf/types" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "github.com/kakao/varlog/internal/admin/mrmanager" "github.com/kakao/varlog/internal/storagenode" diff --git a/internal/admin/snwatcher/snwatcher_mock.go b/internal/admin/snwatcher/snwatcher_mock.go index 4de35f125..6089b3dfa 100644 --- a/internal/admin/snwatcher/snwatcher_mock.go +++ b/internal/admin/snwatcher/snwatcher_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kakao/varlog/internal/admin/snwatcher (interfaces: EventHandler) - +// +// Generated by this command: +// +// mockgen -build_flags -mod=vendor -self_package github.com/kakao/varlog/internal/admin/snwatcher -package snwatcher -destination snwatcher_mock.go . EventHandler +// // Package snwatcher is a generated GoMock package. package snwatcher @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" types "github.com/kakao/varlog/pkg/types" snpb "github.com/kakao/varlog/proto/snpb" @@ -44,7 +48,7 @@ func (m *MockEventHandler) HandleHeartbeatTimeout(arg0 context.Context, arg1 typ } // HandleHeartbeatTimeout indicates an expected call of HandleHeartbeatTimeout. -func (mr *MockEventHandlerMockRecorder) HandleHeartbeatTimeout(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockEventHandlerMockRecorder) HandleHeartbeatTimeout(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleHeartbeatTimeout", reflect.TypeOf((*MockEventHandler)(nil).HandleHeartbeatTimeout), arg0, arg1) } @@ -56,7 +60,7 @@ func (m *MockEventHandler) HandleReport(arg0 context.Context, arg1 *snpb.Storage } // HandleReport indicates an expected call of HandleReport. -func (mr *MockEventHandlerMockRecorder) HandleReport(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockEventHandlerMockRecorder) HandleReport(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleReport", reflect.TypeOf((*MockEventHandler)(nil).HandleReport), arg0, arg1) } diff --git a/internal/admin/snwatcher/snwatcher_test.go b/internal/admin/snwatcher/snwatcher_test.go index 59d33347c..ac6b50296 100644 --- a/internal/admin/snwatcher/snwatcher_test.go +++ b/internal/admin/snwatcher/snwatcher_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "go.uber.org/goleak" + "go.uber.org/mock/gomock" "github.com/kakao/varlog/internal/admin/mrmanager" "github.com/kakao/varlog/internal/admin/snmanager" diff --git a/internal/admin/stats/repository_mock.go b/internal/admin/stats/repository_mock.go index 473febf59..600c566ff 100644 --- a/internal/admin/stats/repository_mock.go +++ b/internal/admin/stats/repository_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kakao/varlog/internal/admin/stats (interfaces: Repository) - +// +// Generated by this command: +// +// mockgen -build_flags -mod=vendor -self_package github.com/kakao/varlog/internal/admin/stats -package stats -destination repository_mock.go . Repository +// // Package stats is a generated GoMock package. package stats @@ -9,7 +13,7 @@ import ( reflect "reflect" time "time" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" types "github.com/kakao/varlog/pkg/types" admpb "github.com/kakao/varlog/proto/admpb" @@ -49,7 +53,7 @@ func (m *MockRepository) GetLogStream(arg0 types.LogStreamID) *LogStreamStat { } // GetLogStream indicates an expected call of GetLogStream. -func (mr *MockRepositoryMockRecorder) GetLogStream(arg0 interface{}) *gomock.Call { +func (mr *MockRepositoryMockRecorder) GetLogStream(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLogStream", reflect.TypeOf((*MockRepository)(nil).GetLogStream), arg0) } @@ -64,7 +68,7 @@ func (m *MockRepository) GetStorageNode(arg0 types.StorageNodeID) (*admpb.Storag } // GetStorageNode indicates an expected call of GetStorageNode. -func (mr *MockRepositoryMockRecorder) GetStorageNode(arg0 interface{}) *gomock.Call { +func (mr *MockRepositoryMockRecorder) GetStorageNode(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageNode", reflect.TypeOf((*MockRepository)(nil).GetStorageNode), arg0) } @@ -90,7 +94,7 @@ func (m *MockRepository) RemoveStorageNode(arg0 types.StorageNodeID) { } // RemoveStorageNode indicates an expected call of RemoveStorageNode. -func (mr *MockRepositoryMockRecorder) RemoveStorageNode(arg0 interface{}) *gomock.Call { +func (mr *MockRepositoryMockRecorder) RemoveStorageNode(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveStorageNode", reflect.TypeOf((*MockRepository)(nil).RemoveStorageNode), arg0) } @@ -102,7 +106,7 @@ func (m *MockRepository) Report(arg0 context.Context, arg1 *snpb.StorageNodeMeta } // Report indicates an expected call of Report. -func (mr *MockRepositoryMockRecorder) Report(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockRepositoryMockRecorder) Report(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Report", reflect.TypeOf((*MockRepository)(nil).Report), arg0, arg1, arg2) } @@ -114,7 +118,7 @@ func (m *MockRepository) SetLogStreamStatus(arg0 types.LogStreamID, arg1 varlogp } // SetLogStreamStatus indicates an expected call of SetLogStreamStatus. -func (mr *MockRepositoryMockRecorder) SetLogStreamStatus(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockRepositoryMockRecorder) SetLogStreamStatus(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLogStreamStatus", reflect.TypeOf((*MockRepository)(nil).SetLogStreamStatus), arg0, arg1) } diff --git a/internal/admin/stats/repository_test.go b/internal/admin/stats/repository_test.go index e35a8d4a4..1339547ac 100644 --- a/internal/admin/stats/repository_test.go +++ b/internal/admin/stats/repository_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "github.com/kakao/varlog/internal/admin/mrmanager" "github.com/kakao/varlog/internal/admin/stats" diff --git a/internal/admin/testing.go b/internal/admin/testing.go index 1856b619d..bc6ee39b5 100644 --- a/internal/admin/testing.go +++ b/internal/admin/testing.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "google.golang.org/grpc" "github.com/kakao/varlog/pkg/rpc" diff --git a/internal/metarepos/reportcommit_test.go b/internal/metarepos/reportcommit_test.go index b9c1b42cc..3103919d6 100644 --- a/internal/metarepos/reportcommit_test.go +++ b/internal/metarepos/reportcommit_test.go @@ -10,9 +10,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "go.uber.org/zap" "go.uber.org/zap/zaptest" diff --git a/internal/reportcommitter/client_mock.go b/internal/reportcommitter/client_mock.go index 74a286c39..fd8a269b5 100644 --- a/internal/reportcommitter/client_mock.go +++ b/internal/reportcommitter/client_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kakao/varlog/internal/reportcommitter (interfaces: Client) - +// +// Generated by this command: +// +// mockgen -build_flags -mod=vendor -self_package github.com/kakao/varlog/internal/reportcommitter -package reportcommitter -destination client_mock.go . Client +// // Package reportcommitter is a generated GoMock package. package reportcommitter import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" snpb "github.com/kakao/varlog/proto/snpb" ) @@ -58,7 +62,7 @@ func (m *MockClient) Commit(arg0 snpb.CommitRequest) error { } // Commit indicates an expected call of Commit. -func (mr *MockClientMockRecorder) Commit(arg0 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) Commit(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Commit", reflect.TypeOf((*MockClient)(nil).Commit), arg0) } @@ -72,7 +76,7 @@ func (m *MockClient) CommitBatch(arg0 snpb.CommitBatchRequest) error { } // CommitBatch indicates an expected call of CommitBatch. -func (mr *MockClientMockRecorder) CommitBatch(arg0 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CommitBatch(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitBatch", reflect.TypeOf((*MockClient)(nil).CommitBatch), arg0) } diff --git a/internal/storagenode/client/log_client_test.go b/internal/storagenode/client/log_client_test.go index 4143640ad..a4d30e440 100644 --- a/internal/storagenode/client/log_client_test.go +++ b/internal/storagenode/client/log_client_test.go @@ -9,8 +9,8 @@ import ( "testing" pbtypes "github.com/gogo/protobuf/types" - "github.com/golang/mock/gomock" . "github.com/smartystreets/goconvey/convey" + "go.uber.org/mock/gomock" "google.golang.org/grpc" "github.com/kakao/varlog/pkg/types" diff --git a/internal/storagenode/client/management_client_mock.go b/internal/storagenode/client/management_client_mock.go index 0d80b0c95..67983f4c3 100644 --- a/internal/storagenode/client/management_client_mock.go +++ b/internal/storagenode/client/management_client_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kakao/varlog/internal/storagenode/client (interfaces: StorageNodeManagementClient) - +// +// Generated by this command: +// +// mockgen -build_flags -mod=vendor -self_package github.com/kakao/varlog/internal/storagenode/client -package client -destination management_client_mock.go . StorageNodeManagementClient +// // Package client is a generated GoMock package. package client @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" types "github.com/kakao/varlog/pkg/types" snpb "github.com/kakao/varlog/proto/snpb" @@ -48,7 +52,7 @@ func (m *MockStorageNodeManagementClient) AddLogStreamReplica(arg0 context.Conte } // AddLogStreamReplica indicates an expected call of AddLogStreamReplica. -func (mr *MockStorageNodeManagementClientMockRecorder) AddLogStreamReplica(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagementClientMockRecorder) AddLogStreamReplica(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddLogStreamReplica", reflect.TypeOf((*MockStorageNodeManagementClient)(nil).AddLogStreamReplica), arg0, arg1, arg2, arg3) } @@ -77,7 +81,7 @@ func (m *MockStorageNodeManagementClient) GetMetadata(arg0 context.Context) (*sn } // GetMetadata indicates an expected call of GetMetadata. -func (mr *MockStorageNodeManagementClientMockRecorder) GetMetadata(arg0 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagementClientMockRecorder) GetMetadata(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetadata", reflect.TypeOf((*MockStorageNodeManagementClient)(nil).GetMetadata), arg0) } @@ -91,7 +95,7 @@ func (m *MockStorageNodeManagementClient) RemoveLogStream(arg0 context.Context, } // RemoveLogStream indicates an expected call of RemoveLogStream. -func (mr *MockStorageNodeManagementClientMockRecorder) RemoveLogStream(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagementClientMockRecorder) RemoveLogStream(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveLogStream", reflect.TypeOf((*MockStorageNodeManagementClient)(nil).RemoveLogStream), arg0, arg1, arg2) } @@ -107,7 +111,7 @@ func (m *MockStorageNodeManagementClient) Seal(arg0 context.Context, arg1 types. } // Seal indicates an expected call of Seal. -func (mr *MockStorageNodeManagementClientMockRecorder) Seal(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagementClientMockRecorder) Seal(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Seal", reflect.TypeOf((*MockStorageNodeManagementClient)(nil).Seal), arg0, arg1, arg2, arg3) } @@ -122,7 +126,7 @@ func (m *MockStorageNodeManagementClient) Sync(arg0 context.Context, arg1 types. } // Sync indicates an expected call of Sync. -func (mr *MockStorageNodeManagementClientMockRecorder) Sync(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagementClientMockRecorder) Sync(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sync", reflect.TypeOf((*MockStorageNodeManagementClient)(nil).Sync), arg0, arg1, arg2, arg3, arg4, arg5) } @@ -151,7 +155,7 @@ func (m *MockStorageNodeManagementClient) Trim(arg0 context.Context, arg1 types. } // Trim indicates an expected call of Trim. -func (mr *MockStorageNodeManagementClientMockRecorder) Trim(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagementClientMockRecorder) Trim(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trim", reflect.TypeOf((*MockStorageNodeManagementClient)(nil).Trim), arg0, arg1, arg2) } @@ -165,7 +169,7 @@ func (m *MockStorageNodeManagementClient) Unseal(arg0 context.Context, arg1 type } // Unseal indicates an expected call of Unseal. -func (mr *MockStorageNodeManagementClientMockRecorder) Unseal(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockStorageNodeManagementClientMockRecorder) Unseal(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unseal", reflect.TypeOf((*MockStorageNodeManagementClient)(nil).Unseal), arg0, arg1, arg2, arg3) } diff --git a/internal/storagenode/client/management_client_test.go b/internal/storagenode/client/management_client_test.go index 33c161dce..6730af5c4 100644 --- a/internal/storagenode/client/management_client_test.go +++ b/internal/storagenode/client/management_client_test.go @@ -5,9 +5,9 @@ import ( "testing" pbtypes "github.com/gogo/protobuf/types" - "github.com/golang/mock/gomock" . "github.com/smartystreets/goconvey/convey" "go.uber.org/goleak" + "go.uber.org/mock/gomock" "github.com/kakao/varlog/pkg/types" "github.com/kakao/varlog/pkg/verrors" diff --git a/internal/storagenode/client/manager_test.go b/internal/storagenode/client/manager_test.go index 67442742d..af0171b54 100644 --- a/internal/storagenode/client/manager_test.go +++ b/internal/storagenode/client/manager_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "google.golang.org/grpc" "google.golang.org/grpc/backoff" diff --git a/internal/storagenode/executorsmap/executors_map_test.go b/internal/storagenode/executorsmap/executors_map_test.go index e144760b9..6b8702afe 100644 --- a/internal/storagenode/executorsmap/executors_map_test.go +++ b/internal/storagenode/executorsmap/executors_map_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "go.uber.org/goleak" + "go.uber.org/mock/gomock" "github.com/kakao/varlog/internal/storagenode/logstream" "github.com/kakao/varlog/pkg/types" diff --git a/internal/storagenode/logstream/replicate_client_test.go b/internal/storagenode/logstream/replicate_client_test.go index 26c8c974d..f2827cdac 100644 --- a/internal/storagenode/logstream/replicate_client_test.go +++ b/internal/storagenode/logstream/replicate_client_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "go.uber.org/zap" "github.com/kakao/varlog/pkg/rpc" diff --git a/internal/storagenode/logstream/replicate_clients_test.go b/internal/storagenode/logstream/replicate_clients_test.go index 7addfa9f3..1ebfb2bdb 100644 --- a/internal/storagenode/logstream/replicate_clients_test.go +++ b/internal/storagenode/logstream/replicate_clients_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "go.uber.org/zap" "github.com/kakao/varlog/proto/snpb" diff --git a/internal/storagenode/testing.go b/internal/storagenode/testing.go index 3ff2c1961..dd1ade4dc 100644 --- a/internal/storagenode/testing.go +++ b/internal/storagenode/testing.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "google.golang.org/grpc" "github.com/kakao/varlog/internal/storagenode/client" diff --git a/internal/varlogctl/controller_test.go b/internal/varlogctl/controller_test.go index 292f3412b..53c46145d 100644 --- a/internal/varlogctl/controller_test.go +++ b/internal/varlogctl/controller_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "go.uber.org/goleak" + "go.uber.org/mock/gomock" "github.com/kakao/varlog/internal/varlogctl" "github.com/kakao/varlog/internal/varlogctl/logstream" diff --git a/pkg/mrc/metadata_repository_client_mock.go b/pkg/mrc/metadata_repository_client_mock.go index e8248a9c1..11fcd8dbb 100644 --- a/pkg/mrc/metadata_repository_client_mock.go +++ b/pkg/mrc/metadata_repository_client_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kakao/varlog/pkg/mrc (interfaces: MetadataRepositoryClient) - +// +// Generated by this command: +// +// mockgen -build_flags -mod=vendor -self_package github.com/kakao/varlog/pkg/mrc -package mrc -destination metadata_repository_client_mock.go . MetadataRepositoryClient +// // Package mrc is a generated GoMock package. package mrc @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" types "github.com/kakao/varlog/pkg/types" varlogpb "github.com/kakao/varlog/proto/varlogpb" @@ -61,7 +65,7 @@ func (m *MockMetadataRepositoryClient) GetMetadata(arg0 context.Context) (*varlo } // GetMetadata indicates an expected call of GetMetadata. -func (mr *MockMetadataRepositoryClientMockRecorder) GetMetadata(arg0 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryClientMockRecorder) GetMetadata(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetadata", reflect.TypeOf((*MockMetadataRepositoryClient)(nil).GetMetadata), arg0) } @@ -75,7 +79,7 @@ func (m *MockMetadataRepositoryClient) RegisterLogStream(arg0 context.Context, a } // RegisterLogStream indicates an expected call of RegisterLogStream. -func (mr *MockMetadataRepositoryClientMockRecorder) RegisterLogStream(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryClientMockRecorder) RegisterLogStream(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLogStream", reflect.TypeOf((*MockMetadataRepositoryClient)(nil).RegisterLogStream), arg0, arg1) } @@ -89,7 +93,7 @@ func (m *MockMetadataRepositoryClient) RegisterStorageNode(arg0 context.Context, } // RegisterStorageNode indicates an expected call of RegisterStorageNode. -func (mr *MockMetadataRepositoryClientMockRecorder) RegisterStorageNode(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryClientMockRecorder) RegisterStorageNode(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterStorageNode", reflect.TypeOf((*MockMetadataRepositoryClient)(nil).RegisterStorageNode), arg0, arg1) } @@ -103,7 +107,7 @@ func (m *MockMetadataRepositoryClient) RegisterTopic(arg0 context.Context, arg1 } // RegisterTopic indicates an expected call of RegisterTopic. -func (mr *MockMetadataRepositoryClientMockRecorder) RegisterTopic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryClientMockRecorder) RegisterTopic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterTopic", reflect.TypeOf((*MockMetadataRepositoryClient)(nil).RegisterTopic), arg0, arg1) } @@ -118,7 +122,7 @@ func (m *MockMetadataRepositoryClient) Seal(arg0 context.Context, arg1 types.Log } // Seal indicates an expected call of Seal. -func (mr *MockMetadataRepositoryClientMockRecorder) Seal(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryClientMockRecorder) Seal(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Seal", reflect.TypeOf((*MockMetadataRepositoryClient)(nil).Seal), arg0, arg1) } @@ -132,7 +136,7 @@ func (m *MockMetadataRepositoryClient) UnregisterLogStream(arg0 context.Context, } // UnregisterLogStream indicates an expected call of UnregisterLogStream. -func (mr *MockMetadataRepositoryClientMockRecorder) UnregisterLogStream(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryClientMockRecorder) UnregisterLogStream(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterLogStream", reflect.TypeOf((*MockMetadataRepositoryClient)(nil).UnregisterLogStream), arg0, arg1) } @@ -146,7 +150,7 @@ func (m *MockMetadataRepositoryClient) UnregisterStorageNode(arg0 context.Contex } // UnregisterStorageNode indicates an expected call of UnregisterStorageNode. -func (mr *MockMetadataRepositoryClientMockRecorder) UnregisterStorageNode(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryClientMockRecorder) UnregisterStorageNode(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterStorageNode", reflect.TypeOf((*MockMetadataRepositoryClient)(nil).UnregisterStorageNode), arg0, arg1) } @@ -160,7 +164,7 @@ func (m *MockMetadataRepositoryClient) UnregisterTopic(arg0 context.Context, arg } // UnregisterTopic indicates an expected call of UnregisterTopic. -func (mr *MockMetadataRepositoryClientMockRecorder) UnregisterTopic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryClientMockRecorder) UnregisterTopic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterTopic", reflect.TypeOf((*MockMetadataRepositoryClient)(nil).UnregisterTopic), arg0, arg1) } @@ -174,7 +178,7 @@ func (m *MockMetadataRepositoryClient) Unseal(arg0 context.Context, arg1 types.L } // Unseal indicates an expected call of Unseal. -func (mr *MockMetadataRepositoryClientMockRecorder) Unseal(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryClientMockRecorder) Unseal(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unseal", reflect.TypeOf((*MockMetadataRepositoryClient)(nil).Unseal), arg0, arg1) } @@ -188,7 +192,7 @@ func (m *MockMetadataRepositoryClient) UpdateLogStream(arg0 context.Context, arg } // UpdateLogStream indicates an expected call of UpdateLogStream. -func (mr *MockMetadataRepositoryClientMockRecorder) UpdateLogStream(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryClientMockRecorder) UpdateLogStream(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateLogStream", reflect.TypeOf((*MockMetadataRepositoryClient)(nil).UpdateLogStream), arg0, arg1) } diff --git a/pkg/mrc/metadata_repository_client_test.go b/pkg/mrc/metadata_repository_client_test.go index a38152247..2afc5eb16 100644 --- a/pkg/mrc/metadata_repository_client_test.go +++ b/pkg/mrc/metadata_repository_client_test.go @@ -5,11 +5,11 @@ import ( "testing" pbtypes "github.com/gogo/protobuf/types" - "github.com/golang/mock/gomock" - _ "github.com/golang/mock/mockgen/model" assert "github.com/smartystreets/assertions" . "github.com/smartystreets/goconvey/convey" "go.uber.org/goleak" + "go.uber.org/mock/gomock" + _ "go.uber.org/mock/mockgen/model" "github.com/kakao/varlog/pkg/types" "github.com/kakao/varlog/pkg/verrors" diff --git a/pkg/mrc/metadata_repository_management_client_mock.go b/pkg/mrc/metadata_repository_management_client_mock.go index e2b2e3648..52a88237a 100644 --- a/pkg/mrc/metadata_repository_management_client_mock.go +++ b/pkg/mrc/metadata_repository_management_client_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kakao/varlog/pkg/mrc (interfaces: MetadataRepositoryManagementClient) - +// +// Generated by this command: +// +// mockgen -build_flags -mod=vendor -self_package github.com/kakao/varlog/pkg/mrc -package mrc -destination metadata_repository_management_client_mock.go . MetadataRepositoryManagementClient +// // Package mrc is a generated GoMock package. package mrc @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" types "github.com/kakao/varlog/pkg/types" mrpb "github.com/kakao/varlog/proto/mrpb" @@ -46,7 +50,7 @@ func (m *MockMetadataRepositoryManagementClient) AddPeer(arg0 context.Context, a } // AddPeer indicates an expected call of AddPeer. -func (mr *MockMetadataRepositoryManagementClientMockRecorder) AddPeer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryManagementClientMockRecorder) AddPeer(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddPeer", reflect.TypeOf((*MockMetadataRepositoryManagementClient)(nil).AddPeer), arg0, arg1, arg2, arg3) } @@ -75,7 +79,7 @@ func (m *MockMetadataRepositoryManagementClient) GetClusterInfo(arg0 context.Con } // GetClusterInfo indicates an expected call of GetClusterInfo. -func (mr *MockMetadataRepositoryManagementClientMockRecorder) GetClusterInfo(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryManagementClientMockRecorder) GetClusterInfo(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClusterInfo", reflect.TypeOf((*MockMetadataRepositoryManagementClient)(nil).GetClusterInfo), arg0, arg1) } @@ -89,7 +93,7 @@ func (m *MockMetadataRepositoryManagementClient) RemovePeer(arg0 context.Context } // RemovePeer indicates an expected call of RemovePeer. -func (mr *MockMetadataRepositoryManagementClientMockRecorder) RemovePeer(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryManagementClientMockRecorder) RemovePeer(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemovePeer", reflect.TypeOf((*MockMetadataRepositoryManagementClient)(nil).RemovePeer), arg0, arg1, arg2) } diff --git a/pkg/mrc/metadata_repository_management_client_test.go b/pkg/mrc/metadata_repository_management_client_test.go index b68790630..4bea0751e 100644 --- a/pkg/mrc/metadata_repository_management_client_test.go +++ b/pkg/mrc/metadata_repository_management_client_test.go @@ -6,9 +6,9 @@ import ( "testing" pbtypes "github.com/gogo/protobuf/types" - "github.com/golang/mock/gomock" - _ "github.com/golang/mock/mockgen/model" . "github.com/smartystreets/goconvey/convey" + "go.uber.org/mock/gomock" + _ "go.uber.org/mock/mockgen/model" "github.com/kakao/varlog/pkg/types" "github.com/kakao/varlog/pkg/verrors" diff --git a/pkg/mrc/mrconnector/mrc_proxy_test.go b/pkg/mrc/mrconnector/mrc_proxy_test.go index 16ca3049b..402484e5d 100644 --- a/pkg/mrc/mrconnector/mrc_proxy_test.go +++ b/pkg/mrc/mrconnector/mrc_proxy_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "github.com/kakao/varlog/pkg/mrc" "github.com/kakao/varlog/pkg/types" diff --git a/pkg/varlog/admin_mock.go b/pkg/varlog/admin_mock.go index 7ed9b7832..8ef5eadff 100644 --- a/pkg/varlog/admin_mock.go +++ b/pkg/varlog/admin_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kakao/varlog/pkg/varlog (interfaces: Admin) - +// +// Generated by this command: +// +// mockgen -package varlog -destination admin_mock.go . Admin +// // Package varlog is a generated GoMock package. package varlog @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" types "github.com/kakao/varlog/pkg/types" admpb "github.com/kakao/varlog/proto/admpb" @@ -42,7 +46,7 @@ func (m *MockAdmin) EXPECT() *MockAdminMockRecorder { // AddLogStream mocks base method. func (m *MockAdmin) AddLogStream(arg0 context.Context, arg1 types.TopicID, arg2 []*varlogpb.ReplicaDescriptor, arg3 ...AdminCallOption) (*varlogpb.LogStreamDescriptor, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2} + varargs := []any{arg0, arg1, arg2} for _, a := range arg3 { varargs = append(varargs, a) } @@ -53,16 +57,16 @@ func (m *MockAdmin) AddLogStream(arg0 context.Context, arg1 types.TopicID, arg2 } // AddLogStream indicates an expected call of AddLogStream. -func (mr *MockAdminMockRecorder) AddLogStream(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) AddLogStream(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + varargs := append([]any{arg0, arg1, arg2}, arg3...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddLogStream", reflect.TypeOf((*MockAdmin)(nil).AddLogStream), varargs...) } // AddMRPeer mocks base method. func (m *MockAdmin) AddMRPeer(arg0 context.Context, arg1, arg2 string, arg3 ...AdminCallOption) (types.NodeID, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2} + varargs := []any{arg0, arg1, arg2} for _, a := range arg3 { varargs = append(varargs, a) } @@ -73,16 +77,16 @@ func (m *MockAdmin) AddMRPeer(arg0 context.Context, arg1, arg2 string, arg3 ...A } // AddMRPeer indicates an expected call of AddMRPeer. -func (mr *MockAdminMockRecorder) AddMRPeer(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) AddMRPeer(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + varargs := append([]any{arg0, arg1, arg2}, arg3...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMRPeer", reflect.TypeOf((*MockAdmin)(nil).AddMRPeer), varargs...) } // AddMetadataRepositoryNode mocks base method. func (m *MockAdmin) AddMetadataRepositoryNode(arg0 context.Context, arg1, arg2 string, arg3 ...AdminCallOption) (*varlogpb.MetadataRepositoryNode, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2} + varargs := []any{arg0, arg1, arg2} for _, a := range arg3 { varargs = append(varargs, a) } @@ -93,16 +97,16 @@ func (m *MockAdmin) AddMetadataRepositoryNode(arg0 context.Context, arg1, arg2 s } // AddMetadataRepositoryNode indicates an expected call of AddMetadataRepositoryNode. -func (mr *MockAdminMockRecorder) AddMetadataRepositoryNode(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) AddMetadataRepositoryNode(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + varargs := append([]any{arg0, arg1, arg2}, arg3...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMetadataRepositoryNode", reflect.TypeOf((*MockAdmin)(nil).AddMetadataRepositoryNode), varargs...) } // AddStorageNode mocks base method. func (m *MockAdmin) AddStorageNode(arg0 context.Context, arg1 types.StorageNodeID, arg2 string, arg3 ...AdminCallOption) (*admpb.StorageNodeMetadata, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2} + varargs := []any{arg0, arg1, arg2} for _, a := range arg3 { varargs = append(varargs, a) } @@ -113,16 +117,16 @@ func (m *MockAdmin) AddStorageNode(arg0 context.Context, arg1 types.StorageNodeI } // AddStorageNode indicates an expected call of AddStorageNode. -func (mr *MockAdminMockRecorder) AddStorageNode(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) AddStorageNode(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + varargs := append([]any{arg0, arg1, arg2}, arg3...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddStorageNode", reflect.TypeOf((*MockAdmin)(nil).AddStorageNode), varargs...) } // AddTopic mocks base method. func (m *MockAdmin) AddTopic(arg0 context.Context, arg1 ...AdminCallOption) (*varlogpb.TopicDescriptor, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -133,9 +137,9 @@ func (m *MockAdmin) AddTopic(arg0 context.Context, arg1 ...AdminCallOption) (*va } // AddTopic indicates an expected call of AddTopic. -func (mr *MockAdminMockRecorder) AddTopic(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) AddTopic(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddTopic", reflect.TypeOf((*MockAdmin)(nil).AddTopic), varargs...) } @@ -156,7 +160,7 @@ func (mr *MockAdminMockRecorder) Close() *gomock.Call { // DeleteMetadataRepositoryNode mocks base method. func (m *MockAdmin) DeleteMetadataRepositoryNode(arg0 context.Context, arg1 types.NodeID, arg2 ...AdminCallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -166,16 +170,16 @@ func (m *MockAdmin) DeleteMetadataRepositoryNode(arg0 context.Context, arg1 type } // DeleteMetadataRepositoryNode indicates an expected call of DeleteMetadataRepositoryNode. -func (mr *MockAdminMockRecorder) DeleteMetadataRepositoryNode(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) DeleteMetadataRepositoryNode(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteMetadataRepositoryNode", reflect.TypeOf((*MockAdmin)(nil).DeleteMetadataRepositoryNode), varargs...) } // DescribeTopic mocks base method. func (m *MockAdmin) DescribeTopic(arg0 context.Context, arg1 types.TopicID, arg2 ...AdminCallOption) (*admpb.DescribeTopicResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -186,16 +190,16 @@ func (m *MockAdmin) DescribeTopic(arg0 context.Context, arg1 types.TopicID, arg2 } // DescribeTopic indicates an expected call of DescribeTopic. -func (mr *MockAdminMockRecorder) DescribeTopic(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) DescribeTopic(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTopic", reflect.TypeOf((*MockAdmin)(nil).DescribeTopic), varargs...) } // GetLogStream mocks base method. func (m *MockAdmin) GetLogStream(arg0 context.Context, arg1 types.TopicID, arg2 types.LogStreamID, arg3 ...AdminCallOption) (*varlogpb.LogStreamDescriptor, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2} + varargs := []any{arg0, arg1, arg2} for _, a := range arg3 { varargs = append(varargs, a) } @@ -206,16 +210,16 @@ func (m *MockAdmin) GetLogStream(arg0 context.Context, arg1 types.TopicID, arg2 } // GetLogStream indicates an expected call of GetLogStream. -func (mr *MockAdminMockRecorder) GetLogStream(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) GetLogStream(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + varargs := append([]any{arg0, arg1, arg2}, arg3...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLogStream", reflect.TypeOf((*MockAdmin)(nil).GetLogStream), varargs...) } // GetMRMembers mocks base method. func (m *MockAdmin) GetMRMembers(arg0 context.Context, arg1 ...AdminCallOption) (*admpb.GetMRMembersResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -226,16 +230,16 @@ func (m *MockAdmin) GetMRMembers(arg0 context.Context, arg1 ...AdminCallOption) } // GetMRMembers indicates an expected call of GetMRMembers. -func (mr *MockAdminMockRecorder) GetMRMembers(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) GetMRMembers(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMRMembers", reflect.TypeOf((*MockAdmin)(nil).GetMRMembers), varargs...) } // GetMetadataRepositoryNode mocks base method. func (m *MockAdmin) GetMetadataRepositoryNode(arg0 context.Context, arg1 types.NodeID, arg2 ...AdminCallOption) (*varlogpb.MetadataRepositoryNode, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -246,16 +250,16 @@ func (m *MockAdmin) GetMetadataRepositoryNode(arg0 context.Context, arg1 types.N } // GetMetadataRepositoryNode indicates an expected call of GetMetadataRepositoryNode. -func (mr *MockAdminMockRecorder) GetMetadataRepositoryNode(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) GetMetadataRepositoryNode(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetadataRepositoryNode", reflect.TypeOf((*MockAdmin)(nil).GetMetadataRepositoryNode), varargs...) } // GetStorageNode mocks base method. func (m *MockAdmin) GetStorageNode(arg0 context.Context, arg1 types.StorageNodeID, arg2 ...AdminCallOption) (*admpb.StorageNodeMetadata, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -266,16 +270,16 @@ func (m *MockAdmin) GetStorageNode(arg0 context.Context, arg1 types.StorageNodeI } // GetStorageNode indicates an expected call of GetStorageNode. -func (mr *MockAdminMockRecorder) GetStorageNode(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) GetStorageNode(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageNode", reflect.TypeOf((*MockAdmin)(nil).GetStorageNode), varargs...) } // GetStorageNodes mocks base method. func (m *MockAdmin) GetStorageNodes(arg0 context.Context, arg1 ...AdminCallOption) (map[types.StorageNodeID]admpb.StorageNodeMetadata, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -286,16 +290,16 @@ func (m *MockAdmin) GetStorageNodes(arg0 context.Context, arg1 ...AdminCallOptio } // GetStorageNodes indicates an expected call of GetStorageNodes. -func (mr *MockAdminMockRecorder) GetStorageNodes(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) GetStorageNodes(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageNodes", reflect.TypeOf((*MockAdmin)(nil).GetStorageNodes), varargs...) } // GetTopic mocks base method. func (m *MockAdmin) GetTopic(arg0 context.Context, arg1 types.TopicID, arg2 ...AdminCallOption) (*varlogpb.TopicDescriptor, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -306,16 +310,16 @@ func (m *MockAdmin) GetTopic(arg0 context.Context, arg1 types.TopicID, arg2 ...A } // GetTopic indicates an expected call of GetTopic. -func (mr *MockAdminMockRecorder) GetTopic(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) GetTopic(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTopic", reflect.TypeOf((*MockAdmin)(nil).GetTopic), varargs...) } // ListLogStreams mocks base method. func (m *MockAdmin) ListLogStreams(arg0 context.Context, arg1 types.TopicID, arg2 ...AdminCallOption) ([]varlogpb.LogStreamDescriptor, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -326,16 +330,16 @@ func (m *MockAdmin) ListLogStreams(arg0 context.Context, arg1 types.TopicID, arg } // ListLogStreams indicates an expected call of ListLogStreams. -func (mr *MockAdminMockRecorder) ListLogStreams(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) ListLogStreams(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListLogStreams", reflect.TypeOf((*MockAdmin)(nil).ListLogStreams), varargs...) } // ListMetadataRepositoryNodes mocks base method. func (m *MockAdmin) ListMetadataRepositoryNodes(arg0 context.Context, arg1 ...AdminCallOption) ([]varlogpb.MetadataRepositoryNode, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -346,16 +350,16 @@ func (m *MockAdmin) ListMetadataRepositoryNodes(arg0 context.Context, arg1 ...Ad } // ListMetadataRepositoryNodes indicates an expected call of ListMetadataRepositoryNodes. -func (mr *MockAdminMockRecorder) ListMetadataRepositoryNodes(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) ListMetadataRepositoryNodes(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListMetadataRepositoryNodes", reflect.TypeOf((*MockAdmin)(nil).ListMetadataRepositoryNodes), varargs...) } // ListStorageNodes mocks base method. func (m *MockAdmin) ListStorageNodes(arg0 context.Context, arg1 ...AdminCallOption) ([]admpb.StorageNodeMetadata, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -366,16 +370,16 @@ func (m *MockAdmin) ListStorageNodes(arg0 context.Context, arg1 ...AdminCallOpti } // ListStorageNodes indicates an expected call of ListStorageNodes. -func (mr *MockAdminMockRecorder) ListStorageNodes(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) ListStorageNodes(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListStorageNodes", reflect.TypeOf((*MockAdmin)(nil).ListStorageNodes), varargs...) } // ListTopics mocks base method. func (m *MockAdmin) ListTopics(arg0 context.Context, arg1 ...AdminCallOption) ([]varlogpb.TopicDescriptor, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -386,16 +390,16 @@ func (m *MockAdmin) ListTopics(arg0 context.Context, arg1 ...AdminCallOption) ([ } // ListTopics indicates an expected call of ListTopics. -func (mr *MockAdminMockRecorder) ListTopics(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) ListTopics(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListTopics", reflect.TypeOf((*MockAdmin)(nil).ListTopics), varargs...) } // RemoveLogStreamReplica mocks base method. func (m *MockAdmin) RemoveLogStreamReplica(arg0 context.Context, arg1 types.StorageNodeID, arg2 types.TopicID, arg3 types.LogStreamID, arg4 ...AdminCallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2, arg3} + varargs := []any{arg0, arg1, arg2, arg3} for _, a := range arg4 { varargs = append(varargs, a) } @@ -405,16 +409,16 @@ func (m *MockAdmin) RemoveLogStreamReplica(arg0 context.Context, arg1 types.Stor } // RemoveLogStreamReplica indicates an expected call of RemoveLogStreamReplica. -func (mr *MockAdminMockRecorder) RemoveLogStreamReplica(arg0, arg1, arg2, arg3 interface{}, arg4 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) RemoveLogStreamReplica(arg0, arg1, arg2, arg3 any, arg4 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2, arg3}, arg4...) + varargs := append([]any{arg0, arg1, arg2, arg3}, arg4...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveLogStreamReplica", reflect.TypeOf((*MockAdmin)(nil).RemoveLogStreamReplica), varargs...) } // RemoveMRPeer mocks base method. func (m *MockAdmin) RemoveMRPeer(arg0 context.Context, arg1 string, arg2 ...AdminCallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -424,16 +428,16 @@ func (m *MockAdmin) RemoveMRPeer(arg0 context.Context, arg1 string, arg2 ...Admi } // RemoveMRPeer indicates an expected call of RemoveMRPeer. -func (mr *MockAdminMockRecorder) RemoveMRPeer(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) RemoveMRPeer(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveMRPeer", reflect.TypeOf((*MockAdmin)(nil).RemoveMRPeer), varargs...) } // Seal mocks base method. func (m *MockAdmin) Seal(arg0 context.Context, arg1 types.TopicID, arg2 types.LogStreamID, arg3 ...AdminCallOption) (*admpb.SealResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2} + varargs := []any{arg0, arg1, arg2} for _, a := range arg3 { varargs = append(varargs, a) } @@ -444,16 +448,16 @@ func (m *MockAdmin) Seal(arg0 context.Context, arg1 types.TopicID, arg2 types.Lo } // Seal indicates an expected call of Seal. -func (mr *MockAdminMockRecorder) Seal(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) Seal(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + varargs := append([]any{arg0, arg1, arg2}, arg3...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Seal", reflect.TypeOf((*MockAdmin)(nil).Seal), varargs...) } // Sync mocks base method. func (m *MockAdmin) Sync(arg0 context.Context, arg1 types.TopicID, arg2 types.LogStreamID, arg3, arg4 types.StorageNodeID, arg5 ...AdminCallOption) (*snpb.SyncStatus, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2, arg3, arg4} + varargs := []any{arg0, arg1, arg2, arg3, arg4} for _, a := range arg5 { varargs = append(varargs, a) } @@ -464,16 +468,16 @@ func (m *MockAdmin) Sync(arg0 context.Context, arg1 types.TopicID, arg2 types.Lo } // Sync indicates an expected call of Sync. -func (mr *MockAdminMockRecorder) Sync(arg0, arg1, arg2, arg3, arg4 interface{}, arg5 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) Sync(arg0, arg1, arg2, arg3, arg4 any, arg5 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2, arg3, arg4}, arg5...) + varargs := append([]any{arg0, arg1, arg2, arg3, arg4}, arg5...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sync", reflect.TypeOf((*MockAdmin)(nil).Sync), varargs...) } // Trim mocks base method. func (m *MockAdmin) Trim(arg0 context.Context, arg1 types.TopicID, arg2 types.GLSN, arg3 ...AdminCallOption) (map[types.LogStreamID]map[types.StorageNodeID]error, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2} + varargs := []any{arg0, arg1, arg2} for _, a := range arg3 { varargs = append(varargs, a) } @@ -484,16 +488,16 @@ func (m *MockAdmin) Trim(arg0 context.Context, arg1 types.TopicID, arg2 types.GL } // Trim indicates an expected call of Trim. -func (mr *MockAdminMockRecorder) Trim(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) Trim(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + varargs := append([]any{arg0, arg1, arg2}, arg3...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trim", reflect.TypeOf((*MockAdmin)(nil).Trim), varargs...) } // UnregisterLogStream mocks base method. func (m *MockAdmin) UnregisterLogStream(arg0 context.Context, arg1 types.TopicID, arg2 types.LogStreamID, arg3 ...AdminCallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2} + varargs := []any{arg0, arg1, arg2} for _, a := range arg3 { varargs = append(varargs, a) } @@ -503,16 +507,16 @@ func (m *MockAdmin) UnregisterLogStream(arg0 context.Context, arg1 types.TopicID } // UnregisterLogStream indicates an expected call of UnregisterLogStream. -func (mr *MockAdminMockRecorder) UnregisterLogStream(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) UnregisterLogStream(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + varargs := append([]any{arg0, arg1, arg2}, arg3...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterLogStream", reflect.TypeOf((*MockAdmin)(nil).UnregisterLogStream), varargs...) } // UnregisterStorageNode mocks base method. func (m *MockAdmin) UnregisterStorageNode(arg0 context.Context, arg1 types.StorageNodeID, arg2 ...AdminCallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -522,16 +526,16 @@ func (m *MockAdmin) UnregisterStorageNode(arg0 context.Context, arg1 types.Stora } // UnregisterStorageNode indicates an expected call of UnregisterStorageNode. -func (mr *MockAdminMockRecorder) UnregisterStorageNode(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) UnregisterStorageNode(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterStorageNode", reflect.TypeOf((*MockAdmin)(nil).UnregisterStorageNode), varargs...) } // UnregisterTopic mocks base method. func (m *MockAdmin) UnregisterTopic(arg0 context.Context, arg1 types.TopicID, arg2 ...AdminCallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -541,16 +545,16 @@ func (m *MockAdmin) UnregisterTopic(arg0 context.Context, arg1 types.TopicID, ar } // UnregisterTopic indicates an expected call of UnregisterTopic. -func (mr *MockAdminMockRecorder) UnregisterTopic(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) UnregisterTopic(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterTopic", reflect.TypeOf((*MockAdmin)(nil).UnregisterTopic), varargs...) } // Unseal mocks base method. func (m *MockAdmin) Unseal(arg0 context.Context, arg1 types.TopicID, arg2 types.LogStreamID, arg3 ...AdminCallOption) (*varlogpb.LogStreamDescriptor, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2} + varargs := []any{arg0, arg1, arg2} for _, a := range arg3 { varargs = append(varargs, a) } @@ -561,16 +565,16 @@ func (m *MockAdmin) Unseal(arg0 context.Context, arg1 types.TopicID, arg2 types. } // Unseal indicates an expected call of Unseal. -func (mr *MockAdminMockRecorder) Unseal(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) Unseal(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + varargs := append([]any{arg0, arg1, arg2}, arg3...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unseal", reflect.TypeOf((*MockAdmin)(nil).Unseal), varargs...) } // UpdateLogStream mocks base method. func (m *MockAdmin) UpdateLogStream(arg0 context.Context, arg1 types.TopicID, arg2 types.LogStreamID, arg3, arg4 varlogpb.ReplicaDescriptor, arg5 ...AdminCallOption) (*varlogpb.LogStreamDescriptor, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2, arg3, arg4} + varargs := []any{arg0, arg1, arg2, arg3, arg4} for _, a := range arg5 { varargs = append(varargs, a) } @@ -581,8 +585,8 @@ func (m *MockAdmin) UpdateLogStream(arg0 context.Context, arg1 types.TopicID, ar } // UpdateLogStream indicates an expected call of UpdateLogStream. -func (mr *MockAdminMockRecorder) UpdateLogStream(arg0, arg1, arg2, arg3, arg4 interface{}, arg5 ...interface{}) *gomock.Call { +func (mr *MockAdminMockRecorder) UpdateLogStream(arg0, arg1, arg2, arg3, arg4 any, arg5 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2, arg3, arg4}, arg5...) + varargs := append([]any{arg0, arg1, arg2, arg3, arg4}, arg5...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateLogStream", reflect.TypeOf((*MockAdmin)(nil).UpdateLogStream), varargs...) } diff --git a/pkg/varlog/admin_test.go b/pkg/varlog/admin_test.go index fa00902fe..57cfa5983 100644 --- a/pkg/varlog/admin_test.go +++ b/pkg/varlog/admin_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "github.com/kakao/varlog/internal/admin" "github.com/kakao/varlog/pkg/varlog" diff --git a/pkg/varlog/log_mock.go b/pkg/varlog/log_mock.go index ebf116e8e..80cf0517f 100644 --- a/pkg/varlog/log_mock.go +++ b/pkg/varlog/log_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kakao/varlog/pkg/varlog (interfaces: Log) - +// +// Generated by this command: +// +// mockgen -package varlog -destination log_mock.go . Log +// // Package varlog is a generated GoMock package. package varlog @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" types "github.com/kakao/varlog/pkg/types" varlogpb "github.com/kakao/varlog/proto/varlogpb" @@ -40,7 +44,7 @@ func (m *MockLog) EXPECT() *MockLogMockRecorder { // Append mocks base method. func (m *MockLog) Append(arg0 context.Context, arg1 types.TopicID, arg2 [][]byte, arg3 ...AppendOption) AppendResult { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2} + varargs := []any{arg0, arg1, arg2} for _, a := range arg3 { varargs = append(varargs, a) } @@ -50,16 +54,16 @@ func (m *MockLog) Append(arg0 context.Context, arg1 types.TopicID, arg2 [][]byte } // Append indicates an expected call of Append. -func (mr *MockLogMockRecorder) Append(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { +func (mr *MockLogMockRecorder) Append(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + varargs := append([]any{arg0, arg1, arg2}, arg3...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Append", reflect.TypeOf((*MockLog)(nil).Append), varargs...) } // AppendTo mocks base method. func (m *MockLog) AppendTo(arg0 context.Context, arg1 types.TopicID, arg2 types.LogStreamID, arg3 [][]byte, arg4 ...AppendOption) AppendResult { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2, arg3} + varargs := []any{arg0, arg1, arg2, arg3} for _, a := range arg4 { varargs = append(varargs, a) } @@ -69,9 +73,9 @@ func (m *MockLog) AppendTo(arg0 context.Context, arg1 types.TopicID, arg2 types. } // AppendTo indicates an expected call of AppendTo. -func (mr *MockLogMockRecorder) AppendTo(arg0, arg1, arg2, arg3 interface{}, arg4 ...interface{}) *gomock.Call { +func (mr *MockLogMockRecorder) AppendTo(arg0, arg1, arg2, arg3 any, arg4 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2, arg3}, arg4...) + varargs := append([]any{arg0, arg1, arg2, arg3}, arg4...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppendTo", reflect.TypeOf((*MockLog)(nil).AppendTo), varargs...) } @@ -84,7 +88,7 @@ func (m *MockLog) AppendableLogStreams(arg0 types.TopicID) map[types.LogStreamID } // AppendableLogStreams indicates an expected call of AppendableLogStreams. -func (mr *MockLogMockRecorder) AppendableLogStreams(arg0 interface{}) *gomock.Call { +func (mr *MockLogMockRecorder) AppendableLogStreams(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppendableLogStreams", reflect.TypeOf((*MockLog)(nil).AppendableLogStreams), arg0) } @@ -106,7 +110,7 @@ func (mr *MockLogMockRecorder) Close() *gomock.Call { // NewLogStreamAppender mocks base method. func (m *MockLog) NewLogStreamAppender(arg0 types.TopicID, arg1 types.LogStreamID, arg2 ...LogStreamAppenderOption) (LogStreamAppender, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -117,9 +121,9 @@ func (m *MockLog) NewLogStreamAppender(arg0 types.TopicID, arg1 types.LogStreamI } // NewLogStreamAppender indicates an expected call of NewLogStreamAppender. -func (mr *MockLogMockRecorder) NewLogStreamAppender(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockLogMockRecorder) NewLogStreamAppender(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewLogStreamAppender", reflect.TypeOf((*MockLog)(nil).NewLogStreamAppender), varargs...) } @@ -134,7 +138,7 @@ func (m *MockLog) PeekLogStream(arg0 context.Context, arg1 types.TopicID, arg2 t } // PeekLogStream indicates an expected call of PeekLogStream. -func (mr *MockLogMockRecorder) PeekLogStream(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockLogMockRecorder) PeekLogStream(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeekLogStream", reflect.TypeOf((*MockLog)(nil).PeekLogStream), arg0, arg1, arg2) } @@ -142,7 +146,7 @@ func (mr *MockLogMockRecorder) PeekLogStream(arg0, arg1, arg2 interface{}) *gomo // Subscribe mocks base method. func (m *MockLog) Subscribe(arg0 context.Context, arg1 types.TopicID, arg2, arg3 types.GLSN, arg4 OnNext, arg5 ...SubscribeOption) (SubscribeCloser, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2, arg3, arg4} + varargs := []any{arg0, arg1, arg2, arg3, arg4} for _, a := range arg5 { varargs = append(varargs, a) } @@ -153,16 +157,16 @@ func (m *MockLog) Subscribe(arg0 context.Context, arg1 types.TopicID, arg2, arg3 } // Subscribe indicates an expected call of Subscribe. -func (mr *MockLogMockRecorder) Subscribe(arg0, arg1, arg2, arg3, arg4 interface{}, arg5 ...interface{}) *gomock.Call { +func (mr *MockLogMockRecorder) Subscribe(arg0, arg1, arg2, arg3, arg4 any, arg5 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2, arg3, arg4}, arg5...) + varargs := append([]any{arg0, arg1, arg2, arg3, arg4}, arg5...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subscribe", reflect.TypeOf((*MockLog)(nil).Subscribe), varargs...) } // SubscribeTo mocks base method. func (m *MockLog) SubscribeTo(arg0 context.Context, arg1 types.TopicID, arg2 types.LogStreamID, arg3, arg4 types.LLSN, arg5 ...SubscribeOption) Subscriber { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2, arg3, arg4} + varargs := []any{arg0, arg1, arg2, arg3, arg4} for _, a := range arg5 { varargs = append(varargs, a) } @@ -172,9 +176,9 @@ func (m *MockLog) SubscribeTo(arg0 context.Context, arg1 types.TopicID, arg2 typ } // SubscribeTo indicates an expected call of SubscribeTo. -func (mr *MockLogMockRecorder) SubscribeTo(arg0, arg1, arg2, arg3, arg4 interface{}, arg5 ...interface{}) *gomock.Call { +func (mr *MockLogMockRecorder) SubscribeTo(arg0, arg1, arg2, arg3, arg4 any, arg5 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2, arg3, arg4}, arg5...) + varargs := append([]any{arg0, arg1, arg2, arg3, arg4}, arg5...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeTo", reflect.TypeOf((*MockLog)(nil).SubscribeTo), varargs...) } @@ -187,7 +191,7 @@ func (m *MockLog) Trim(arg0 context.Context, arg1 types.TopicID, arg2 types.GLSN } // Trim indicates an expected call of Trim. -func (mr *MockLogMockRecorder) Trim(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockLogMockRecorder) Trim(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trim", reflect.TypeOf((*MockLog)(nil).Trim), arg0, arg1, arg2, arg3) } diff --git a/pkg/varlog/log_stream_appender_mock.go b/pkg/varlog/log_stream_appender_mock.go index 525a498ea..1a84f9fab 100644 --- a/pkg/varlog/log_stream_appender_mock.go +++ b/pkg/varlog/log_stream_appender_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kakao/varlog/pkg/varlog (interfaces: LogStreamAppender) - +// +// Generated by this command: +// +// mockgen -package varlog -destination log_stream_appender_mock.go . LogStreamAppender +// // Package varlog is a generated GoMock package. package varlog import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockLogStreamAppender is a mock of LogStreamAppender interface. @@ -42,7 +46,7 @@ func (m *MockLogStreamAppender) AppendBatch(arg0 [][]byte, arg1 BatchCallback) e } // AppendBatch indicates an expected call of AppendBatch. -func (mr *MockLogStreamAppenderMockRecorder) AppendBatch(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockLogStreamAppenderMockRecorder) AppendBatch(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppendBatch", reflect.TypeOf((*MockLogStreamAppender)(nil).AppendBatch), arg0, arg1) } diff --git a/pkg/varlog/metadata_refresher_mock.go b/pkg/varlog/metadata_refresher_mock.go index fab548f93..b1622f74d 100644 --- a/pkg/varlog/metadata_refresher_mock.go +++ b/pkg/varlog/metadata_refresher_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kakao/varlog/pkg/varlog (interfaces: MetadataRefresher) - +// +// Generated by this command: +// +// mockgen -build_flags -mod=vendor -self_package github.com/kakao/varlog/pkg/varlog -package varlog -destination metadata_refresher_mock.go . MetadataRefresher +// // Package varlog is a generated GoMock package. package varlog @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" varlogpb "github.com/kakao/varlog/proto/varlogpb" ) @@ -71,7 +75,7 @@ func (m *MockMetadataRefresher) Refresh(arg0 context.Context) { } // Refresh indicates an expected call of Refresh. -func (mr *MockMetadataRefresherMockRecorder) Refresh(arg0 interface{}) *gomock.Call { +func (mr *MockMetadataRefresherMockRecorder) Refresh(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Refresh", reflect.TypeOf((*MockMetadataRefresher)(nil).Refresh), arg0) } diff --git a/pkg/varlog/replicas_retriever_mock.go b/pkg/varlog/replicas_retriever_mock.go index 4ee3b6cba..243d6ed26 100644 --- a/pkg/varlog/replicas_retriever_mock.go +++ b/pkg/varlog/replicas_retriever_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kakao/varlog/pkg/varlog (interfaces: ReplicasRetriever,RenewableReplicasRetriever) - +// +// Generated by this command: +// +// mockgen -build_flags -mod=vendor -self_package github.com/kakao/varlog/pkg/varlog -package varlog -destination replicas_retriever_mock.go . ReplicasRetriever,RenewableReplicasRetriever +// // Package varlog is a generated GoMock package. package varlog import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" types "github.com/kakao/varlog/pkg/types" varlogpb "github.com/kakao/varlog/proto/varlogpb" @@ -45,7 +49,7 @@ func (m *MockReplicasRetriever) All(arg0 types.TopicID) map[types.LogStreamID][] } // All indicates an expected call of All. -func (mr *MockReplicasRetrieverMockRecorder) All(arg0 interface{}) *gomock.Call { +func (mr *MockReplicasRetrieverMockRecorder) All(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "All", reflect.TypeOf((*MockReplicasRetriever)(nil).All), arg0) } @@ -60,7 +64,7 @@ func (m *MockReplicasRetriever) Retrieve(arg0 types.TopicID, arg1 types.LogStrea } // Retrieve indicates an expected call of Retrieve. -func (mr *MockReplicasRetrieverMockRecorder) Retrieve(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockReplicasRetrieverMockRecorder) Retrieve(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Retrieve", reflect.TypeOf((*MockReplicasRetriever)(nil).Retrieve), arg0, arg1) } @@ -97,7 +101,7 @@ func (m *MockRenewableReplicasRetriever) All(arg0 types.TopicID) map[types.LogSt } // All indicates an expected call of All. -func (mr *MockRenewableReplicasRetrieverMockRecorder) All(arg0 interface{}) *gomock.Call { +func (mr *MockRenewableReplicasRetrieverMockRecorder) All(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "All", reflect.TypeOf((*MockRenewableReplicasRetriever)(nil).All), arg0) } @@ -109,7 +113,7 @@ func (m *MockRenewableReplicasRetriever) Renew(arg0 *varlogpb.MetadataDescriptor } // Renew indicates an expected call of Renew. -func (mr *MockRenewableReplicasRetrieverMockRecorder) Renew(arg0 interface{}) *gomock.Call { +func (mr *MockRenewableReplicasRetrieverMockRecorder) Renew(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Renew", reflect.TypeOf((*MockRenewableReplicasRetriever)(nil).Renew), arg0) } @@ -124,7 +128,7 @@ func (m *MockRenewableReplicasRetriever) Retrieve(arg0 types.TopicID, arg1 types } // Retrieve indicates an expected call of Retrieve. -func (mr *MockRenewableReplicasRetrieverMockRecorder) Retrieve(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockRenewableReplicasRetrieverMockRecorder) Retrieve(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Retrieve", reflect.TypeOf((*MockRenewableReplicasRetriever)(nil).Retrieve), arg0, arg1) } diff --git a/proto/admpb/admin_mock.go b/proto/admpb/admin_mock.go index 935447c1a..1fd725dde 100644 --- a/proto/admpb/admin_mock.go +++ b/proto/admpb/admin_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kakao/varlog/proto/admpb (interfaces: ClusterManagerClient,ClusterManagerServer) - +// +// Generated by this command: +// +// mockgen -build_flags -mod=vendor -package admpb -destination admin_mock.go . ClusterManagerClient,ClusterManagerServer +// // Package admpb is a generated GoMock package. package admpb @@ -9,7 +13,7 @@ import ( reflect "reflect" types "github.com/gogo/protobuf/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" ) @@ -39,7 +43,7 @@ func (m *MockClusterManagerClient) EXPECT() *MockClusterManagerClientMockRecorde // AddLogStream mocks base method. func (m *MockClusterManagerClient) AddLogStream(arg0 context.Context, arg1 *AddLogStreamRequest, arg2 ...grpc.CallOption) (*AddLogStreamResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -50,16 +54,16 @@ func (m *MockClusterManagerClient) AddLogStream(arg0 context.Context, arg1 *AddL } // AddLogStream indicates an expected call of AddLogStream. -func (mr *MockClusterManagerClientMockRecorder) AddLogStream(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) AddLogStream(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddLogStream", reflect.TypeOf((*MockClusterManagerClient)(nil).AddLogStream), varargs...) } // AddMRPeer mocks base method. func (m *MockClusterManagerClient) AddMRPeer(arg0 context.Context, arg1 *AddMRPeerRequest, arg2 ...grpc.CallOption) (*AddMRPeerResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -70,16 +74,16 @@ func (m *MockClusterManagerClient) AddMRPeer(arg0 context.Context, arg1 *AddMRPe } // AddMRPeer indicates an expected call of AddMRPeer. -func (mr *MockClusterManagerClientMockRecorder) AddMRPeer(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) AddMRPeer(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMRPeer", reflect.TypeOf((*MockClusterManagerClient)(nil).AddMRPeer), varargs...) } // AddMetadataRepositoryNode mocks base method. func (m *MockClusterManagerClient) AddMetadataRepositoryNode(arg0 context.Context, arg1 *AddMetadataRepositoryNodeRequest, arg2 ...grpc.CallOption) (*AddMetadataRepositoryNodeResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -90,16 +94,16 @@ func (m *MockClusterManagerClient) AddMetadataRepositoryNode(arg0 context.Contex } // AddMetadataRepositoryNode indicates an expected call of AddMetadataRepositoryNode. -func (mr *MockClusterManagerClientMockRecorder) AddMetadataRepositoryNode(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) AddMetadataRepositoryNode(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMetadataRepositoryNode", reflect.TypeOf((*MockClusterManagerClient)(nil).AddMetadataRepositoryNode), varargs...) } // AddStorageNode mocks base method. func (m *MockClusterManagerClient) AddStorageNode(arg0 context.Context, arg1 *AddStorageNodeRequest, arg2 ...grpc.CallOption) (*AddStorageNodeResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -110,16 +114,16 @@ func (m *MockClusterManagerClient) AddStorageNode(arg0 context.Context, arg1 *Ad } // AddStorageNode indicates an expected call of AddStorageNode. -func (mr *MockClusterManagerClientMockRecorder) AddStorageNode(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) AddStorageNode(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddStorageNode", reflect.TypeOf((*MockClusterManagerClient)(nil).AddStorageNode), varargs...) } // AddTopic mocks base method. func (m *MockClusterManagerClient) AddTopic(arg0 context.Context, arg1 *AddTopicRequest, arg2 ...grpc.CallOption) (*AddTopicResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -130,16 +134,16 @@ func (m *MockClusterManagerClient) AddTopic(arg0 context.Context, arg1 *AddTopic } // AddTopic indicates an expected call of AddTopic. -func (mr *MockClusterManagerClientMockRecorder) AddTopic(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) AddTopic(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddTopic", reflect.TypeOf((*MockClusterManagerClient)(nil).AddTopic), varargs...) } // DeleteMetadataRepositoryNode mocks base method. func (m *MockClusterManagerClient) DeleteMetadataRepositoryNode(arg0 context.Context, arg1 *DeleteMetadataRepositoryNodeRequest, arg2 ...grpc.CallOption) (*DeleteMetadataRepositoryNodeResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -150,16 +154,16 @@ func (m *MockClusterManagerClient) DeleteMetadataRepositoryNode(arg0 context.Con } // DeleteMetadataRepositoryNode indicates an expected call of DeleteMetadataRepositoryNode. -func (mr *MockClusterManagerClientMockRecorder) DeleteMetadataRepositoryNode(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) DeleteMetadataRepositoryNode(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteMetadataRepositoryNode", reflect.TypeOf((*MockClusterManagerClient)(nil).DeleteMetadataRepositoryNode), varargs...) } // DescribeTopic mocks base method. func (m *MockClusterManagerClient) DescribeTopic(arg0 context.Context, arg1 *DescribeTopicRequest, arg2 ...grpc.CallOption) (*DescribeTopicResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -170,16 +174,16 @@ func (m *MockClusterManagerClient) DescribeTopic(arg0 context.Context, arg1 *Des } // DescribeTopic indicates an expected call of DescribeTopic. -func (mr *MockClusterManagerClientMockRecorder) DescribeTopic(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) DescribeTopic(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTopic", reflect.TypeOf((*MockClusterManagerClient)(nil).DescribeTopic), varargs...) } // GetLogStream mocks base method. func (m *MockClusterManagerClient) GetLogStream(arg0 context.Context, arg1 *GetLogStreamRequest, arg2 ...grpc.CallOption) (*GetLogStreamResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -190,16 +194,16 @@ func (m *MockClusterManagerClient) GetLogStream(arg0 context.Context, arg1 *GetL } // GetLogStream indicates an expected call of GetLogStream. -func (mr *MockClusterManagerClientMockRecorder) GetLogStream(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) GetLogStream(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLogStream", reflect.TypeOf((*MockClusterManagerClient)(nil).GetLogStream), varargs...) } // GetMRMembers mocks base method. func (m *MockClusterManagerClient) GetMRMembers(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*GetMRMembersResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -210,16 +214,16 @@ func (m *MockClusterManagerClient) GetMRMembers(arg0 context.Context, arg1 *type } // GetMRMembers indicates an expected call of GetMRMembers. -func (mr *MockClusterManagerClientMockRecorder) GetMRMembers(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) GetMRMembers(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMRMembers", reflect.TypeOf((*MockClusterManagerClient)(nil).GetMRMembers), varargs...) } // GetMetadataRepositoryNode mocks base method. func (m *MockClusterManagerClient) GetMetadataRepositoryNode(arg0 context.Context, arg1 *GetMetadataRepositoryNodeRequest, arg2 ...grpc.CallOption) (*GetMetadataRepositoryNodeResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -230,16 +234,16 @@ func (m *MockClusterManagerClient) GetMetadataRepositoryNode(arg0 context.Contex } // GetMetadataRepositoryNode indicates an expected call of GetMetadataRepositoryNode. -func (mr *MockClusterManagerClientMockRecorder) GetMetadataRepositoryNode(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) GetMetadataRepositoryNode(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetadataRepositoryNode", reflect.TypeOf((*MockClusterManagerClient)(nil).GetMetadataRepositoryNode), varargs...) } // GetStorageNode mocks base method. func (m *MockClusterManagerClient) GetStorageNode(arg0 context.Context, arg1 *GetStorageNodeRequest, arg2 ...grpc.CallOption) (*GetStorageNodeResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -250,16 +254,16 @@ func (m *MockClusterManagerClient) GetStorageNode(arg0 context.Context, arg1 *Ge } // GetStorageNode indicates an expected call of GetStorageNode. -func (mr *MockClusterManagerClientMockRecorder) GetStorageNode(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) GetStorageNode(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageNode", reflect.TypeOf((*MockClusterManagerClient)(nil).GetStorageNode), varargs...) } // GetTopic mocks base method. func (m *MockClusterManagerClient) GetTopic(arg0 context.Context, arg1 *GetTopicRequest, arg2 ...grpc.CallOption) (*GetTopicResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -270,16 +274,16 @@ func (m *MockClusterManagerClient) GetTopic(arg0 context.Context, arg1 *GetTopic } // GetTopic indicates an expected call of GetTopic. -func (mr *MockClusterManagerClientMockRecorder) GetTopic(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) GetTopic(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTopic", reflect.TypeOf((*MockClusterManagerClient)(nil).GetTopic), varargs...) } // ListLogStreams mocks base method. func (m *MockClusterManagerClient) ListLogStreams(arg0 context.Context, arg1 *ListLogStreamsRequest, arg2 ...grpc.CallOption) (*ListLogStreamsResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -290,16 +294,16 @@ func (m *MockClusterManagerClient) ListLogStreams(arg0 context.Context, arg1 *Li } // ListLogStreams indicates an expected call of ListLogStreams. -func (mr *MockClusterManagerClientMockRecorder) ListLogStreams(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) ListLogStreams(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListLogStreams", reflect.TypeOf((*MockClusterManagerClient)(nil).ListLogStreams), varargs...) } // ListMetadataRepositoryNodes mocks base method. func (m *MockClusterManagerClient) ListMetadataRepositoryNodes(arg0 context.Context, arg1 *ListMetadataRepositoryNodesRequest, arg2 ...grpc.CallOption) (*ListMetadataRepositoryNodesResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -310,16 +314,16 @@ func (m *MockClusterManagerClient) ListMetadataRepositoryNodes(arg0 context.Cont } // ListMetadataRepositoryNodes indicates an expected call of ListMetadataRepositoryNodes. -func (mr *MockClusterManagerClientMockRecorder) ListMetadataRepositoryNodes(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) ListMetadataRepositoryNodes(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListMetadataRepositoryNodes", reflect.TypeOf((*MockClusterManagerClient)(nil).ListMetadataRepositoryNodes), varargs...) } // ListStorageNodes mocks base method. func (m *MockClusterManagerClient) ListStorageNodes(arg0 context.Context, arg1 *ListStorageNodesRequest, arg2 ...grpc.CallOption) (*ListStorageNodesResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -330,16 +334,16 @@ func (m *MockClusterManagerClient) ListStorageNodes(arg0 context.Context, arg1 * } // ListStorageNodes indicates an expected call of ListStorageNodes. -func (mr *MockClusterManagerClientMockRecorder) ListStorageNodes(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) ListStorageNodes(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListStorageNodes", reflect.TypeOf((*MockClusterManagerClient)(nil).ListStorageNodes), varargs...) } // ListTopics mocks base method. func (m *MockClusterManagerClient) ListTopics(arg0 context.Context, arg1 *ListTopicsRequest, arg2 ...grpc.CallOption) (*ListTopicsResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -350,16 +354,16 @@ func (m *MockClusterManagerClient) ListTopics(arg0 context.Context, arg1 *ListTo } // ListTopics indicates an expected call of ListTopics. -func (mr *MockClusterManagerClientMockRecorder) ListTopics(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) ListTopics(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListTopics", reflect.TypeOf((*MockClusterManagerClient)(nil).ListTopics), varargs...) } // RemoveLogStreamReplica mocks base method. func (m *MockClusterManagerClient) RemoveLogStreamReplica(arg0 context.Context, arg1 *RemoveLogStreamReplicaRequest, arg2 ...grpc.CallOption) (*RemoveLogStreamReplicaResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -370,16 +374,16 @@ func (m *MockClusterManagerClient) RemoveLogStreamReplica(arg0 context.Context, } // RemoveLogStreamReplica indicates an expected call of RemoveLogStreamReplica. -func (mr *MockClusterManagerClientMockRecorder) RemoveLogStreamReplica(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) RemoveLogStreamReplica(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveLogStreamReplica", reflect.TypeOf((*MockClusterManagerClient)(nil).RemoveLogStreamReplica), varargs...) } // RemoveMRPeer mocks base method. func (m *MockClusterManagerClient) RemoveMRPeer(arg0 context.Context, arg1 *RemoveMRPeerRequest, arg2 ...grpc.CallOption) (*RemoveMRPeerResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -390,16 +394,16 @@ func (m *MockClusterManagerClient) RemoveMRPeer(arg0 context.Context, arg1 *Remo } // RemoveMRPeer indicates an expected call of RemoveMRPeer. -func (mr *MockClusterManagerClientMockRecorder) RemoveMRPeer(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) RemoveMRPeer(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveMRPeer", reflect.TypeOf((*MockClusterManagerClient)(nil).RemoveMRPeer), varargs...) } // Seal mocks base method. func (m *MockClusterManagerClient) Seal(arg0 context.Context, arg1 *SealRequest, arg2 ...grpc.CallOption) (*SealResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -410,16 +414,16 @@ func (m *MockClusterManagerClient) Seal(arg0 context.Context, arg1 *SealRequest, } // Seal indicates an expected call of Seal. -func (mr *MockClusterManagerClientMockRecorder) Seal(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) Seal(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Seal", reflect.TypeOf((*MockClusterManagerClient)(nil).Seal), varargs...) } // Sync mocks base method. func (m *MockClusterManagerClient) Sync(arg0 context.Context, arg1 *SyncRequest, arg2 ...grpc.CallOption) (*SyncResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -430,16 +434,16 @@ func (m *MockClusterManagerClient) Sync(arg0 context.Context, arg1 *SyncRequest, } // Sync indicates an expected call of Sync. -func (mr *MockClusterManagerClientMockRecorder) Sync(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) Sync(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sync", reflect.TypeOf((*MockClusterManagerClient)(nil).Sync), varargs...) } // Trim mocks base method. func (m *MockClusterManagerClient) Trim(arg0 context.Context, arg1 *TrimRequest, arg2 ...grpc.CallOption) (*TrimResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -450,16 +454,16 @@ func (m *MockClusterManagerClient) Trim(arg0 context.Context, arg1 *TrimRequest, } // Trim indicates an expected call of Trim. -func (mr *MockClusterManagerClientMockRecorder) Trim(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) Trim(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trim", reflect.TypeOf((*MockClusterManagerClient)(nil).Trim), varargs...) } // UnregisterLogStream mocks base method. func (m *MockClusterManagerClient) UnregisterLogStream(arg0 context.Context, arg1 *UnregisterLogStreamRequest, arg2 ...grpc.CallOption) (*UnregisterLogStreamResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -470,16 +474,16 @@ func (m *MockClusterManagerClient) UnregisterLogStream(arg0 context.Context, arg } // UnregisterLogStream indicates an expected call of UnregisterLogStream. -func (mr *MockClusterManagerClientMockRecorder) UnregisterLogStream(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) UnregisterLogStream(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterLogStream", reflect.TypeOf((*MockClusterManagerClient)(nil).UnregisterLogStream), varargs...) } // UnregisterStorageNode mocks base method. func (m *MockClusterManagerClient) UnregisterStorageNode(arg0 context.Context, arg1 *UnregisterStorageNodeRequest, arg2 ...grpc.CallOption) (*UnregisterStorageNodeResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -490,16 +494,16 @@ func (m *MockClusterManagerClient) UnregisterStorageNode(arg0 context.Context, a } // UnregisterStorageNode indicates an expected call of UnregisterStorageNode. -func (mr *MockClusterManagerClientMockRecorder) UnregisterStorageNode(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) UnregisterStorageNode(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterStorageNode", reflect.TypeOf((*MockClusterManagerClient)(nil).UnregisterStorageNode), varargs...) } // UnregisterTopic mocks base method. func (m *MockClusterManagerClient) UnregisterTopic(arg0 context.Context, arg1 *UnregisterTopicRequest, arg2 ...grpc.CallOption) (*UnregisterTopicResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -510,16 +514,16 @@ func (m *MockClusterManagerClient) UnregisterTopic(arg0 context.Context, arg1 *U } // UnregisterTopic indicates an expected call of UnregisterTopic. -func (mr *MockClusterManagerClientMockRecorder) UnregisterTopic(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) UnregisterTopic(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterTopic", reflect.TypeOf((*MockClusterManagerClient)(nil).UnregisterTopic), varargs...) } // Unseal mocks base method. func (m *MockClusterManagerClient) Unseal(arg0 context.Context, arg1 *UnsealRequest, arg2 ...grpc.CallOption) (*UnsealResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -530,16 +534,16 @@ func (m *MockClusterManagerClient) Unseal(arg0 context.Context, arg1 *UnsealRequ } // Unseal indicates an expected call of Unseal. -func (mr *MockClusterManagerClientMockRecorder) Unseal(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) Unseal(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unseal", reflect.TypeOf((*MockClusterManagerClient)(nil).Unseal), varargs...) } // UpdateLogStream mocks base method. func (m *MockClusterManagerClient) UpdateLogStream(arg0 context.Context, arg1 *UpdateLogStreamRequest, arg2 ...grpc.CallOption) (*UpdateLogStreamResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -550,9 +554,9 @@ func (m *MockClusterManagerClient) UpdateLogStream(arg0 context.Context, arg1 *U } // UpdateLogStream indicates an expected call of UpdateLogStream. -func (mr *MockClusterManagerClientMockRecorder) UpdateLogStream(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClusterManagerClientMockRecorder) UpdateLogStream(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateLogStream", reflect.TypeOf((*MockClusterManagerClient)(nil).UpdateLogStream), varargs...) } @@ -589,7 +593,7 @@ func (m *MockClusterManagerServer) AddLogStream(arg0 context.Context, arg1 *AddL } // AddLogStream indicates an expected call of AddLogStream. -func (mr *MockClusterManagerServerMockRecorder) AddLogStream(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) AddLogStream(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddLogStream", reflect.TypeOf((*MockClusterManagerServer)(nil).AddLogStream), arg0, arg1) } @@ -604,7 +608,7 @@ func (m *MockClusterManagerServer) AddMRPeer(arg0 context.Context, arg1 *AddMRPe } // AddMRPeer indicates an expected call of AddMRPeer. -func (mr *MockClusterManagerServerMockRecorder) AddMRPeer(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) AddMRPeer(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMRPeer", reflect.TypeOf((*MockClusterManagerServer)(nil).AddMRPeer), arg0, arg1) } @@ -619,7 +623,7 @@ func (m *MockClusterManagerServer) AddMetadataRepositoryNode(arg0 context.Contex } // AddMetadataRepositoryNode indicates an expected call of AddMetadataRepositoryNode. -func (mr *MockClusterManagerServerMockRecorder) AddMetadataRepositoryNode(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) AddMetadataRepositoryNode(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMetadataRepositoryNode", reflect.TypeOf((*MockClusterManagerServer)(nil).AddMetadataRepositoryNode), arg0, arg1) } @@ -634,7 +638,7 @@ func (m *MockClusterManagerServer) AddStorageNode(arg0 context.Context, arg1 *Ad } // AddStorageNode indicates an expected call of AddStorageNode. -func (mr *MockClusterManagerServerMockRecorder) AddStorageNode(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) AddStorageNode(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddStorageNode", reflect.TypeOf((*MockClusterManagerServer)(nil).AddStorageNode), arg0, arg1) } @@ -649,7 +653,7 @@ func (m *MockClusterManagerServer) AddTopic(arg0 context.Context, arg1 *AddTopic } // AddTopic indicates an expected call of AddTopic. -func (mr *MockClusterManagerServerMockRecorder) AddTopic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) AddTopic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddTopic", reflect.TypeOf((*MockClusterManagerServer)(nil).AddTopic), arg0, arg1) } @@ -664,7 +668,7 @@ func (m *MockClusterManagerServer) DeleteMetadataRepositoryNode(arg0 context.Con } // DeleteMetadataRepositoryNode indicates an expected call of DeleteMetadataRepositoryNode. -func (mr *MockClusterManagerServerMockRecorder) DeleteMetadataRepositoryNode(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) DeleteMetadataRepositoryNode(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteMetadataRepositoryNode", reflect.TypeOf((*MockClusterManagerServer)(nil).DeleteMetadataRepositoryNode), arg0, arg1) } @@ -679,7 +683,7 @@ func (m *MockClusterManagerServer) DescribeTopic(arg0 context.Context, arg1 *Des } // DescribeTopic indicates an expected call of DescribeTopic. -func (mr *MockClusterManagerServerMockRecorder) DescribeTopic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) DescribeTopic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTopic", reflect.TypeOf((*MockClusterManagerServer)(nil).DescribeTopic), arg0, arg1) } @@ -694,7 +698,7 @@ func (m *MockClusterManagerServer) GetLogStream(arg0 context.Context, arg1 *GetL } // GetLogStream indicates an expected call of GetLogStream. -func (mr *MockClusterManagerServerMockRecorder) GetLogStream(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) GetLogStream(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLogStream", reflect.TypeOf((*MockClusterManagerServer)(nil).GetLogStream), arg0, arg1) } @@ -709,7 +713,7 @@ func (m *MockClusterManagerServer) GetMRMembers(arg0 context.Context, arg1 *type } // GetMRMembers indicates an expected call of GetMRMembers. -func (mr *MockClusterManagerServerMockRecorder) GetMRMembers(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) GetMRMembers(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMRMembers", reflect.TypeOf((*MockClusterManagerServer)(nil).GetMRMembers), arg0, arg1) } @@ -724,7 +728,7 @@ func (m *MockClusterManagerServer) GetMetadataRepositoryNode(arg0 context.Contex } // GetMetadataRepositoryNode indicates an expected call of GetMetadataRepositoryNode. -func (mr *MockClusterManagerServerMockRecorder) GetMetadataRepositoryNode(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) GetMetadataRepositoryNode(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetadataRepositoryNode", reflect.TypeOf((*MockClusterManagerServer)(nil).GetMetadataRepositoryNode), arg0, arg1) } @@ -739,7 +743,7 @@ func (m *MockClusterManagerServer) GetStorageNode(arg0 context.Context, arg1 *Ge } // GetStorageNode indicates an expected call of GetStorageNode. -func (mr *MockClusterManagerServerMockRecorder) GetStorageNode(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) GetStorageNode(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageNode", reflect.TypeOf((*MockClusterManagerServer)(nil).GetStorageNode), arg0, arg1) } @@ -754,7 +758,7 @@ func (m *MockClusterManagerServer) GetTopic(arg0 context.Context, arg1 *GetTopic } // GetTopic indicates an expected call of GetTopic. -func (mr *MockClusterManagerServerMockRecorder) GetTopic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) GetTopic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTopic", reflect.TypeOf((*MockClusterManagerServer)(nil).GetTopic), arg0, arg1) } @@ -769,7 +773,7 @@ func (m *MockClusterManagerServer) ListLogStreams(arg0 context.Context, arg1 *Li } // ListLogStreams indicates an expected call of ListLogStreams. -func (mr *MockClusterManagerServerMockRecorder) ListLogStreams(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) ListLogStreams(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListLogStreams", reflect.TypeOf((*MockClusterManagerServer)(nil).ListLogStreams), arg0, arg1) } @@ -784,7 +788,7 @@ func (m *MockClusterManagerServer) ListMetadataRepositoryNodes(arg0 context.Cont } // ListMetadataRepositoryNodes indicates an expected call of ListMetadataRepositoryNodes. -func (mr *MockClusterManagerServerMockRecorder) ListMetadataRepositoryNodes(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) ListMetadataRepositoryNodes(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListMetadataRepositoryNodes", reflect.TypeOf((*MockClusterManagerServer)(nil).ListMetadataRepositoryNodes), arg0, arg1) } @@ -799,7 +803,7 @@ func (m *MockClusterManagerServer) ListStorageNodes(arg0 context.Context, arg1 * } // ListStorageNodes indicates an expected call of ListStorageNodes. -func (mr *MockClusterManagerServerMockRecorder) ListStorageNodes(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) ListStorageNodes(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListStorageNodes", reflect.TypeOf((*MockClusterManagerServer)(nil).ListStorageNodes), arg0, arg1) } @@ -814,7 +818,7 @@ func (m *MockClusterManagerServer) ListTopics(arg0 context.Context, arg1 *ListTo } // ListTopics indicates an expected call of ListTopics. -func (mr *MockClusterManagerServerMockRecorder) ListTopics(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) ListTopics(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListTopics", reflect.TypeOf((*MockClusterManagerServer)(nil).ListTopics), arg0, arg1) } @@ -829,7 +833,7 @@ func (m *MockClusterManagerServer) RemoveLogStreamReplica(arg0 context.Context, } // RemoveLogStreamReplica indicates an expected call of RemoveLogStreamReplica. -func (mr *MockClusterManagerServerMockRecorder) RemoveLogStreamReplica(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) RemoveLogStreamReplica(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveLogStreamReplica", reflect.TypeOf((*MockClusterManagerServer)(nil).RemoveLogStreamReplica), arg0, arg1) } @@ -844,7 +848,7 @@ func (m *MockClusterManagerServer) RemoveMRPeer(arg0 context.Context, arg1 *Remo } // RemoveMRPeer indicates an expected call of RemoveMRPeer. -func (mr *MockClusterManagerServerMockRecorder) RemoveMRPeer(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) RemoveMRPeer(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveMRPeer", reflect.TypeOf((*MockClusterManagerServer)(nil).RemoveMRPeer), arg0, arg1) } @@ -859,7 +863,7 @@ func (m *MockClusterManagerServer) Seal(arg0 context.Context, arg1 *SealRequest) } // Seal indicates an expected call of Seal. -func (mr *MockClusterManagerServerMockRecorder) Seal(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) Seal(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Seal", reflect.TypeOf((*MockClusterManagerServer)(nil).Seal), arg0, arg1) } @@ -874,7 +878,7 @@ func (m *MockClusterManagerServer) Sync(arg0 context.Context, arg1 *SyncRequest) } // Sync indicates an expected call of Sync. -func (mr *MockClusterManagerServerMockRecorder) Sync(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) Sync(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sync", reflect.TypeOf((*MockClusterManagerServer)(nil).Sync), arg0, arg1) } @@ -889,7 +893,7 @@ func (m *MockClusterManagerServer) Trim(arg0 context.Context, arg1 *TrimRequest) } // Trim indicates an expected call of Trim. -func (mr *MockClusterManagerServerMockRecorder) Trim(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) Trim(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trim", reflect.TypeOf((*MockClusterManagerServer)(nil).Trim), arg0, arg1) } @@ -904,7 +908,7 @@ func (m *MockClusterManagerServer) UnregisterLogStream(arg0 context.Context, arg } // UnregisterLogStream indicates an expected call of UnregisterLogStream. -func (mr *MockClusterManagerServerMockRecorder) UnregisterLogStream(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) UnregisterLogStream(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterLogStream", reflect.TypeOf((*MockClusterManagerServer)(nil).UnregisterLogStream), arg0, arg1) } @@ -919,7 +923,7 @@ func (m *MockClusterManagerServer) UnregisterStorageNode(arg0 context.Context, a } // UnregisterStorageNode indicates an expected call of UnregisterStorageNode. -func (mr *MockClusterManagerServerMockRecorder) UnregisterStorageNode(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) UnregisterStorageNode(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterStorageNode", reflect.TypeOf((*MockClusterManagerServer)(nil).UnregisterStorageNode), arg0, arg1) } @@ -934,7 +938,7 @@ func (m *MockClusterManagerServer) UnregisterTopic(arg0 context.Context, arg1 *U } // UnregisterTopic indicates an expected call of UnregisterTopic. -func (mr *MockClusterManagerServerMockRecorder) UnregisterTopic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) UnregisterTopic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterTopic", reflect.TypeOf((*MockClusterManagerServer)(nil).UnregisterTopic), arg0, arg1) } @@ -949,7 +953,7 @@ func (m *MockClusterManagerServer) Unseal(arg0 context.Context, arg1 *UnsealRequ } // Unseal indicates an expected call of Unseal. -func (mr *MockClusterManagerServerMockRecorder) Unseal(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) Unseal(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unseal", reflect.TypeOf((*MockClusterManagerServer)(nil).Unseal), arg0, arg1) } @@ -964,7 +968,7 @@ func (m *MockClusterManagerServer) UpdateLogStream(arg0 context.Context, arg1 *U } // UpdateLogStream indicates an expected call of UpdateLogStream. -func (mr *MockClusterManagerServerMockRecorder) UpdateLogStream(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClusterManagerServerMockRecorder) UpdateLogStream(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateLogStream", reflect.TypeOf((*MockClusterManagerServer)(nil).UpdateLogStream), arg0, arg1) } diff --git a/proto/mrpb/mock/mrpb_mock.go b/proto/mrpb/mock/mrpb_mock.go index 539e2795e..8232eab91 100644 --- a/proto/mrpb/mock/mrpb_mock.go +++ b/proto/mrpb/mock/mrpb_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kakao/varlog/proto/mrpb (interfaces: ManagementClient,ManagementServer,MetadataRepositoryServiceClient,MetadataRepositoryServiceServer) - +// +// Generated by this command: +// +// mockgen -build_flags -mod=vendor -package mock -destination mock/mrpb_mock.go . ManagementClient,ManagementServer,MetadataRepositoryServiceClient,MetadataRepositoryServiceServer +// // Package mock is a generated GoMock package. package mock @@ -9,7 +13,7 @@ import ( reflect "reflect" types "github.com/gogo/protobuf/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" mrpb "github.com/kakao/varlog/proto/mrpb" @@ -41,7 +45,7 @@ func (m *MockManagementClient) EXPECT() *MockManagementClientMockRecorder { // AddPeer mocks base method. func (m *MockManagementClient) AddPeer(arg0 context.Context, arg1 *mrpb.AddPeerRequest, arg2 ...grpc.CallOption) (*types.Empty, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -52,16 +56,16 @@ func (m *MockManagementClient) AddPeer(arg0 context.Context, arg1 *mrpb.AddPeerR } // AddPeer indicates an expected call of AddPeer. -func (mr *MockManagementClientMockRecorder) AddPeer(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockManagementClientMockRecorder) AddPeer(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddPeer", reflect.TypeOf((*MockManagementClient)(nil).AddPeer), varargs...) } // GetClusterInfo mocks base method. func (m *MockManagementClient) GetClusterInfo(arg0 context.Context, arg1 *mrpb.GetClusterInfoRequest, arg2 ...grpc.CallOption) (*mrpb.GetClusterInfoResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -72,16 +76,16 @@ func (m *MockManagementClient) GetClusterInfo(arg0 context.Context, arg1 *mrpb.G } // GetClusterInfo indicates an expected call of GetClusterInfo. -func (mr *MockManagementClientMockRecorder) GetClusterInfo(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockManagementClientMockRecorder) GetClusterInfo(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClusterInfo", reflect.TypeOf((*MockManagementClient)(nil).GetClusterInfo), varargs...) } // RemovePeer mocks base method. func (m *MockManagementClient) RemovePeer(arg0 context.Context, arg1 *mrpb.RemovePeerRequest, arg2 ...grpc.CallOption) (*types.Empty, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -92,9 +96,9 @@ func (m *MockManagementClient) RemovePeer(arg0 context.Context, arg1 *mrpb.Remov } // RemovePeer indicates an expected call of RemovePeer. -func (mr *MockManagementClientMockRecorder) RemovePeer(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockManagementClientMockRecorder) RemovePeer(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemovePeer", reflect.TypeOf((*MockManagementClient)(nil).RemovePeer), varargs...) } @@ -131,7 +135,7 @@ func (m *MockManagementServer) AddPeer(arg0 context.Context, arg1 *mrpb.AddPeerR } // AddPeer indicates an expected call of AddPeer. -func (mr *MockManagementServerMockRecorder) AddPeer(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagementServerMockRecorder) AddPeer(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddPeer", reflect.TypeOf((*MockManagementServer)(nil).AddPeer), arg0, arg1) } @@ -146,7 +150,7 @@ func (m *MockManagementServer) GetClusterInfo(arg0 context.Context, arg1 *mrpb.G } // GetClusterInfo indicates an expected call of GetClusterInfo. -func (mr *MockManagementServerMockRecorder) GetClusterInfo(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagementServerMockRecorder) GetClusterInfo(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClusterInfo", reflect.TypeOf((*MockManagementServer)(nil).GetClusterInfo), arg0, arg1) } @@ -161,7 +165,7 @@ func (m *MockManagementServer) RemovePeer(arg0 context.Context, arg1 *mrpb.Remov } // RemovePeer indicates an expected call of RemovePeer. -func (mr *MockManagementServerMockRecorder) RemovePeer(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagementServerMockRecorder) RemovePeer(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemovePeer", reflect.TypeOf((*MockManagementServer)(nil).RemovePeer), arg0, arg1) } @@ -192,7 +196,7 @@ func (m *MockMetadataRepositoryServiceClient) EXPECT() *MockMetadataRepositorySe // GetMetadata mocks base method. func (m *MockMetadataRepositoryServiceClient) GetMetadata(arg0 context.Context, arg1 *mrpb.GetMetadataRequest, arg2 ...grpc.CallOption) (*mrpb.GetMetadataResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -203,16 +207,16 @@ func (m *MockMetadataRepositoryServiceClient) GetMetadata(arg0 context.Context, } // GetMetadata indicates an expected call of GetMetadata. -func (mr *MockMetadataRepositoryServiceClientMockRecorder) GetMetadata(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceClientMockRecorder) GetMetadata(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetadata", reflect.TypeOf((*MockMetadataRepositoryServiceClient)(nil).GetMetadata), varargs...) } // RegisterLogStream mocks base method. func (m *MockMetadataRepositoryServiceClient) RegisterLogStream(arg0 context.Context, arg1 *mrpb.LogStreamRequest, arg2 ...grpc.CallOption) (*types.Empty, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -223,16 +227,16 @@ func (m *MockMetadataRepositoryServiceClient) RegisterLogStream(arg0 context.Con } // RegisterLogStream indicates an expected call of RegisterLogStream. -func (mr *MockMetadataRepositoryServiceClientMockRecorder) RegisterLogStream(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceClientMockRecorder) RegisterLogStream(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLogStream", reflect.TypeOf((*MockMetadataRepositoryServiceClient)(nil).RegisterLogStream), varargs...) } // RegisterStorageNode mocks base method. func (m *MockMetadataRepositoryServiceClient) RegisterStorageNode(arg0 context.Context, arg1 *mrpb.StorageNodeRequest, arg2 ...grpc.CallOption) (*types.Empty, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -243,16 +247,16 @@ func (m *MockMetadataRepositoryServiceClient) RegisterStorageNode(arg0 context.C } // RegisterStorageNode indicates an expected call of RegisterStorageNode. -func (mr *MockMetadataRepositoryServiceClientMockRecorder) RegisterStorageNode(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceClientMockRecorder) RegisterStorageNode(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterStorageNode", reflect.TypeOf((*MockMetadataRepositoryServiceClient)(nil).RegisterStorageNode), varargs...) } // RegisterTopic mocks base method. func (m *MockMetadataRepositoryServiceClient) RegisterTopic(arg0 context.Context, arg1 *mrpb.TopicRequest, arg2 ...grpc.CallOption) (*types.Empty, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -263,16 +267,16 @@ func (m *MockMetadataRepositoryServiceClient) RegisterTopic(arg0 context.Context } // RegisterTopic indicates an expected call of RegisterTopic. -func (mr *MockMetadataRepositoryServiceClientMockRecorder) RegisterTopic(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceClientMockRecorder) RegisterTopic(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterTopic", reflect.TypeOf((*MockMetadataRepositoryServiceClient)(nil).RegisterTopic), varargs...) } // Seal mocks base method. func (m *MockMetadataRepositoryServiceClient) Seal(arg0 context.Context, arg1 *mrpb.SealRequest, arg2 ...grpc.CallOption) (*mrpb.SealResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -283,16 +287,16 @@ func (m *MockMetadataRepositoryServiceClient) Seal(arg0 context.Context, arg1 *m } // Seal indicates an expected call of Seal. -func (mr *MockMetadataRepositoryServiceClientMockRecorder) Seal(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceClientMockRecorder) Seal(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Seal", reflect.TypeOf((*MockMetadataRepositoryServiceClient)(nil).Seal), varargs...) } // UnregisterLogStream mocks base method. func (m *MockMetadataRepositoryServiceClient) UnregisterLogStream(arg0 context.Context, arg1 *mrpb.LogStreamRequest, arg2 ...grpc.CallOption) (*types.Empty, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -303,16 +307,16 @@ func (m *MockMetadataRepositoryServiceClient) UnregisterLogStream(arg0 context.C } // UnregisterLogStream indicates an expected call of UnregisterLogStream. -func (mr *MockMetadataRepositoryServiceClientMockRecorder) UnregisterLogStream(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceClientMockRecorder) UnregisterLogStream(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterLogStream", reflect.TypeOf((*MockMetadataRepositoryServiceClient)(nil).UnregisterLogStream), varargs...) } // UnregisterStorageNode mocks base method. func (m *MockMetadataRepositoryServiceClient) UnregisterStorageNode(arg0 context.Context, arg1 *mrpb.StorageNodeRequest, arg2 ...grpc.CallOption) (*types.Empty, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -323,16 +327,16 @@ func (m *MockMetadataRepositoryServiceClient) UnregisterStorageNode(arg0 context } // UnregisterStorageNode indicates an expected call of UnregisterStorageNode. -func (mr *MockMetadataRepositoryServiceClientMockRecorder) UnregisterStorageNode(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceClientMockRecorder) UnregisterStorageNode(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterStorageNode", reflect.TypeOf((*MockMetadataRepositoryServiceClient)(nil).UnregisterStorageNode), varargs...) } // UnregisterTopic mocks base method. func (m *MockMetadataRepositoryServiceClient) UnregisterTopic(arg0 context.Context, arg1 *mrpb.TopicRequest, arg2 ...grpc.CallOption) (*types.Empty, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -343,16 +347,16 @@ func (m *MockMetadataRepositoryServiceClient) UnregisterTopic(arg0 context.Conte } // UnregisterTopic indicates an expected call of UnregisterTopic. -func (mr *MockMetadataRepositoryServiceClientMockRecorder) UnregisterTopic(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceClientMockRecorder) UnregisterTopic(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterTopic", reflect.TypeOf((*MockMetadataRepositoryServiceClient)(nil).UnregisterTopic), varargs...) } // Unseal mocks base method. func (m *MockMetadataRepositoryServiceClient) Unseal(arg0 context.Context, arg1 *mrpb.UnsealRequest, arg2 ...grpc.CallOption) (*mrpb.UnsealResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -363,16 +367,16 @@ func (m *MockMetadataRepositoryServiceClient) Unseal(arg0 context.Context, arg1 } // Unseal indicates an expected call of Unseal. -func (mr *MockMetadataRepositoryServiceClientMockRecorder) Unseal(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceClientMockRecorder) Unseal(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unseal", reflect.TypeOf((*MockMetadataRepositoryServiceClient)(nil).Unseal), varargs...) } // UpdateLogStream mocks base method. func (m *MockMetadataRepositoryServiceClient) UpdateLogStream(arg0 context.Context, arg1 *mrpb.LogStreamRequest, arg2 ...grpc.CallOption) (*types.Empty, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -383,9 +387,9 @@ func (m *MockMetadataRepositoryServiceClient) UpdateLogStream(arg0 context.Conte } // UpdateLogStream indicates an expected call of UpdateLogStream. -func (mr *MockMetadataRepositoryServiceClientMockRecorder) UpdateLogStream(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceClientMockRecorder) UpdateLogStream(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateLogStream", reflect.TypeOf((*MockMetadataRepositoryServiceClient)(nil).UpdateLogStream), varargs...) } @@ -422,7 +426,7 @@ func (m *MockMetadataRepositoryServiceServer) GetMetadata(arg0 context.Context, } // GetMetadata indicates an expected call of GetMetadata. -func (mr *MockMetadataRepositoryServiceServerMockRecorder) GetMetadata(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceServerMockRecorder) GetMetadata(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetadata", reflect.TypeOf((*MockMetadataRepositoryServiceServer)(nil).GetMetadata), arg0, arg1) } @@ -437,7 +441,7 @@ func (m *MockMetadataRepositoryServiceServer) RegisterLogStream(arg0 context.Con } // RegisterLogStream indicates an expected call of RegisterLogStream. -func (mr *MockMetadataRepositoryServiceServerMockRecorder) RegisterLogStream(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceServerMockRecorder) RegisterLogStream(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLogStream", reflect.TypeOf((*MockMetadataRepositoryServiceServer)(nil).RegisterLogStream), arg0, arg1) } @@ -452,7 +456,7 @@ func (m *MockMetadataRepositoryServiceServer) RegisterStorageNode(arg0 context.C } // RegisterStorageNode indicates an expected call of RegisterStorageNode. -func (mr *MockMetadataRepositoryServiceServerMockRecorder) RegisterStorageNode(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceServerMockRecorder) RegisterStorageNode(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterStorageNode", reflect.TypeOf((*MockMetadataRepositoryServiceServer)(nil).RegisterStorageNode), arg0, arg1) } @@ -467,7 +471,7 @@ func (m *MockMetadataRepositoryServiceServer) RegisterTopic(arg0 context.Context } // RegisterTopic indicates an expected call of RegisterTopic. -func (mr *MockMetadataRepositoryServiceServerMockRecorder) RegisterTopic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceServerMockRecorder) RegisterTopic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterTopic", reflect.TypeOf((*MockMetadataRepositoryServiceServer)(nil).RegisterTopic), arg0, arg1) } @@ -482,7 +486,7 @@ func (m *MockMetadataRepositoryServiceServer) Seal(arg0 context.Context, arg1 *m } // Seal indicates an expected call of Seal. -func (mr *MockMetadataRepositoryServiceServerMockRecorder) Seal(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceServerMockRecorder) Seal(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Seal", reflect.TypeOf((*MockMetadataRepositoryServiceServer)(nil).Seal), arg0, arg1) } @@ -497,7 +501,7 @@ func (m *MockMetadataRepositoryServiceServer) UnregisterLogStream(arg0 context.C } // UnregisterLogStream indicates an expected call of UnregisterLogStream. -func (mr *MockMetadataRepositoryServiceServerMockRecorder) UnregisterLogStream(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceServerMockRecorder) UnregisterLogStream(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterLogStream", reflect.TypeOf((*MockMetadataRepositoryServiceServer)(nil).UnregisterLogStream), arg0, arg1) } @@ -512,7 +516,7 @@ func (m *MockMetadataRepositoryServiceServer) UnregisterStorageNode(arg0 context } // UnregisterStorageNode indicates an expected call of UnregisterStorageNode. -func (mr *MockMetadataRepositoryServiceServerMockRecorder) UnregisterStorageNode(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceServerMockRecorder) UnregisterStorageNode(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterStorageNode", reflect.TypeOf((*MockMetadataRepositoryServiceServer)(nil).UnregisterStorageNode), arg0, arg1) } @@ -527,7 +531,7 @@ func (m *MockMetadataRepositoryServiceServer) UnregisterTopic(arg0 context.Conte } // UnregisterTopic indicates an expected call of UnregisterTopic. -func (mr *MockMetadataRepositoryServiceServerMockRecorder) UnregisterTopic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceServerMockRecorder) UnregisterTopic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterTopic", reflect.TypeOf((*MockMetadataRepositoryServiceServer)(nil).UnregisterTopic), arg0, arg1) } @@ -542,7 +546,7 @@ func (m *MockMetadataRepositoryServiceServer) Unseal(arg0 context.Context, arg1 } // Unseal indicates an expected call of Unseal. -func (mr *MockMetadataRepositoryServiceServerMockRecorder) Unseal(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceServerMockRecorder) Unseal(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unseal", reflect.TypeOf((*MockMetadataRepositoryServiceServer)(nil).Unseal), arg0, arg1) } @@ -557,7 +561,7 @@ func (m *MockMetadataRepositoryServiceServer) UpdateLogStream(arg0 context.Conte } // UpdateLogStream indicates an expected call of UpdateLogStream. -func (mr *MockMetadataRepositoryServiceServerMockRecorder) UpdateLogStream(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMetadataRepositoryServiceServerMockRecorder) UpdateLogStream(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateLogStream", reflect.TypeOf((*MockMetadataRepositoryServiceServer)(nil).UpdateLogStream), arg0, arg1) } diff --git a/proto/snpb/mock/snpb_mock.go b/proto/snpb/mock/snpb_mock.go index 962f536d9..068b8e9fe 100644 --- a/proto/snpb/mock/snpb_mock.go +++ b/proto/snpb/mock/snpb_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kakao/varlog/proto/snpb (interfaces: ReplicatorClient,ReplicatorServer,Replicator_ReplicateClient,LogIOClient,LogIOServer,LogIO_AppendClient,LogIO_SubscribeClient,LogIO_SubscribeServer,LogStreamReporterClient,LogStreamReporterServer,ManagementClient,ManagementServer) - +// +// Generated by this command: +// +// mockgen -build_flags -mod=vendor -package mock -destination mock/snpb_mock.go . ReplicatorClient,ReplicatorServer,Replicator_ReplicateClient,LogIOClient,LogIOServer,LogIO_AppendClient,LogIO_SubscribeClient,LogIO_SubscribeServer,LogStreamReporterClient,LogStreamReporterServer,ManagementClient,ManagementServer +// // Package mock is a generated GoMock package. package mock @@ -9,7 +13,7 @@ import ( reflect "reflect" types "github.com/gogo/protobuf/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" metadata "google.golang.org/grpc/metadata" @@ -42,7 +46,7 @@ func (m *MockReplicatorClient) EXPECT() *MockReplicatorClientMockRecorder { // Replicate mocks base method. func (m *MockReplicatorClient) Replicate(arg0 context.Context, arg1 ...grpc.CallOption) (snpb.Replicator_ReplicateClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -53,16 +57,16 @@ func (m *MockReplicatorClient) Replicate(arg0 context.Context, arg1 ...grpc.Call } // Replicate indicates an expected call of Replicate. -func (mr *MockReplicatorClientMockRecorder) Replicate(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockReplicatorClientMockRecorder) Replicate(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Replicate", reflect.TypeOf((*MockReplicatorClient)(nil).Replicate), varargs...) } // SyncInit mocks base method. func (m *MockReplicatorClient) SyncInit(arg0 context.Context, arg1 *snpb.SyncInitRequest, arg2 ...grpc.CallOption) (*snpb.SyncInitResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -73,16 +77,16 @@ func (m *MockReplicatorClient) SyncInit(arg0 context.Context, arg1 *snpb.SyncIni } // SyncInit indicates an expected call of SyncInit. -func (mr *MockReplicatorClientMockRecorder) SyncInit(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockReplicatorClientMockRecorder) SyncInit(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncInit", reflect.TypeOf((*MockReplicatorClient)(nil).SyncInit), varargs...) } // SyncReplicate mocks base method. func (m *MockReplicatorClient) SyncReplicate(arg0 context.Context, arg1 *snpb.SyncReplicateRequest, arg2 ...grpc.CallOption) (*snpb.SyncReplicateResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -93,16 +97,16 @@ func (m *MockReplicatorClient) SyncReplicate(arg0 context.Context, arg1 *snpb.Sy } // SyncReplicate indicates an expected call of SyncReplicate. -func (mr *MockReplicatorClientMockRecorder) SyncReplicate(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockReplicatorClientMockRecorder) SyncReplicate(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncReplicate", reflect.TypeOf((*MockReplicatorClient)(nil).SyncReplicate), varargs...) } // SyncReplicateStream mocks base method. func (m *MockReplicatorClient) SyncReplicateStream(arg0 context.Context, arg1 ...grpc.CallOption) (snpb.Replicator_SyncReplicateStreamClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -113,9 +117,9 @@ func (m *MockReplicatorClient) SyncReplicateStream(arg0 context.Context, arg1 .. } // SyncReplicateStream indicates an expected call of SyncReplicateStream. -func (mr *MockReplicatorClientMockRecorder) SyncReplicateStream(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockReplicatorClientMockRecorder) SyncReplicateStream(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncReplicateStream", reflect.TypeOf((*MockReplicatorClient)(nil).SyncReplicateStream), varargs...) } @@ -151,7 +155,7 @@ func (m *MockReplicatorServer) Replicate(arg0 snpb.Replicator_ReplicateServer) e } // Replicate indicates an expected call of Replicate. -func (mr *MockReplicatorServerMockRecorder) Replicate(arg0 interface{}) *gomock.Call { +func (mr *MockReplicatorServerMockRecorder) Replicate(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Replicate", reflect.TypeOf((*MockReplicatorServer)(nil).Replicate), arg0) } @@ -166,7 +170,7 @@ func (m *MockReplicatorServer) SyncInit(arg0 context.Context, arg1 *snpb.SyncIni } // SyncInit indicates an expected call of SyncInit. -func (mr *MockReplicatorServerMockRecorder) SyncInit(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockReplicatorServerMockRecorder) SyncInit(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncInit", reflect.TypeOf((*MockReplicatorServer)(nil).SyncInit), arg0, arg1) } @@ -181,7 +185,7 @@ func (m *MockReplicatorServer) SyncReplicate(arg0 context.Context, arg1 *snpb.Sy } // SyncReplicate indicates an expected call of SyncReplicate. -func (mr *MockReplicatorServerMockRecorder) SyncReplicate(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockReplicatorServerMockRecorder) SyncReplicate(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncReplicate", reflect.TypeOf((*MockReplicatorServer)(nil).SyncReplicate), arg0, arg1) } @@ -195,7 +199,7 @@ func (m *MockReplicatorServer) SyncReplicateStream(arg0 snpb.Replicator_SyncRepl } // SyncReplicateStream indicates an expected call of SyncReplicateStream. -func (mr *MockReplicatorServerMockRecorder) SyncReplicateStream(arg0 interface{}) *gomock.Call { +func (mr *MockReplicatorServerMockRecorder) SyncReplicateStream(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncReplicateStream", reflect.TypeOf((*MockReplicatorServer)(nil).SyncReplicateStream), arg0) } @@ -282,7 +286,7 @@ func (mr *MockReplicator_ReplicateClientMockRecorder) Header() *gomock.Call { } // RecvMsg mocks base method. -func (m *MockReplicator_ReplicateClient) RecvMsg(arg0 interface{}) error { +func (m *MockReplicator_ReplicateClient) RecvMsg(arg0 any) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RecvMsg", arg0) ret0, _ := ret[0].(error) @@ -290,7 +294,7 @@ func (m *MockReplicator_ReplicateClient) RecvMsg(arg0 interface{}) error { } // RecvMsg indicates an expected call of RecvMsg. -func (mr *MockReplicator_ReplicateClientMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call { +func (mr *MockReplicator_ReplicateClientMockRecorder) RecvMsg(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockReplicator_ReplicateClient)(nil).RecvMsg), arg0) } @@ -304,13 +308,13 @@ func (m *MockReplicator_ReplicateClient) Send(arg0 *snpb.ReplicateRequest) error } // Send indicates an expected call of Send. -func (mr *MockReplicator_ReplicateClientMockRecorder) Send(arg0 interface{}) *gomock.Call { +func (mr *MockReplicator_ReplicateClientMockRecorder) Send(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockReplicator_ReplicateClient)(nil).Send), arg0) } // SendMsg mocks base method. -func (m *MockReplicator_ReplicateClient) SendMsg(arg0 interface{}) error { +func (m *MockReplicator_ReplicateClient) SendMsg(arg0 any) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SendMsg", arg0) ret0, _ := ret[0].(error) @@ -318,7 +322,7 @@ func (m *MockReplicator_ReplicateClient) SendMsg(arg0 interface{}) error { } // SendMsg indicates an expected call of SendMsg. -func (mr *MockReplicator_ReplicateClientMockRecorder) SendMsg(arg0 interface{}) *gomock.Call { +func (mr *MockReplicator_ReplicateClientMockRecorder) SendMsg(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockReplicator_ReplicateClient)(nil).SendMsg), arg0) } @@ -363,7 +367,7 @@ func (m *MockLogIOClient) EXPECT() *MockLogIOClientMockRecorder { // Append mocks base method. func (m *MockLogIOClient) Append(arg0 context.Context, arg1 ...grpc.CallOption) (snpb.LogIO_AppendClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -374,16 +378,16 @@ func (m *MockLogIOClient) Append(arg0 context.Context, arg1 ...grpc.CallOption) } // Append indicates an expected call of Append. -func (mr *MockLogIOClientMockRecorder) Append(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockLogIOClientMockRecorder) Append(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Append", reflect.TypeOf((*MockLogIOClient)(nil).Append), varargs...) } // LogStreamReplicaMetadata mocks base method. func (m *MockLogIOClient) LogStreamReplicaMetadata(arg0 context.Context, arg1 *snpb.LogStreamReplicaMetadataRequest, arg2 ...grpc.CallOption) (*snpb.LogStreamReplicaMetadataResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -394,16 +398,16 @@ func (m *MockLogIOClient) LogStreamReplicaMetadata(arg0 context.Context, arg1 *s } // LogStreamReplicaMetadata indicates an expected call of LogStreamReplicaMetadata. -func (mr *MockLogIOClientMockRecorder) LogStreamReplicaMetadata(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockLogIOClientMockRecorder) LogStreamReplicaMetadata(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LogStreamReplicaMetadata", reflect.TypeOf((*MockLogIOClient)(nil).LogStreamReplicaMetadata), varargs...) } // Read mocks base method. func (m *MockLogIOClient) Read(arg0 context.Context, arg1 *snpb.ReadRequest, arg2 ...grpc.CallOption) (*snpb.ReadResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -414,16 +418,16 @@ func (m *MockLogIOClient) Read(arg0 context.Context, arg1 *snpb.ReadRequest, arg } // Read indicates an expected call of Read. -func (mr *MockLogIOClientMockRecorder) Read(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockLogIOClientMockRecorder) Read(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockLogIOClient)(nil).Read), varargs...) } // Subscribe mocks base method. func (m *MockLogIOClient) Subscribe(arg0 context.Context, arg1 *snpb.SubscribeRequest, arg2 ...grpc.CallOption) (snpb.LogIO_SubscribeClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -434,16 +438,16 @@ func (m *MockLogIOClient) Subscribe(arg0 context.Context, arg1 *snpb.SubscribeRe } // Subscribe indicates an expected call of Subscribe. -func (mr *MockLogIOClientMockRecorder) Subscribe(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockLogIOClientMockRecorder) Subscribe(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subscribe", reflect.TypeOf((*MockLogIOClient)(nil).Subscribe), varargs...) } // SubscribeTo mocks base method. func (m *MockLogIOClient) SubscribeTo(arg0 context.Context, arg1 *snpb.SubscribeToRequest, arg2 ...grpc.CallOption) (snpb.LogIO_SubscribeToClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -454,16 +458,16 @@ func (m *MockLogIOClient) SubscribeTo(arg0 context.Context, arg1 *snpb.Subscribe } // SubscribeTo indicates an expected call of SubscribeTo. -func (mr *MockLogIOClientMockRecorder) SubscribeTo(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockLogIOClientMockRecorder) SubscribeTo(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeTo", reflect.TypeOf((*MockLogIOClient)(nil).SubscribeTo), varargs...) } // TrimDeprecated mocks base method. func (m *MockLogIOClient) TrimDeprecated(arg0 context.Context, arg1 *snpb.TrimDeprecatedRequest, arg2 ...grpc.CallOption) (*types.Empty, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -474,9 +478,9 @@ func (m *MockLogIOClient) TrimDeprecated(arg0 context.Context, arg1 *snpb.TrimDe } // TrimDeprecated indicates an expected call of TrimDeprecated. -func (mr *MockLogIOClientMockRecorder) TrimDeprecated(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockLogIOClientMockRecorder) TrimDeprecated(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TrimDeprecated", reflect.TypeOf((*MockLogIOClient)(nil).TrimDeprecated), varargs...) } @@ -512,7 +516,7 @@ func (m *MockLogIOServer) Append(arg0 snpb.LogIO_AppendServer) error { } // Append indicates an expected call of Append. -func (mr *MockLogIOServerMockRecorder) Append(arg0 interface{}) *gomock.Call { +func (mr *MockLogIOServerMockRecorder) Append(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Append", reflect.TypeOf((*MockLogIOServer)(nil).Append), arg0) } @@ -527,7 +531,7 @@ func (m *MockLogIOServer) LogStreamReplicaMetadata(arg0 context.Context, arg1 *s } // LogStreamReplicaMetadata indicates an expected call of LogStreamReplicaMetadata. -func (mr *MockLogIOServerMockRecorder) LogStreamReplicaMetadata(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockLogIOServerMockRecorder) LogStreamReplicaMetadata(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LogStreamReplicaMetadata", reflect.TypeOf((*MockLogIOServer)(nil).LogStreamReplicaMetadata), arg0, arg1) } @@ -542,7 +546,7 @@ func (m *MockLogIOServer) Read(arg0 context.Context, arg1 *snpb.ReadRequest) (*s } // Read indicates an expected call of Read. -func (mr *MockLogIOServerMockRecorder) Read(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockLogIOServerMockRecorder) Read(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockLogIOServer)(nil).Read), arg0, arg1) } @@ -556,7 +560,7 @@ func (m *MockLogIOServer) Subscribe(arg0 *snpb.SubscribeRequest, arg1 snpb.LogIO } // Subscribe indicates an expected call of Subscribe. -func (mr *MockLogIOServerMockRecorder) Subscribe(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockLogIOServerMockRecorder) Subscribe(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subscribe", reflect.TypeOf((*MockLogIOServer)(nil).Subscribe), arg0, arg1) } @@ -570,7 +574,7 @@ func (m *MockLogIOServer) SubscribeTo(arg0 *snpb.SubscribeToRequest, arg1 snpb.L } // SubscribeTo indicates an expected call of SubscribeTo. -func (mr *MockLogIOServerMockRecorder) SubscribeTo(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockLogIOServerMockRecorder) SubscribeTo(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeTo", reflect.TypeOf((*MockLogIOServer)(nil).SubscribeTo), arg0, arg1) } @@ -585,7 +589,7 @@ func (m *MockLogIOServer) TrimDeprecated(arg0 context.Context, arg1 *snpb.TrimDe } // TrimDeprecated indicates an expected call of TrimDeprecated. -func (mr *MockLogIOServerMockRecorder) TrimDeprecated(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockLogIOServerMockRecorder) TrimDeprecated(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TrimDeprecated", reflect.TypeOf((*MockLogIOServer)(nil).TrimDeprecated), arg0, arg1) } @@ -672,7 +676,7 @@ func (mr *MockLogIO_AppendClientMockRecorder) Recv() *gomock.Call { } // RecvMsg mocks base method. -func (m *MockLogIO_AppendClient) RecvMsg(arg0 interface{}) error { +func (m *MockLogIO_AppendClient) RecvMsg(arg0 any) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RecvMsg", arg0) ret0, _ := ret[0].(error) @@ -680,7 +684,7 @@ func (m *MockLogIO_AppendClient) RecvMsg(arg0 interface{}) error { } // RecvMsg indicates an expected call of RecvMsg. -func (mr *MockLogIO_AppendClientMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call { +func (mr *MockLogIO_AppendClientMockRecorder) RecvMsg(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockLogIO_AppendClient)(nil).RecvMsg), arg0) } @@ -694,13 +698,13 @@ func (m *MockLogIO_AppendClient) Send(arg0 *snpb.AppendRequest) error { } // Send indicates an expected call of Send. -func (mr *MockLogIO_AppendClientMockRecorder) Send(arg0 interface{}) *gomock.Call { +func (mr *MockLogIO_AppendClientMockRecorder) Send(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockLogIO_AppendClient)(nil).Send), arg0) } // SendMsg mocks base method. -func (m *MockLogIO_AppendClient) SendMsg(arg0 interface{}) error { +func (m *MockLogIO_AppendClient) SendMsg(arg0 any) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SendMsg", arg0) ret0, _ := ret[0].(error) @@ -708,7 +712,7 @@ func (m *MockLogIO_AppendClient) SendMsg(arg0 interface{}) error { } // SendMsg indicates an expected call of SendMsg. -func (mr *MockLogIO_AppendClientMockRecorder) SendMsg(arg0 interface{}) *gomock.Call { +func (mr *MockLogIO_AppendClientMockRecorder) SendMsg(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockLogIO_AppendClient)(nil).SendMsg), arg0) } @@ -809,7 +813,7 @@ func (mr *MockLogIO_SubscribeClientMockRecorder) Recv() *gomock.Call { } // RecvMsg mocks base method. -func (m *MockLogIO_SubscribeClient) RecvMsg(arg0 interface{}) error { +func (m *MockLogIO_SubscribeClient) RecvMsg(arg0 any) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RecvMsg", arg0) ret0, _ := ret[0].(error) @@ -817,13 +821,13 @@ func (m *MockLogIO_SubscribeClient) RecvMsg(arg0 interface{}) error { } // RecvMsg indicates an expected call of RecvMsg. -func (mr *MockLogIO_SubscribeClientMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call { +func (mr *MockLogIO_SubscribeClientMockRecorder) RecvMsg(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockLogIO_SubscribeClient)(nil).RecvMsg), arg0) } // SendMsg mocks base method. -func (m *MockLogIO_SubscribeClient) SendMsg(arg0 interface{}) error { +func (m *MockLogIO_SubscribeClient) SendMsg(arg0 any) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SendMsg", arg0) ret0, _ := ret[0].(error) @@ -831,7 +835,7 @@ func (m *MockLogIO_SubscribeClient) SendMsg(arg0 interface{}) error { } // SendMsg indicates an expected call of SendMsg. -func (mr *MockLogIO_SubscribeClientMockRecorder) SendMsg(arg0 interface{}) *gomock.Call { +func (mr *MockLogIO_SubscribeClientMockRecorder) SendMsg(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockLogIO_SubscribeClient)(nil).SendMsg), arg0) } @@ -888,7 +892,7 @@ func (mr *MockLogIO_SubscribeServerMockRecorder) Context() *gomock.Call { } // RecvMsg mocks base method. -func (m *MockLogIO_SubscribeServer) RecvMsg(arg0 interface{}) error { +func (m *MockLogIO_SubscribeServer) RecvMsg(arg0 any) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RecvMsg", arg0) ret0, _ := ret[0].(error) @@ -896,7 +900,7 @@ func (m *MockLogIO_SubscribeServer) RecvMsg(arg0 interface{}) error { } // RecvMsg indicates an expected call of RecvMsg. -func (mr *MockLogIO_SubscribeServerMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call { +func (mr *MockLogIO_SubscribeServerMockRecorder) RecvMsg(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockLogIO_SubscribeServer)(nil).RecvMsg), arg0) } @@ -910,7 +914,7 @@ func (m *MockLogIO_SubscribeServer) Send(arg0 *snpb.SubscribeResponse) error { } // Send indicates an expected call of Send. -func (mr *MockLogIO_SubscribeServerMockRecorder) Send(arg0 interface{}) *gomock.Call { +func (mr *MockLogIO_SubscribeServerMockRecorder) Send(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockLogIO_SubscribeServer)(nil).Send), arg0) } @@ -924,13 +928,13 @@ func (m *MockLogIO_SubscribeServer) SendHeader(arg0 metadata.MD) error { } // SendHeader indicates an expected call of SendHeader. -func (mr *MockLogIO_SubscribeServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call { +func (mr *MockLogIO_SubscribeServerMockRecorder) SendHeader(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockLogIO_SubscribeServer)(nil).SendHeader), arg0) } // SendMsg mocks base method. -func (m *MockLogIO_SubscribeServer) SendMsg(arg0 interface{}) error { +func (m *MockLogIO_SubscribeServer) SendMsg(arg0 any) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SendMsg", arg0) ret0, _ := ret[0].(error) @@ -938,7 +942,7 @@ func (m *MockLogIO_SubscribeServer) SendMsg(arg0 interface{}) error { } // SendMsg indicates an expected call of SendMsg. -func (mr *MockLogIO_SubscribeServerMockRecorder) SendMsg(arg0 interface{}) *gomock.Call { +func (mr *MockLogIO_SubscribeServerMockRecorder) SendMsg(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockLogIO_SubscribeServer)(nil).SendMsg), arg0) } @@ -952,7 +956,7 @@ func (m *MockLogIO_SubscribeServer) SetHeader(arg0 metadata.MD) error { } // SetHeader indicates an expected call of SetHeader. -func (mr *MockLogIO_SubscribeServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call { +func (mr *MockLogIO_SubscribeServerMockRecorder) SetHeader(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockLogIO_SubscribeServer)(nil).SetHeader), arg0) } @@ -964,7 +968,7 @@ func (m *MockLogIO_SubscribeServer) SetTrailer(arg0 metadata.MD) { } // SetTrailer indicates an expected call of SetTrailer. -func (mr *MockLogIO_SubscribeServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call { +func (mr *MockLogIO_SubscribeServerMockRecorder) SetTrailer(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockLogIO_SubscribeServer)(nil).SetTrailer), arg0) } @@ -995,7 +999,7 @@ func (m *MockLogStreamReporterClient) EXPECT() *MockLogStreamReporterClientMockR // Commit mocks base method. func (m *MockLogStreamReporterClient) Commit(arg0 context.Context, arg1 ...grpc.CallOption) (snpb.LogStreamReporter_CommitClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -1006,16 +1010,16 @@ func (m *MockLogStreamReporterClient) Commit(arg0 context.Context, arg1 ...grpc. } // Commit indicates an expected call of Commit. -func (mr *MockLogStreamReporterClientMockRecorder) Commit(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockLogStreamReporterClientMockRecorder) Commit(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Commit", reflect.TypeOf((*MockLogStreamReporterClient)(nil).Commit), varargs...) } // CommitBatch mocks base method. func (m *MockLogStreamReporterClient) CommitBatch(arg0 context.Context, arg1 ...grpc.CallOption) (snpb.LogStreamReporter_CommitBatchClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -1026,16 +1030,16 @@ func (m *MockLogStreamReporterClient) CommitBatch(arg0 context.Context, arg1 ... } // CommitBatch indicates an expected call of CommitBatch. -func (mr *MockLogStreamReporterClientMockRecorder) CommitBatch(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockLogStreamReporterClientMockRecorder) CommitBatch(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitBatch", reflect.TypeOf((*MockLogStreamReporterClient)(nil).CommitBatch), varargs...) } // GetReport mocks base method. func (m *MockLogStreamReporterClient) GetReport(arg0 context.Context, arg1 ...grpc.CallOption) (snpb.LogStreamReporter_GetReportClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -1046,9 +1050,9 @@ func (m *MockLogStreamReporterClient) GetReport(arg0 context.Context, arg1 ...gr } // GetReport indicates an expected call of GetReport. -func (mr *MockLogStreamReporterClientMockRecorder) GetReport(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockLogStreamReporterClientMockRecorder) GetReport(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetReport", reflect.TypeOf((*MockLogStreamReporterClient)(nil).GetReport), varargs...) } @@ -1084,7 +1088,7 @@ func (m *MockLogStreamReporterServer) Commit(arg0 snpb.LogStreamReporter_CommitS } // Commit indicates an expected call of Commit. -func (mr *MockLogStreamReporterServerMockRecorder) Commit(arg0 interface{}) *gomock.Call { +func (mr *MockLogStreamReporterServerMockRecorder) Commit(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Commit", reflect.TypeOf((*MockLogStreamReporterServer)(nil).Commit), arg0) } @@ -1098,7 +1102,7 @@ func (m *MockLogStreamReporterServer) CommitBatch(arg0 snpb.LogStreamReporter_Co } // CommitBatch indicates an expected call of CommitBatch. -func (mr *MockLogStreamReporterServerMockRecorder) CommitBatch(arg0 interface{}) *gomock.Call { +func (mr *MockLogStreamReporterServerMockRecorder) CommitBatch(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitBatch", reflect.TypeOf((*MockLogStreamReporterServer)(nil).CommitBatch), arg0) } @@ -1112,7 +1116,7 @@ func (m *MockLogStreamReporterServer) GetReport(arg0 snpb.LogStreamReporter_GetR } // GetReport indicates an expected call of GetReport. -func (mr *MockLogStreamReporterServerMockRecorder) GetReport(arg0 interface{}) *gomock.Call { +func (mr *MockLogStreamReporterServerMockRecorder) GetReport(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetReport", reflect.TypeOf((*MockLogStreamReporterServer)(nil).GetReport), arg0) } @@ -1143,7 +1147,7 @@ func (m *MockManagementClient) EXPECT() *MockManagementClientMockRecorder { // AddLogStreamReplica mocks base method. func (m *MockManagementClient) AddLogStreamReplica(arg0 context.Context, arg1 *snpb.AddLogStreamReplicaRequest, arg2 ...grpc.CallOption) (*snpb.AddLogStreamReplicaResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -1154,16 +1158,16 @@ func (m *MockManagementClient) AddLogStreamReplica(arg0 context.Context, arg1 *s } // AddLogStreamReplica indicates an expected call of AddLogStreamReplica. -func (mr *MockManagementClientMockRecorder) AddLogStreamReplica(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockManagementClientMockRecorder) AddLogStreamReplica(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddLogStreamReplica", reflect.TypeOf((*MockManagementClient)(nil).AddLogStreamReplica), varargs...) } // GetMetadata mocks base method. func (m *MockManagementClient) GetMetadata(arg0 context.Context, arg1 *snpb.GetMetadataRequest, arg2 ...grpc.CallOption) (*snpb.GetMetadataResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -1174,16 +1178,16 @@ func (m *MockManagementClient) GetMetadata(arg0 context.Context, arg1 *snpb.GetM } // GetMetadata indicates an expected call of GetMetadata. -func (mr *MockManagementClientMockRecorder) GetMetadata(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockManagementClientMockRecorder) GetMetadata(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetadata", reflect.TypeOf((*MockManagementClient)(nil).GetMetadata), varargs...) } // RemoveLogStream mocks base method. func (m *MockManagementClient) RemoveLogStream(arg0 context.Context, arg1 *snpb.RemoveLogStreamRequest, arg2 ...grpc.CallOption) (*types.Empty, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -1194,16 +1198,16 @@ func (m *MockManagementClient) RemoveLogStream(arg0 context.Context, arg1 *snpb. } // RemoveLogStream indicates an expected call of RemoveLogStream. -func (mr *MockManagementClientMockRecorder) RemoveLogStream(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockManagementClientMockRecorder) RemoveLogStream(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveLogStream", reflect.TypeOf((*MockManagementClient)(nil).RemoveLogStream), varargs...) } // Seal mocks base method. func (m *MockManagementClient) Seal(arg0 context.Context, arg1 *snpb.SealRequest, arg2 ...grpc.CallOption) (*snpb.SealResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -1214,16 +1218,16 @@ func (m *MockManagementClient) Seal(arg0 context.Context, arg1 *snpb.SealRequest } // Seal indicates an expected call of Seal. -func (mr *MockManagementClientMockRecorder) Seal(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockManagementClientMockRecorder) Seal(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Seal", reflect.TypeOf((*MockManagementClient)(nil).Seal), varargs...) } // Sync mocks base method. func (m *MockManagementClient) Sync(arg0 context.Context, arg1 *snpb.SyncRequest, arg2 ...grpc.CallOption) (*snpb.SyncResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -1234,16 +1238,16 @@ func (m *MockManagementClient) Sync(arg0 context.Context, arg1 *snpb.SyncRequest } // Sync indicates an expected call of Sync. -func (mr *MockManagementClientMockRecorder) Sync(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockManagementClientMockRecorder) Sync(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sync", reflect.TypeOf((*MockManagementClient)(nil).Sync), varargs...) } // Trim mocks base method. func (m *MockManagementClient) Trim(arg0 context.Context, arg1 *snpb.TrimRequest, arg2 ...grpc.CallOption) (*snpb.TrimResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -1254,16 +1258,16 @@ func (m *MockManagementClient) Trim(arg0 context.Context, arg1 *snpb.TrimRequest } // Trim indicates an expected call of Trim. -func (mr *MockManagementClientMockRecorder) Trim(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockManagementClientMockRecorder) Trim(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trim", reflect.TypeOf((*MockManagementClient)(nil).Trim), varargs...) } // Unseal mocks base method. func (m *MockManagementClient) Unseal(arg0 context.Context, arg1 *snpb.UnsealRequest, arg2 ...grpc.CallOption) (*types.Empty, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -1274,9 +1278,9 @@ func (m *MockManagementClient) Unseal(arg0 context.Context, arg1 *snpb.UnsealReq } // Unseal indicates an expected call of Unseal. -func (mr *MockManagementClientMockRecorder) Unseal(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockManagementClientMockRecorder) Unseal(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unseal", reflect.TypeOf((*MockManagementClient)(nil).Unseal), varargs...) } @@ -1313,7 +1317,7 @@ func (m *MockManagementServer) AddLogStreamReplica(arg0 context.Context, arg1 *s } // AddLogStreamReplica indicates an expected call of AddLogStreamReplica. -func (mr *MockManagementServerMockRecorder) AddLogStreamReplica(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagementServerMockRecorder) AddLogStreamReplica(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddLogStreamReplica", reflect.TypeOf((*MockManagementServer)(nil).AddLogStreamReplica), arg0, arg1) } @@ -1328,7 +1332,7 @@ func (m *MockManagementServer) GetMetadata(arg0 context.Context, arg1 *snpb.GetM } // GetMetadata indicates an expected call of GetMetadata. -func (mr *MockManagementServerMockRecorder) GetMetadata(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagementServerMockRecorder) GetMetadata(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetadata", reflect.TypeOf((*MockManagementServer)(nil).GetMetadata), arg0, arg1) } @@ -1343,7 +1347,7 @@ func (m *MockManagementServer) RemoveLogStream(arg0 context.Context, arg1 *snpb. } // RemoveLogStream indicates an expected call of RemoveLogStream. -func (mr *MockManagementServerMockRecorder) RemoveLogStream(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagementServerMockRecorder) RemoveLogStream(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveLogStream", reflect.TypeOf((*MockManagementServer)(nil).RemoveLogStream), arg0, arg1) } @@ -1358,7 +1362,7 @@ func (m *MockManagementServer) Seal(arg0 context.Context, arg1 *snpb.SealRequest } // Seal indicates an expected call of Seal. -func (mr *MockManagementServerMockRecorder) Seal(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagementServerMockRecorder) Seal(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Seal", reflect.TypeOf((*MockManagementServer)(nil).Seal), arg0, arg1) } @@ -1373,7 +1377,7 @@ func (m *MockManagementServer) Sync(arg0 context.Context, arg1 *snpb.SyncRequest } // Sync indicates an expected call of Sync. -func (mr *MockManagementServerMockRecorder) Sync(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagementServerMockRecorder) Sync(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sync", reflect.TypeOf((*MockManagementServer)(nil).Sync), arg0, arg1) } @@ -1388,7 +1392,7 @@ func (m *MockManagementServer) Trim(arg0 context.Context, arg1 *snpb.TrimRequest } // Trim indicates an expected call of Trim. -func (mr *MockManagementServerMockRecorder) Trim(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagementServerMockRecorder) Trim(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trim", reflect.TypeOf((*MockManagementServer)(nil).Trim), arg0, arg1) } @@ -1403,7 +1407,7 @@ func (m *MockManagementServer) Unseal(arg0 context.Context, arg1 *snpb.UnsealReq } // Unseal indicates an expected call of Unseal. -func (mr *MockManagementServerMockRecorder) Unseal(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagementServerMockRecorder) Unseal(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unseal", reflect.TypeOf((*MockManagementServer)(nil).Unseal), arg0, arg1) } diff --git a/tools/tools.go b/tools/tools.go index 89b45d086..578c145c1 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -4,7 +4,7 @@ package tools import ( - _ "github.com/golang/mock/gomock" + _ "go.uber.org/mock/gomock" _ "golang.org/x/lint/golint" _ "golang.org/x/tools/cmd/goimports" _ "golang.org/x/tools/cmd/stringer" diff --git a/vendor/github.com/golang/mock/AUTHORS b/vendor/go.uber.org/mock/AUTHORS similarity index 100% rename from vendor/github.com/golang/mock/AUTHORS rename to vendor/go.uber.org/mock/AUTHORS diff --git a/vendor/github.com/golang/mock/CONTRIBUTORS b/vendor/go.uber.org/mock/CONTRIBUTORS similarity index 100% rename from vendor/github.com/golang/mock/CONTRIBUTORS rename to vendor/go.uber.org/mock/CONTRIBUTORS diff --git a/vendor/github.com/golang/mock/LICENSE b/vendor/go.uber.org/mock/LICENSE similarity index 100% rename from vendor/github.com/golang/mock/LICENSE rename to vendor/go.uber.org/mock/LICENSE diff --git a/vendor/github.com/golang/mock/gomock/call.go b/vendor/go.uber.org/mock/gomock/call.go similarity index 78% rename from vendor/github.com/golang/mock/gomock/call.go rename to vendor/go.uber.org/mock/gomock/call.go index 13c9f44b1..e1ea82637 100644 --- a/vendor/github.com/golang/mock/gomock/call.go +++ b/vendor/go.uber.org/mock/gomock/call.go @@ -25,7 +25,7 @@ import ( type Call struct { t TestHelper // for triggering test failures on invalid call setup - receiver interface{} // the receiver of the method call + receiver any // the receiver of the method call method string // the name of the method methodType reflect.Type // the type of the method args []Matcher // the args @@ -41,12 +41,12 @@ type Call struct { // actions are called when this Call is called. Each action gets the args and // can set the return values by returning a non-nil slice. Actions run in the // order they are created. - actions []func([]interface{}) []interface{} + actions []func([]any) []any } // newCall creates a *Call. It requires the method type in order to support // unexported methods. -func newCall(t TestHelper, receiver interface{}, method string, methodType reflect.Type, args ...interface{}) *Call { +func newCall(t TestHelper, receiver any, method string, methodType reflect.Type, args ...any) *Call { t.Helper() // TODO: check arity, types. @@ -67,9 +67,9 @@ func newCall(t TestHelper, receiver interface{}, method string, methodType refle // and this line changes, i.e. this code is wrapped in another anonymous function. // 0 is us, 1 is RecordCallWithMethodType(), 2 is the generated recorder, and 3 is the user's test. origin := callerInfo(3) - actions := []func([]interface{}) []interface{}{func([]interface{}) []interface{} { + actions := []func([]any) []any{func([]any) []any { // Synthesize the zero value for each of the return args' types. - rets := make([]interface{}, methodType.NumOut()) + rets := make([]any, methodType.NumOut()) for i := 0; i < methodType.NumOut(); i++ { rets[i] = reflect.Zero(methodType.Out(i)).Interface() } @@ -107,20 +107,26 @@ func (c *Call) MaxTimes(n int) *Call { // DoAndReturn declares the action to run when the call is matched. // The return values from this function are returned by the mocked function. -// It takes an interface{} argument to support n-arity functions. -func (c *Call) DoAndReturn(f interface{}) *Call { +// It takes an any argument to support n-arity functions. +// The anonymous function must match the function signature mocked method. +func (c *Call) DoAndReturn(f any) *Call { // TODO: Check arity and types here, rather than dying badly elsewhere. v := reflect.ValueOf(f) - c.addAction(func(args []interface{}) []interface{} { + c.addAction(func(args []any) []any { c.t.Helper() - vArgs := make([]reflect.Value, len(args)) ft := v.Type() if c.methodType.NumIn() != ft.NumIn() { - c.t.Fatalf("wrong number of arguments in DoAndReturn func for %T.%v: got %d, want %d [%s]", - c.receiver, c.method, ft.NumIn(), c.methodType.NumIn(), c.origin) + if ft.IsVariadic() { + c.t.Fatalf("wrong number of arguments in DoAndReturn func for %T.%v The function signature must match the mocked method, a variadic function cannot be used.", + c.receiver, c.method) + } else { + c.t.Fatalf("wrong number of arguments in DoAndReturn func for %T.%v: got %d, want %d [%s]", + c.receiver, c.method, ft.NumIn(), c.methodType.NumIn(), c.origin) + } return nil } + vArgs := make([]reflect.Value, len(args)) for i := 0; i < len(args); i++ { if args[i] != nil { vArgs[i] = reflect.ValueOf(args[i]) @@ -130,7 +136,7 @@ func (c *Call) DoAndReturn(f interface{}) *Call { } } vRets := v.Call(vArgs) - rets := make([]interface{}, len(vRets)) + rets := make([]any, len(vRets)) for i, ret := range vRets { rets[i] = ret.Interface() } @@ -142,20 +148,26 @@ func (c *Call) DoAndReturn(f interface{}) *Call { // Do declares the action to run when the call is matched. The function's // return values are ignored to retain backward compatibility. To use the // return values call DoAndReturn. -// It takes an interface{} argument to support n-arity functions. -func (c *Call) Do(f interface{}) *Call { +// It takes an any argument to support n-arity functions. +// The anonymous function must match the function signature mocked method. +func (c *Call) Do(f any) *Call { // TODO: Check arity and types here, rather than dying badly elsewhere. v := reflect.ValueOf(f) - c.addAction(func(args []interface{}) []interface{} { + c.addAction(func(args []any) []any { c.t.Helper() - if c.methodType.NumIn() != v.Type().NumIn() { - c.t.Fatalf("wrong number of arguments in Do func for %T.%v: got %d, want %d [%s]", - c.receiver, c.method, v.Type().NumIn(), c.methodType.NumIn(), c.origin) + ft := v.Type() + if c.methodType.NumIn() != ft.NumIn() { + if ft.IsVariadic() { + c.t.Fatalf("wrong number of arguments in Do func for %T.%v The function signature must match the mocked method, a variadic function cannot be used.", + c.receiver, c.method) + } else { + c.t.Fatalf("wrong number of arguments in Do func for %T.%v: got %d, want %d [%s]", + c.receiver, c.method, ft.NumIn(), c.methodType.NumIn(), c.origin) + } return nil } vArgs := make([]reflect.Value, len(args)) - ft := v.Type() for i := 0; i < len(args); i++ { if args[i] != nil { vArgs[i] = reflect.ValueOf(args[i]) @@ -171,7 +183,7 @@ func (c *Call) Do(f interface{}) *Call { } // Return declares the values to be returned by the mocked function call. -func (c *Call) Return(rets ...interface{}) *Call { +func (c *Call) Return(rets ...any) *Call { c.t.Helper() mt := c.methodType @@ -203,7 +215,7 @@ func (c *Call) Return(rets ...interface{}) *Call { } } - c.addAction(func([]interface{}) []interface{} { + c.addAction(func([]any) []any { return rets }) @@ -217,9 +229,9 @@ func (c *Call) Times(n int) *Call { } // SetArg declares an action that will set the nth argument's value, -// indirected through a pointer. Or, in the case of a slice, SetArg -// will copy value's elements into the nth argument. -func (c *Call) SetArg(n int, value interface{}) *Call { +// indirected through a pointer. Or, in the case of a slice and map, SetArg +// will copy value's elements/key-value pairs into the nth argument. +func (c *Call) SetArg(n int, value any) *Call { c.t.Helper() mt := c.methodType @@ -243,16 +255,20 @@ func (c *Call) SetArg(n int, value interface{}) *Call { // nothing to do case reflect.Slice: // nothing to do + case reflect.Map: + // nothing to do default: - c.t.Fatalf("SetArg(%d, ...) referring to argument of non-pointer non-interface non-slice type %v [%s]", + c.t.Fatalf("SetArg(%d, ...) referring to argument of non-pointer non-interface non-slice non-map type %v [%s]", n, at, c.origin) } - c.addAction(func(args []interface{}) []interface{} { + c.addAction(func(args []any) []any { v := reflect.ValueOf(value) switch reflect.TypeOf(args[n]).Kind() { case reflect.Slice: setSlice(args[n], v) + case reflect.Map: + setMap(args[n], v) default: reflect.ValueOf(args[n]).Elem().Set(v) } @@ -307,7 +323,7 @@ func (c *Call) String() string { // Tests if the given call matches the expected call. // If yes, returns nil. If no, returns error with message explaining why it does not match. -func (c *Call) matches(args []interface{}) error { +func (c *Call) matches(args []any) error { if !c.methodType.IsVariadic() { if len(args) != len(c.args) { return fmt.Errorf("expected call at %s has the wrong number of arguments. Got: %d, want: %d", @@ -413,30 +429,77 @@ func (c *Call) dropPrereqs() (preReqs []*Call) { return } -func (c *Call) call() []func([]interface{}) []interface{} { +func (c *Call) call() []func([]any) []any { c.numCalls++ return c.actions } // InOrder declares that the given calls should occur in order. -func InOrder(calls ...*Call) { +// It panics if the type of any of the arguments isn't *Call or a generated +// mock with an embedded *Call. +func InOrder(args ...any) { + calls := make([]*Call, 0, len(args)) + for i := 0; i < len(args); i++ { + if call := getCall(args[i]); call != nil { + calls = append(calls, call) + continue + } + panic(fmt.Sprintf( + "invalid argument at position %d of type %T, InOrder expects *gomock.Call or generated mock types with an embedded *gomock.Call", + i, + args[i], + )) + } for i := 1; i < len(calls); i++ { calls[i].After(calls[i-1]) } } -func setSlice(arg interface{}, v reflect.Value) { +// getCall checks if the parameter is a *Call or a generated struct +// that wraps a *Call and returns the *Call pointer - if neither, it returns nil. +func getCall(arg any) *Call { + if call, ok := arg.(*Call); ok { + return call + } + t := reflect.ValueOf(arg) + if t.Kind() != reflect.Ptr && t.Kind() != reflect.Interface { + return nil + } + t = t.Elem() + for i := 0; i < t.NumField(); i++ { + f := t.Field(i) + if !f.CanInterface() { + continue + } + if call, ok := f.Interface().(*Call); ok { + return call + } + } + return nil +} + +func setSlice(arg any, v reflect.Value) { va := reflect.ValueOf(arg) for i := 0; i < v.Len(); i++ { va.Index(i).Set(v.Index(i)) } } -func (c *Call) addAction(action func([]interface{}) []interface{}) { +func setMap(arg any, v reflect.Value) { + va := reflect.ValueOf(arg) + for _, e := range va.MapKeys() { + va.SetMapIndex(e, reflect.Value{}) + } + for _, e := range v.MapKeys() { + va.SetMapIndex(e, v.MapIndex(e)) + } +} + +func (c *Call) addAction(action func([]any) []any) { c.actions = append(c.actions, action) } -func formatGottenArg(m Matcher, arg interface{}) string { +func formatGottenArg(m Matcher, arg any) string { got := fmt.Sprintf("%v (%T)", arg, arg) if gs, ok := m.(GotFormatter); ok { got = gs.Got(arg) diff --git a/vendor/github.com/golang/mock/gomock/callset.go b/vendor/go.uber.org/mock/gomock/callset.go similarity index 70% rename from vendor/github.com/golang/mock/gomock/callset.go rename to vendor/go.uber.org/mock/gomock/callset.go index 49dba787a..f5cc592d6 100644 --- a/vendor/github.com/golang/mock/gomock/callset.go +++ b/vendor/go.uber.org/mock/gomock/callset.go @@ -18,40 +18,69 @@ import ( "bytes" "errors" "fmt" + "sync" ) // callSet represents a set of expected calls, indexed by receiver and method // name. type callSet struct { // Calls that are still expected. - expected map[callSetKey][]*Call + expected map[callSetKey][]*Call + expectedMu *sync.Mutex // Calls that have been exhausted. exhausted map[callSetKey][]*Call + // when set to true, existing call expectations are overridden when new call expectations are made + allowOverride bool } // callSetKey is the key in the maps in callSet type callSetKey struct { - receiver interface{} + receiver any fname string } func newCallSet() *callSet { - return &callSet{make(map[callSetKey][]*Call), make(map[callSetKey][]*Call)} + return &callSet{ + expected: make(map[callSetKey][]*Call), + expectedMu: &sync.Mutex{}, + exhausted: make(map[callSetKey][]*Call), + } +} + +func newOverridableCallSet() *callSet { + return &callSet{ + expected: make(map[callSetKey][]*Call), + expectedMu: &sync.Mutex{}, + exhausted: make(map[callSetKey][]*Call), + allowOverride: true, + } } // Add adds a new expected call. func (cs callSet) Add(call *Call) { key := callSetKey{call.receiver, call.method} + + cs.expectedMu.Lock() + defer cs.expectedMu.Unlock() + m := cs.expected if call.exhausted() { m = cs.exhausted } + if cs.allowOverride { + m[key] = make([]*Call, 0) + } + m[key] = append(m[key], call) } // Remove removes an expected call. func (cs callSet) Remove(call *Call) { key := callSetKey{call.receiver, call.method} + + cs.expectedMu.Lock() + defer cs.expectedMu.Unlock() + calls := cs.expected[key] for i, c := range calls { if c == call { @@ -64,9 +93,12 @@ func (cs callSet) Remove(call *Call) { } // FindMatch searches for a matching call. Returns error with explanation message if no call matched. -func (cs callSet) FindMatch(receiver interface{}, method string, args []interface{}) (*Call, error) { +func (cs callSet) FindMatch(receiver any, method string, args []any) (*Call, error) { key := callSetKey{receiver, method} + cs.expectedMu.Lock() + defer cs.expectedMu.Unlock() + // Search through the expected calls. expected := cs.expected[key] var callsErrors bytes.Buffer @@ -101,6 +133,9 @@ func (cs callSet) FindMatch(receiver interface{}, method string, args []interfac // Failures returns the calls that are not satisfied. func (cs callSet) Failures() []*Call { + cs.expectedMu.Lock() + defer cs.expectedMu.Unlock() + failures := make([]*Call, 0, len(cs.expected)) for _, calls := range cs.expected { for _, call := range calls { @@ -111,3 +146,19 @@ func (cs callSet) Failures() []*Call { } return failures } + +// Satisfied returns true in case all expected calls in this callSet are satisfied. +func (cs callSet) Satisfied() bool { + cs.expectedMu.Lock() + defer cs.expectedMu.Unlock() + + for _, calls := range cs.expected { + for _, call := range calls { + if !call.satisfied() { + return false + } + } + } + + return true +} diff --git a/vendor/github.com/golang/mock/gomock/controller.go b/vendor/go.uber.org/mock/gomock/controller.go similarity index 67% rename from vendor/github.com/golang/mock/gomock/controller.go rename to vendor/go.uber.org/mock/gomock/controller.go index f054200d5..6846d0d05 100644 --- a/vendor/github.com/golang/mock/gomock/controller.go +++ b/vendor/go.uber.org/mock/gomock/controller.go @@ -12,44 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package gomock is a mock framework for Go. -// -// Standard usage: -// (1) Define an interface that you wish to mock. -// type MyInterface interface { -// SomeMethod(x int64, y string) -// } -// (2) Use mockgen to generate a mock from the interface. -// (3) Use the mock in a test: -// func TestMyThing(t *testing.T) { -// mockCtrl := gomock.NewController(t) -// defer mockCtrl.Finish() -// -// mockObj := something.NewMockMyInterface(mockCtrl) -// mockObj.EXPECT().SomeMethod(4, "blah") -// // pass mockObj to a real object and play with it. -// } -// -// By default, expected calls are not enforced to run in any particular order. -// Call order dependency can be enforced by use of InOrder and/or Call.After. -// Call.After can create more varied call order dependencies, but InOrder is -// often more convenient. -// -// The following examples create equivalent call order dependencies. -// -// Example of using Call.After to chain expected call order: -// -// firstCall := mockObj.EXPECT().SomeMethod(1, "first") -// secondCall := mockObj.EXPECT().SomeMethod(2, "second").After(firstCall) -// mockObj.EXPECT().SomeMethod(3, "third").After(secondCall) -// -// Example of using InOrder to declare expected call order: -// -// gomock.InOrder( -// mockObj.EXPECT().SomeMethod(1, "first"), -// mockObj.EXPECT().SomeMethod(2, "second"), -// mockObj.EXPECT().SomeMethod(3, "third"), -// ) package gomock import ( @@ -63,8 +25,8 @@ import ( // A TestReporter is something that can be used to report test failures. It // is satisfied by the standard library's *testing.T. type TestReporter interface { - Errorf(format string, args ...interface{}) - Fatalf(format string, args ...interface{}) + Errorf(format string, args ...any) + Fatalf(format string, args ...any) } // TestHelper is a TestReporter that has the Helper method. It is satisfied @@ -89,24 +51,21 @@ type cleanuper interface { // goroutines. Each test should create a new Controller and invoke Finish via // defer. // -// func TestFoo(t *testing.T) { -// ctrl := gomock.NewController(t) -// defer ctrl.Finish() -// // .. -// } +// func TestFoo(t *testing.T) { +// ctrl := gomock.NewController(t) +// // .. +// } // -// func TestBar(t *testing.T) { -// t.Run("Sub-Test-1", st) { -// ctrl := gomock.NewController(st) -// defer ctrl.Finish() -// // .. -// }) -// t.Run("Sub-Test-2", st) { -// ctrl := gomock.NewController(st) -// defer ctrl.Finish() -// // .. -// }) -// }) +// func TestBar(t *testing.T) { +// t.Run("Sub-Test-1", st) { +// ctrl := gomock.NewController(st) +// // .. +// }) +// t.Run("Sub-Test-2", st) { +// ctrl := gomock.NewController(st) +// // .. +// }) +// }) type Controller struct { // T should only be called within a generated mock. It is not intended to // be used in user code and may be changed in future versions. T is the @@ -119,12 +78,11 @@ type Controller struct { finished bool } -// NewController returns a new Controller. It is the preferred way to create a -// Controller. +// NewController returns a new Controller. It is the preferred way to create a Controller. // -// New in go1.14+, if you are passing a *testing.T into this function you no -// longer need to call ctrl.Finish() in your test methods. -func NewController(t TestReporter) *Controller { +// Passing [*testing.T] registers cleanup function to automatically call [Controller.Finish] +// when the test and all its subtests complete. +func NewController(t TestReporter, opts ...ControllerOption) *Controller { h, ok := t.(TestHelper) if !ok { h = &nopTestHelper{t} @@ -133,6 +91,9 @@ func NewController(t TestReporter) *Controller { T: h, expectedCalls: newCallSet(), } + for _, opt := range opts { + opt.apply(ctrl) + } if c, ok := isCleanuper(ctrl.T); ok { c.Cleanup(func() { ctrl.T.Helper() @@ -143,15 +104,32 @@ func NewController(t TestReporter) *Controller { return ctrl } +// ControllerOption configures how a Controller should behave. +type ControllerOption interface { + apply(*Controller) +} + +type overridableExpectationsOption struct{} + +// WithOverridableExpectations allows for overridable call expectations +// i.e., subsequent call expectations override existing call expectations +func WithOverridableExpectations() overridableExpectationsOption { + return overridableExpectationsOption{} +} + +func (o overridableExpectationsOption) apply(ctrl *Controller) { + ctrl.expectedCalls = newOverridableCallSet() +} + type cancelReporter struct { t TestHelper cancel func() } -func (r *cancelReporter) Errorf(format string, args ...interface{}) { +func (r *cancelReporter) Errorf(format string, args ...any) { r.t.Errorf(format, args...) } -func (r *cancelReporter) Fatalf(format string, args ...interface{}) { +func (r *cancelReporter) Fatalf(format string, args ...any) { defer r.cancel() r.t.Fatalf(format, args...) } @@ -176,17 +154,17 @@ type nopTestHelper struct { t TestReporter } -func (h *nopTestHelper) Errorf(format string, args ...interface{}) { +func (h *nopTestHelper) Errorf(format string, args ...any) { h.t.Errorf(format, args...) } -func (h *nopTestHelper) Fatalf(format string, args ...interface{}) { +func (h *nopTestHelper) Fatalf(format string, args ...any) { h.t.Fatalf(format, args...) } func (h nopTestHelper) Helper() {} // RecordCall is called by a mock. It should not be called by user code. -func (ctrl *Controller) RecordCall(receiver interface{}, method string, args ...interface{}) *Call { +func (ctrl *Controller) RecordCall(receiver any, method string, args ...any) *Call { ctrl.T.Helper() recv := reflect.ValueOf(receiver) @@ -200,7 +178,7 @@ func (ctrl *Controller) RecordCall(receiver interface{}, method string, args ... } // RecordCallWithMethodType is called by a mock. It should not be called by user code. -func (ctrl *Controller) RecordCallWithMethodType(receiver interface{}, method string, methodType reflect.Type, args ...interface{}) *Call { +func (ctrl *Controller) RecordCallWithMethodType(receiver any, method string, methodType reflect.Type, args ...any) *Call { ctrl.T.Helper() call := newCall(ctrl.T, receiver, method, methodType, args...) @@ -213,11 +191,11 @@ func (ctrl *Controller) RecordCallWithMethodType(receiver interface{}, method st } // Call is called by a mock. It should not be called by user code. -func (ctrl *Controller) Call(receiver interface{}, method string, args ...interface{}) []interface{} { +func (ctrl *Controller) Call(receiver any, method string, args ...any) []any { ctrl.T.Helper() // Nest this code so we can use defer to make sure the lock is released. - actions := func() []func([]interface{}) []interface{} { + actions := func() []func([]any) []any { ctrl.T.Helper() ctrl.mu.Lock() defer ctrl.mu.Unlock() @@ -246,7 +224,7 @@ func (ctrl *Controller) Call(receiver interface{}, method string, args ...interf return actions }() - var rets []interface{} + var rets []any for _, action := range actions { if r := action(args); r != nil { rets = r @@ -256,12 +234,8 @@ func (ctrl *Controller) Call(receiver interface{}, method string, args ...interf return rets } -// Finish checks to see if all the methods that were expected to be called -// were called. It should be invoked for each Controller. It is not idempotent -// and therefore can only be invoked once. -// -// New in go1.14+, if you are passing a *testing.T into NewController function you no -// longer need to call ctrl.Finish() in your test methods. +// Finish checks to see if all the methods that were expected to be called were called. +// It is not idempotent and therefore can only be invoked once. func (ctrl *Controller) Finish() { // If we're currently panicking, probably because this is a deferred call. // This must be recovered in the deferred function. @@ -269,7 +243,13 @@ func (ctrl *Controller) Finish() { ctrl.finish(false, err) } -func (ctrl *Controller) finish(cleanup bool, panicErr interface{}) { +// Satisfied returns whether all expected calls bound to this Controller have been satisfied. +// Calling Finish is then guaranteed to not fail due to missing calls. +func (ctrl *Controller) Satisfied() bool { + return ctrl.expectedCalls.Satisfied() +} + +func (ctrl *Controller) finish(cleanup bool, panicErr any) { ctrl.T.Helper() ctrl.mu.Lock() diff --git a/vendor/go.uber.org/mock/gomock/doc.go b/vendor/go.uber.org/mock/gomock/doc.go new file mode 100644 index 000000000..696dda388 --- /dev/null +++ b/vendor/go.uber.org/mock/gomock/doc.go @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package gomock is a mock framework for Go. +// +// Standard usage: +// +// (1) Define an interface that you wish to mock. +// type MyInterface interface { +// SomeMethod(x int64, y string) +// } +// (2) Use mockgen to generate a mock from the interface. +// (3) Use the mock in a test: +// func TestMyThing(t *testing.T) { +// mockCtrl := gomock.NewController(t) +// mockObj := something.NewMockMyInterface(mockCtrl) +// mockObj.EXPECT().SomeMethod(4, "blah") +// // pass mockObj to a real object and play with it. +// } +// +// By default, expected calls are not enforced to run in any particular order. +// Call order dependency can be enforced by use of InOrder and/or Call.After. +// Call.After can create more varied call order dependencies, but InOrder is +// often more convenient. +// +// The following examples create equivalent call order dependencies. +// +// Example of using Call.After to chain expected call order: +// +// firstCall := mockObj.EXPECT().SomeMethod(1, "first") +// secondCall := mockObj.EXPECT().SomeMethod(2, "second").After(firstCall) +// mockObj.EXPECT().SomeMethod(3, "third").After(secondCall) +// +// Example of using InOrder to declare expected call order: +// +// gomock.InOrder( +// mockObj.EXPECT().SomeMethod(1, "first"), +// mockObj.EXPECT().SomeMethod(2, "second"), +// mockObj.EXPECT().SomeMethod(3, "third"), +// ) +// +// The standard TestReporter most users will pass to `NewController` is a +// `*testing.T` from the context of the test. Note that this will use the +// standard `t.Error` and `t.Fatal` methods to report what happened in the test. +// In some cases this can leave your testing package in a weird state if global +// state is used since `t.Fatal` is like calling panic in the middle of a +// function. In these cases it is recommended that you pass in your own +// `TestReporter`. +package gomock diff --git a/vendor/github.com/golang/mock/gomock/matchers.go b/vendor/go.uber.org/mock/gomock/matchers.go similarity index 76% rename from vendor/github.com/golang/mock/gomock/matchers.go rename to vendor/go.uber.org/mock/gomock/matchers.go index 2822fb2c8..bac4623b1 100644 --- a/vendor/github.com/golang/mock/gomock/matchers.go +++ b/vendor/go.uber.org/mock/gomock/matchers.go @@ -24,7 +24,7 @@ import ( // It is used to represent the valid or expected arguments to a mocked method. type Matcher interface { // Matches returns whether x is a match. - Matches(x interface{}) bool + Matches(x any) bool // String describes what the matcher matches. String() string @@ -35,7 +35,7 @@ type Matcher interface { // printing . func WantFormatter(s fmt.Stringer, m Matcher) Matcher { type matcher interface { - Matches(x interface{}) bool + Matches(x any) bool } return struct { @@ -63,16 +63,16 @@ func (f StringerFunc) String() string { type GotFormatter interface { // Got is invoked with the received value. The result is used when // printing the failure message. - Got(got interface{}) string + Got(got any) string } // GotFormatterFunc type is an adapter to allow the use of ordinary // functions as a GotFormatter. If f is a function with the appropriate // signature, GotFormatterFunc(f) is a GotFormatter that calls f. -type GotFormatterFunc func(got interface{}) string +type GotFormatterFunc func(got any) string // Got implements GotFormatter. -func (f GotFormatterFunc) Got(got interface{}) string { +func (f GotFormatterFunc) Got(got any) string { return f(got) } @@ -89,7 +89,7 @@ func GotFormatterAdapter(s GotFormatter, m Matcher) Matcher { type anyMatcher struct{} -func (anyMatcher) Matches(interface{}) bool { +func (anyMatcher) Matches(any) bool { return true } @@ -97,11 +97,23 @@ func (anyMatcher) String() string { return "is anything" } +type condMatcher struct { + fn func(x any) bool +} + +func (c condMatcher) Matches(x any) bool { + return c.fn(x) +} + +func (condMatcher) String() string { + return "adheres to a custom condition" +} + type eqMatcher struct { - x interface{} + x any } -func (e eqMatcher) Matches(x interface{}) bool { +func (e eqMatcher) Matches(x any) bool { // In case, some value is nil if e.x == nil || x == nil { return reflect.DeepEqual(e.x, x) @@ -125,7 +137,7 @@ func (e eqMatcher) String() string { type nilMatcher struct{} -func (nilMatcher) Matches(x interface{}) bool { +func (nilMatcher) Matches(x any) bool { if x == nil { return true } @@ -148,7 +160,7 @@ type notMatcher struct { m Matcher } -func (n notMatcher) Matches(x interface{}) bool { +func (n notMatcher) Matches(x any) bool { return !n.m.Matches(x) } @@ -160,7 +172,7 @@ type assignableToTypeOfMatcher struct { targetType reflect.Type } -func (m assignableToTypeOfMatcher) Matches(x interface{}) bool { +func (m assignableToTypeOfMatcher) Matches(x any) bool { return reflect.TypeOf(x).AssignableTo(m.targetType) } @@ -172,7 +184,7 @@ type allMatcher struct { matchers []Matcher } -func (am allMatcher) Matches(x interface{}) bool { +func (am allMatcher) Matches(x any) bool { for _, m := range am.matchers { if !m.Matches(x) { return false @@ -193,7 +205,7 @@ type lenMatcher struct { i int } -func (m lenMatcher) Matches(x interface{}) bool { +func (m lenMatcher) Matches(x any) bool { v := reflect.ValueOf(x) switch v.Kind() { case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice, reflect.String: @@ -208,10 +220,10 @@ func (m lenMatcher) String() string { } type inAnyOrderMatcher struct { - x interface{} + x any } -func (m inAnyOrderMatcher) Matches(x interface{}) bool { +func (m inAnyOrderMatcher) Matches(x any) bool { given, ok := m.prepareValue(x) if !ok { return false @@ -257,7 +269,7 @@ func (m inAnyOrderMatcher) Matches(x interface{}) bool { return extraInGiven == 0 && missingFromWanted == 0 } -func (m inAnyOrderMatcher) prepareValue(x interface{}) (reflect.Value, bool) { +func (m inAnyOrderMatcher) prepareValue(x any) (reflect.Value, bool) { xValue := reflect.ValueOf(x) switch xValue.Kind() { case reflect.Slice, reflect.Array: @@ -280,12 +292,23 @@ func All(ms ...Matcher) Matcher { return allMatcher{ms} } // Any returns a matcher that always matches. func Any() Matcher { return anyMatcher{} } +// Cond returns a matcher that matches when the given function returns true +// after passing it the parameter to the mock function. +// This is particularly useful in case you want to match over a field of a custom struct, or dynamic logic. +// +// Example usage: +// +// Cond(func(x any){return x.(int) == 1}).Matches(1) // returns true +// Cond(func(x any){return x.(int) == 2}).Matches(1) // returns false +func Cond(fn func(x any) bool) Matcher { return condMatcher{fn} } + // Eq returns a matcher that matches on equality. // // Example usage: -// Eq(5).Matches(5) // returns true -// Eq(5).Matches(4) // returns false -func Eq(x interface{}) Matcher { return eqMatcher{x} } +// +// Eq(5).Matches(5) // returns true +// Eq(5).Matches(4) // returns false +func Eq(x any) Matcher { return eqMatcher{x} } // Len returns a matcher that matches on length. This matcher returns false if // is compared to a type that is not an array, chan, map, slice, or string. @@ -296,18 +319,20 @@ func Len(i int) Matcher { // Nil returns a matcher that matches if the received value is nil. // // Example usage: -// var x *bytes.Buffer -// Nil().Matches(x) // returns true -// x = &bytes.Buffer{} -// Nil().Matches(x) // returns false +// +// var x *bytes.Buffer +// Nil().Matches(x) // returns true +// x = &bytes.Buffer{} +// Nil().Matches(x) // returns false func Nil() Matcher { return nilMatcher{} } // Not reverses the results of its given child matcher. // // Example usage: -// Not(Eq(5)).Matches(4) // returns true -// Not(Eq(5)).Matches(5) // returns false -func Not(x interface{}) Matcher { +// +// Not(Eq(5)).Matches(4) // returns true +// Not(Eq(5)).Matches(5) // returns false +func Not(x any) Matcher { if m, ok := x.(Matcher); ok { return notMatcher{m} } @@ -318,13 +343,14 @@ func Not(x interface{}) Matcher { // function is assignable to the type of the parameter to this function. // // Example usage: -// var s fmt.Stringer = &bytes.Buffer{} -// AssignableToTypeOf(s).Matches(time.Second) // returns true -// AssignableToTypeOf(s).Matches(99) // returns false // -// var ctx = reflect.TypeOf((*context.Context)(nil)).Elem() -// AssignableToTypeOf(ctx).Matches(context.Background()) // returns true -func AssignableToTypeOf(x interface{}) Matcher { +// var s fmt.Stringer = &bytes.Buffer{} +// AssignableToTypeOf(s).Matches(time.Second) // returns true +// AssignableToTypeOf(s).Matches(99) // returns false +// +// var ctx = reflect.TypeOf((*context.Context)(nil)).Elem() +// AssignableToTypeOf(ctx).Matches(context.Background()) // returns true +func AssignableToTypeOf(x any) Matcher { if xt, ok := x.(reflect.Type); ok { return assignableToTypeOfMatcher{xt} } @@ -334,8 +360,9 @@ func AssignableToTypeOf(x interface{}) Matcher { // InAnyOrder is a Matcher that returns true for collections of the same elements ignoring the order. // // Example usage: -// InAnyOrder([]int{1, 2, 3}).Matches([]int{1, 3, 2}) // returns true -// InAnyOrder([]int{1, 2, 3}).Matches([]int{1, 2}) // returns false -func InAnyOrder(x interface{}) Matcher { +// +// InAnyOrder([]int{1, 2, 3}).Matches([]int{1, 3, 2}) // returns true +// InAnyOrder([]int{1, 2, 3}).Matches([]int{1, 2}) // returns false +func InAnyOrder(x any) Matcher { return inAnyOrderMatcher{x} } diff --git a/vendor/github.com/golang/mock/mockgen/model/model.go b/vendor/go.uber.org/mock/mockgen/model/model.go similarity index 87% rename from vendor/github.com/golang/mock/mockgen/model/model.go rename to vendor/go.uber.org/mock/mockgen/model/model.go index 2c6a62ceb..e2dde5385 100644 --- a/vendor/github.com/golang/mock/mockgen/model/model.go +++ b/vendor/go.uber.org/mock/mockgen/model/model.go @@ -24,7 +24,7 @@ import ( ) // pkgPath is the importable path for package model -const pkgPath = "github.com/golang/mock/mockgen/model" +const pkgPath = "go.uber.org/mock/mockgen/model" // Package is a Go package. It may be a subset. type Package struct { @@ -47,14 +47,18 @@ func (pkg *Package) Imports() map[string]bool { im := make(map[string]bool) for _, intf := range pkg.Interfaces { intf.addImports(im) + for _, tp := range intf.TypeParams { + tp.Type.addImports(im) + } } return im } // Interface is a Go interface. type Interface struct { - Name string - Methods []*Method + Name string + Methods []*Method + TypeParams []*Parameter } // Print writes the interface name and its methods. @@ -143,12 +147,14 @@ type Type interface { } func init() { - gob.Register(&ArrayType{}) - gob.Register(&ChanType{}) - gob.Register(&FuncType{}) - gob.Register(&MapType{}) - gob.Register(&NamedType{}) - gob.Register(&PointerType{}) + // Call gob.RegisterName with pkgPath as prefix to avoid conflicting with + // github.com/golang/mock/mockgen/model 's registration. + gob.RegisterName(pkgPath+".ArrayType", &ArrayType{}) + gob.RegisterName(pkgPath+".ChanType", &ChanType{}) + gob.RegisterName(pkgPath+".FuncType", &FuncType{}) + gob.RegisterName(pkgPath+".MapType", &MapType{}) + gob.RegisterName(pkgPath+".NamedType", &NamedType{}) + gob.RegisterName(pkgPath+".PointerType", &PointerType{}) // Call gob.RegisterName to make sure it has the consistent name registered // for both gob decoder and encoder. @@ -156,7 +162,7 @@ func init() { // For a non-pointer type, gob.Register will try to get package full path by // calling rt.PkgPath() for a name to register. If your project has vendor // directory, it is possible that PkgPath will get a path like this: - // ../../../vendor/github.com/golang/mock/mockgen/model + // ../../../vendor/go.uber.org/mock/mockgen/model gob.RegisterName(pkgPath+".PredeclaredType", PredeclaredType("")) } @@ -259,26 +265,28 @@ func (mt *MapType) addImports(im map[string]bool) { // NamedType is an exported type in a package. type NamedType struct { - Package string // may be empty - Type string + Package string // may be empty + Type string + TypeParams *TypeParametersType } func (nt *NamedType) String(pm map[string]string, pkgOverride string) string { if pkgOverride == nt.Package { - return nt.Type + return nt.Type + nt.TypeParams.String(pm, pkgOverride) } prefix := pm[nt.Package] if prefix != "" { - return prefix + "." + nt.Type + return prefix + "." + nt.Type + nt.TypeParams.String(pm, pkgOverride) } - return nt.Type + return nt.Type + nt.TypeParams.String(pm, pkgOverride) } func (nt *NamedType) addImports(im map[string]bool) { if nt.Package != "" { im[nt.Package] = true } + nt.TypeParams.addImports(im) } // PointerType is a pointer to another type. @@ -297,6 +305,36 @@ type PredeclaredType string func (pt PredeclaredType) String(map[string]string, string) string { return string(pt) } func (pt PredeclaredType) addImports(map[string]bool) {} +// TypeParametersType contains type paramters for a NamedType. +type TypeParametersType struct { + TypeParameters []Type +} + +func (tp *TypeParametersType) String(pm map[string]string, pkgOverride string) string { + if tp == nil || len(tp.TypeParameters) == 0 { + return "" + } + var sb strings.Builder + sb.WriteString("[") + for i, v := range tp.TypeParameters { + if i != 0 { + sb.WriteString(", ") + } + sb.WriteString(v.String(pm, pkgOverride)) + } + sb.WriteString("]") + return sb.String() +} + +func (tp *TypeParametersType) addImports(im map[string]bool) { + if tp == nil { + return + } + for _, v := range tp.TypeParameters { + v.addImports(im) + } +} + // The following code is intended to be called by the program generated by ../reflect.go. // InterfaceFromInterfaceType returns a pointer to an interface for the @@ -431,7 +469,7 @@ func typeFromType(t reflect.Type) (Type, error) { case reflect.Interface: // Two special interfaces. if t.NumMethod() == 0 { - return PredeclaredType("interface{}"), nil + return PredeclaredType("any"), nil } if t == errorType { return PredeclaredType("error"), nil diff --git a/vendor/modules.txt b/vendor/modules.txt index 060044358..318c75388 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -151,10 +151,6 @@ github.com/gogo/protobuf/types # github.com/gogo/status v1.1.1 ## explicit; go 1.12 github.com/gogo/status -# github.com/golang/mock v1.6.0 -## explicit; go 1.11 -github.com/golang/mock/gomock -github.com/golang/mock/mockgen/model # github.com/golang/protobuf v1.5.3 ## explicit; go 1.9 github.com/golang/protobuf/jsonpb @@ -421,6 +417,10 @@ go.uber.org/automaxprocs/maxprocs ## explicit; go 1.20 go.uber.org/goleak go.uber.org/goleak/internal/stack +# go.uber.org/mock v0.3.0 +## explicit; go 1.20 +go.uber.org/mock/gomock +go.uber.org/mock/mockgen/model # go.uber.org/multierr v1.11.0 ## explicit; go 1.19 go.uber.org/multierr