From 12fc6306124eb1df7272732f0c48865708953398 Mon Sep 17 00:00:00 2001 From: Gaius Date: Mon, 30 Oct 2023 16:45:39 +0800 Subject: [PATCH] fix: if scheduler has no seed peer, return error in preheating (#2835) Signed-off-by: Gaius --- client/config/dynconfig_manager_test.go | 2 +- client/config/dynconfig_test.go | 2 +- client/config/mocks/dynconfig_mock.go | 16 +- client/daemon/announcer/announcer_test.go | 2 +- .../daemon/announcer/mocks/announcer_mock.go | 8 +- .../mocks/network_topology_mock.go | 8 +- .../networktopology/network_topology_test.go | 2 +- .../objectstorage/mocks/objectstorage_mock.go | 10 +- client/daemon/peer/peertask_manager_mock.go | 60 +++--- client/daemon/peer/peertask_manager_test.go | 2 +- .../peertask_piecetask_synchronizer_test.go | 2 +- client/daemon/peer/peertask_reuse_test.go | 2 +- ...peertask_stream_backsource_partial_test.go | 2 +- .../peer/peertask_stream_resume_test.go | 2 +- client/daemon/peer/piece_downloader_mock.go | 10 +- client/daemon/peer/piece_manager_mock.go | 24 ++- client/daemon/peer/piece_manager_test.go | 2 +- client/daemon/peer/traffic_shaper_test.go | 2 +- .../daemon/proxy/mocks/proxy_manager_mock.go | 16 +- .../daemon/rpcserver/mocks/rpcserver_mock.go | 18 +- client/daemon/rpcserver/rpcserver_test.go | 2 +- client/daemon/rpcserver/seeder_test.go | 2 +- .../storage/mocks/stroage_manager_mock.go | 62 +++--- client/daemon/transport/transport_test.go | 2 +- .../upload/mocks/upload_manager_mock.go | 10 +- client/daemon/upload/upload_manager_test.go | 2 +- client/dfget/dfget_test.go | 2 +- client/dfstore/mocks/dfstore_mock.go | 40 ++-- client/util/mocks/keepalive_mock.go | 10 +- go.mod | 5 +- go.sum | 6 +- internal/dynconfig/dynconfig_test.go | 2 +- internal/dynconfig/mocks/dynconfig_mock.go | 8 +- .../dynconfig/mocks/manager_client_mock.go | 8 +- manager/auth/oauth/mocks/oauth_mock.go | 12 +- manager/job/mocks/preheat_mock.go | 10 +- manager/job/mocks/sync_peers_mock.go | 10 +- manager/searcher/mocks/searcher_mock.go | 10 +- manager/service/mocks/service_mock.go | 191 ++++++++++-------- pkg/container/set/mocks/safe_set_mock.go | 16 +- pkg/container/set/mocks/set_mock.go | 16 +- pkg/dfpath/mocks/dfpath_mock.go | 8 +- pkg/digest/mocks/digest_reader_mock.go | 10 +- pkg/gc/gc_mock.go | 12 +- pkg/gc/gc_test.go | 2 +- pkg/gc/logger_mock.go | 20 +- pkg/gc/runner_mock.go | 8 +- pkg/graph/dag/mocks/dag_mock.go | 26 ++- pkg/graph/dg/mocks/dg_mock.go | 26 ++- pkg/objectstorage/mocks/objectstorage_mock.go | 34 ++-- pkg/reachable/mocks/reachable_mock.go | 8 +- pkg/rpc/cdnsystem/client/mocks/client_mock.go | 26 ++- .../dfdaemon/client/mocks/client_v1_mock.go | 56 ++--- .../dfdaemon/client/mocks/client_v2_mock.go | 38 ++-- pkg/rpc/health/client/mocks/client_mock.go | 14 +- .../inference/client/mocks/client_v1_mock.go | 26 ++- .../manager/client/mocks/client_v1_mock.go | 62 +++--- .../manager/client/mocks/client_v2_mock.go | 68 ++++--- .../scheduler/client/mocks/client_v1_mock.go | 62 +++--- .../scheduler/client/mocks/client_v2_mock.go | 56 ++--- .../security/client/mocks/client_v1_mock.go | 14 +- .../trainer/client/mocks/client_v1_mock.go | 14 +- pkg/source/mocks/mock_source_client.go | 40 ++-- pkg/source/request_fixture.go | 2 +- scheduler/announcer/announcer_test.go | 2 +- scheduler/announcer/mocks/announcer_mock.go | 8 +- scheduler/config/dynconfig_test.go | 2 +- scheduler/config/mocks/dynconfig_mock.go | 14 +- scheduler/job/job.go | 9 +- scheduler/job/mocks/job_mock.go | 8 +- .../mocks/network_topology_mock.go | 20 +- .../networktopology/mocks/probes_mock.go | 10 +- .../networktopology/network_topology_test.go | 2 +- scheduler/networktopology/probes_test.go | 2 +- scheduler/resource/host_manager_mock.go | 20 +- scheduler/resource/host_manager_test.go | 2 +- scheduler/resource/peer_manager_mock.go | 18 +- scheduler/resource/peer_manager_test.go | 2 +- scheduler/resource/peer_test.go | 2 +- scheduler/resource/resource_mock.go | 8 +- scheduler/resource/resource_test.go | 2 +- scheduler/resource/seed_peer_client.go | 3 + scheduler/resource/seed_peer_client_mock.go | 42 ++-- scheduler/resource/seed_peer_client_test.go | 2 +- scheduler/resource/seed_peer_mock.go | 18 +- scheduler/resource/seed_peer_test.go | 2 +- scheduler/resource/task_manager_mock.go | 18 +- scheduler/resource/task_manager_test.go | 2 +- scheduler/resource/task_test.go | 2 +- scheduler/rpcserver/rpcserver_test.go | 2 +- scheduler/scheduling/mocks/scheduling_mock.go | 16 +- scheduler/scheduling/scheduling_test.go | 2 +- scheduler/service/service_v1_test.go | 2 +- scheduler/service/service_v2_test.go | 2 +- scheduler/storage/mocks/storage_mock.go | 12 +- trainer/rpcserver/rpcserver_test.go | 2 +- trainer/service/service_v1_test.go | 2 +- trainer/storage/mocks/storage_mock.go | 20 +- trainer/training/mocks/training_mock.go | 10 +- 99 files changed, 907 insertions(+), 633 deletions(-) diff --git a/client/config/dynconfig_manager_test.go b/client/config/dynconfig_manager_test.go index 4b3948cd041..7fc64dddfda 100644 --- a/client/config/dynconfig_manager_test.go +++ b/client/config/dynconfig_manager_test.go @@ -24,8 +24,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/codes" "google.golang.org/grpc/health" diff --git a/client/config/dynconfig_test.go b/client/config/dynconfig_test.go index e61e71246bf..8aad514c6a8 100644 --- a/client/config/dynconfig_test.go +++ b/client/config/dynconfig_test.go @@ -23,8 +23,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/client/config/mocks/dynconfig_mock.go b/client/config/mocks/dynconfig_mock.go index d0afb0177c3..37eadc5e2ea 100644 --- a/client/config/mocks/dynconfig_mock.go +++ b/client/config/mocks/dynconfig_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: dynconfig.go - +// +// Generated by this command: +// +// mockgen -destination mocks/dynconfig_mock.go -source dynconfig.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -9,7 +13,7 @@ import ( manager "d7y.io/api/v2/pkg/apis/manager/v1" config "d7y.io/dragonfly/v2/client/config" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" resolver "google.golang.org/grpc/resolver" ) @@ -43,7 +47,7 @@ func (m *MockDynconfig) Deregister(arg0 config.Observer) { } // Deregister indicates an expected call of Deregister. -func (mr *MockDynconfigMockRecorder) Deregister(arg0 interface{}) *gomock.Call { +func (mr *MockDynconfigMockRecorder) Deregister(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Deregister", reflect.TypeOf((*MockDynconfig)(nil).Deregister), arg0) } @@ -143,7 +147,7 @@ func (m *MockDynconfig) OnNotify(arg0 *config.DaemonOption) { } // OnNotify indicates an expected call of OnNotify. -func (mr *MockDynconfigMockRecorder) OnNotify(arg0 interface{}) *gomock.Call { +func (mr *MockDynconfigMockRecorder) OnNotify(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnNotify", reflect.TypeOf((*MockDynconfig)(nil).OnNotify), arg0) } @@ -169,7 +173,7 @@ func (m *MockDynconfig) Register(arg0 config.Observer) { } // Register indicates an expected call of Register. -func (mr *MockDynconfigMockRecorder) Register(arg0 interface{}) *gomock.Call { +func (mr *MockDynconfigMockRecorder) Register(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Register", reflect.TypeOf((*MockDynconfig)(nil).Register), arg0) } @@ -232,7 +236,7 @@ func (m *MockObserver) OnNotify(arg0 *config.DynconfigData) { } // OnNotify indicates an expected call of OnNotify. -func (mr *MockObserverMockRecorder) OnNotify(arg0 interface{}) *gomock.Call { +func (mr *MockObserverMockRecorder) OnNotify(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnNotify", reflect.TypeOf((*MockObserver)(nil).OnNotify), arg0) } diff --git a/client/daemon/announcer/announcer_test.go b/client/daemon/announcer/announcer_test.go index 9bcc82c11af..eb73fb138b8 100644 --- a/client/daemon/announcer/announcer_test.go +++ b/client/daemon/announcer/announcer_test.go @@ -19,8 +19,8 @@ package announcer import ( "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "d7y.io/dragonfly/v2/client/config" configmocks "d7y.io/dragonfly/v2/client/config/mocks" diff --git a/client/daemon/announcer/mocks/announcer_mock.go b/client/daemon/announcer/mocks/announcer_mock.go index 5a25a5389c2..5c6ff596072 100644 --- a/client/daemon/announcer/mocks/announcer_mock.go +++ b/client/daemon/announcer/mocks/announcer_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: announcer.go - +// +// Generated by this command: +// +// mockgen -destination mocks/announcer_mock.go -source announcer.go -package mocks +// // Package mocks is a generated GoMock package. package mocks import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockAnnouncer is a mock of Announcer interface. diff --git a/client/daemon/networktopology/mocks/network_topology_mock.go b/client/daemon/networktopology/mocks/network_topology_mock.go index 1e4f12f1854..4bc027bce83 100644 --- a/client/daemon/networktopology/mocks/network_topology_mock.go +++ b/client/daemon/networktopology/mocks/network_topology_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: network_topology.go - +// +// Generated by this command: +// +// mockgen -destination mocks/network_topology_mock.go -source network_topology.go -package mocks +// // Package mocks is a generated GoMock package. package mocks import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockNetworkTopology is a mock of NetworkTopology interface. diff --git a/client/daemon/networktopology/network_topology_test.go b/client/daemon/networktopology/network_topology_test.go index 2187356ad98..6708ec5c71c 100644 --- a/client/daemon/networktopology/network_topology_test.go +++ b/client/daemon/networktopology/network_topology_test.go @@ -25,8 +25,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" v1 "d7y.io/api/v2/pkg/apis/common/v1" schedulerv1 "d7y.io/api/v2/pkg/apis/scheduler/v1" diff --git a/client/daemon/objectstorage/mocks/objectstorage_mock.go b/client/daemon/objectstorage/mocks/objectstorage_mock.go index 982288444af..e889e90ce73 100644 --- a/client/daemon/objectstorage/mocks/objectstorage_mock.go +++ b/client/daemon/objectstorage/mocks/objectstorage_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: objectstorage.go - +// +// Generated by this command: +// +// mockgen -destination mocks/objectstorage_mock.go -source objectstorage.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -8,7 +12,7 @@ import ( net "net" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockObjectStorage is a mock of ObjectStorage interface. @@ -43,7 +47,7 @@ func (m *MockObjectStorage) Serve(lis net.Listener) error { } // Serve indicates an expected call of Serve. -func (mr *MockObjectStorageMockRecorder) Serve(lis interface{}) *gomock.Call { +func (mr *MockObjectStorageMockRecorder) Serve(lis any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Serve", reflect.TypeOf((*MockObjectStorage)(nil).Serve), lis) } diff --git a/client/daemon/peer/peertask_manager_mock.go b/client/daemon/peer/peertask_manager_mock.go index c140e9dbd47..551c2cb418e 100644 --- a/client/daemon/peer/peertask_manager_mock.go +++ b/client/daemon/peer/peertask_manager_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: peertask_manager.go - +// +// Generated by this command: +// +// mockgen -destination peertask_manager_mock.go -source peertask_manager.go -package peer +// // Package peer is a generated GoMock package. package peer @@ -9,11 +13,11 @@ import ( io "io" reflect "reflect" - v1 "d7y.io/api/v2/pkg/apis/common/v1" - v10 "d7y.io/api/v2/pkg/apis/scheduler/v1" + common "d7y.io/api/v2/pkg/apis/common/v1" + scheduler "d7y.io/api/v2/pkg/apis/scheduler/v1" storage "d7y.io/dragonfly/v2/client/daemon/storage" - dflog "d7y.io/dragonfly/v2/internal/dflog" - gomock "github.com/golang/mock/gomock" + logger "d7y.io/dragonfly/v2/internal/dflog" + gomock "go.uber.org/mock/gomock" status "google.golang.org/grpc/status" ) @@ -41,7 +45,7 @@ func (m *MockTaskManager) EXPECT() *MockTaskManagerMockRecorder { } // AnnouncePeerTask mocks base method. -func (m *MockTaskManager) AnnouncePeerTask(ctx context.Context, meta storage.PeerTaskMetadata, url string, taskType v1.TaskType, urlMeta *v1.UrlMeta) error { +func (m *MockTaskManager) AnnouncePeerTask(ctx context.Context, meta storage.PeerTaskMetadata, url string, taskType common.TaskType, urlMeta *common.UrlMeta) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AnnouncePeerTask", ctx, meta, url, taskType, urlMeta) ret0, _ := ret[0].(error) @@ -49,7 +53,7 @@ func (m *MockTaskManager) AnnouncePeerTask(ctx context.Context, meta storage.Pee } // AnnouncePeerTask indicates an expected call of AnnouncePeerTask. -func (mr *MockTaskManagerMockRecorder) AnnouncePeerTask(ctx, meta, url, taskType, urlMeta interface{}) *gomock.Call { +func (mr *MockTaskManagerMockRecorder) AnnouncePeerTask(ctx, meta, url, taskType, urlMeta any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AnnouncePeerTask", reflect.TypeOf((*MockTaskManager)(nil).AnnouncePeerTask), ctx, meta, url, taskType, urlMeta) } @@ -78,7 +82,7 @@ func (m *MockTaskManager) IsPeerTaskRunning(taskID, peerID string) (Task, bool) } // IsPeerTaskRunning indicates an expected call of IsPeerTaskRunning. -func (mr *MockTaskManagerMockRecorder) IsPeerTaskRunning(taskID, peerID interface{}) *gomock.Call { +func (mr *MockTaskManagerMockRecorder) IsPeerTaskRunning(taskID, peerID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsPeerTaskRunning", reflect.TypeOf((*MockTaskManager)(nil).IsPeerTaskRunning), taskID, peerID) } @@ -93,7 +97,7 @@ func (m *MockTaskManager) StartFileTask(ctx context.Context, req *FileTaskReques } // StartFileTask indicates an expected call of StartFileTask. -func (mr *MockTaskManagerMockRecorder) StartFileTask(ctx, req interface{}) *gomock.Call { +func (mr *MockTaskManagerMockRecorder) StartFileTask(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartFileTask", reflect.TypeOf((*MockTaskManager)(nil).StartFileTask), ctx, req) } @@ -109,7 +113,7 @@ func (m *MockTaskManager) StartSeedTask(ctx context.Context, req *SeedTaskReques } // StartSeedTask indicates an expected call of StartSeedTask. -func (mr *MockTaskManagerMockRecorder) StartSeedTask(ctx, req interface{}) *gomock.Call { +func (mr *MockTaskManagerMockRecorder) StartSeedTask(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartSeedTask", reflect.TypeOf((*MockTaskManager)(nil).StartSeedTask), ctx, req) } @@ -125,22 +129,22 @@ func (m *MockTaskManager) StartStreamTask(ctx context.Context, req *StreamTaskRe } // StartStreamTask indicates an expected call of StartStreamTask. -func (mr *MockTaskManagerMockRecorder) StartStreamTask(ctx, req interface{}) *gomock.Call { +func (mr *MockTaskManagerMockRecorder) StartStreamTask(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartStreamTask", reflect.TypeOf((*MockTaskManager)(nil).StartStreamTask), ctx, req) } // StatTask mocks base method. -func (m *MockTaskManager) StatTask(ctx context.Context, taskID string) (*v10.Task, error) { +func (m *MockTaskManager) StatTask(ctx context.Context, taskID string) (*scheduler.Task, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StatTask", ctx, taskID) - ret0, _ := ret[0].(*v10.Task) + ret0, _ := ret[0].(*scheduler.Task) ret1, _ := ret[1].(error) return ret0, ret1 } // StatTask indicates an expected call of StatTask. -func (mr *MockTaskManagerMockRecorder) StatTask(ctx, taskID interface{}) *gomock.Call { +func (mr *MockTaskManagerMockRecorder) StatTask(ctx, taskID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StatTask", reflect.TypeOf((*MockTaskManager)(nil).StatTask), ctx, taskID) } @@ -154,13 +158,13 @@ func (m *MockTaskManager) Stop(ctx context.Context) error { } // Stop indicates an expected call of Stop. -func (mr *MockTaskManagerMockRecorder) Stop(ctx interface{}) *gomock.Call { +func (mr *MockTaskManagerMockRecorder) Stop(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockTaskManager)(nil).Stop), ctx) } // Subscribe mocks base method. -func (m *MockTaskManager) Subscribe(request *v1.PieceTaskRequest) (*SubscribeResponse, bool) { +func (m *MockTaskManager) Subscribe(request *common.PieceTaskRequest) (*SubscribeResponse, bool) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Subscribe", request) ret0, _ := ret[0].(*SubscribeResponse) @@ -169,7 +173,7 @@ func (m *MockTaskManager) Subscribe(request *v1.PieceTaskRequest) (*SubscribeRes } // Subscribe indicates an expected call of Subscribe. -func (mr *MockTaskManagerMockRecorder) Subscribe(request interface{}) *gomock.Call { +func (mr *MockTaskManagerMockRecorder) Subscribe(request any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subscribe", reflect.TypeOf((*MockTaskManager)(nil).Subscribe), request) } @@ -204,7 +208,7 @@ func (m *MockTask) AddTraffic(arg0 uint64) { } // AddTraffic indicates an expected call of AddTraffic. -func (mr *MockTaskMockRecorder) AddTraffic(arg0 interface{}) *gomock.Call { +func (mr *MockTaskMockRecorder) AddTraffic(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddTraffic", reflect.TypeOf((*MockTask)(nil).AddTraffic), arg0) } @@ -322,10 +326,10 @@ func (mr *MockTaskMockRecorder) GetTraffic() *gomock.Call { } // Log mocks base method. -func (m *MockTask) Log() *dflog.SugaredLoggerOnWith { +func (m *MockTask) Log() *logger.SugaredLoggerOnWith { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Log") - ret0, _ := ret[0].(*dflog.SugaredLoggerOnWith) + ret0, _ := ret[0].(*logger.SugaredLoggerOnWith) return ret0 } @@ -342,7 +346,7 @@ func (m *MockTask) PublishPieceInfo(pieceNum int32, size uint32) { } // PublishPieceInfo indicates an expected call of PublishPieceInfo. -func (mr *MockTaskMockRecorder) PublishPieceInfo(pieceNum, size interface{}) *gomock.Call { +func (mr *MockTaskMockRecorder) PublishPieceInfo(pieceNum, size any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PublishPieceInfo", reflect.TypeOf((*MockTask)(nil).PublishPieceInfo), pieceNum, size) } @@ -354,7 +358,7 @@ func (m *MockTask) ReportPieceResult(request *DownloadPieceRequest, result *Down } // ReportPieceResult indicates an expected call of ReportPieceResult. -func (mr *MockTaskMockRecorder) ReportPieceResult(request, result, err interface{}) *gomock.Call { +func (mr *MockTaskMockRecorder) ReportPieceResult(request, result, err any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReportPieceResult", reflect.TypeOf((*MockTask)(nil).ReportPieceResult), request, result, err) } @@ -366,7 +370,7 @@ func (m *MockTask) SetContentLength(arg0 int64) { } // SetContentLength indicates an expected call of SetContentLength. -func (mr *MockTaskMockRecorder) SetContentLength(arg0 interface{}) *gomock.Call { +func (mr *MockTaskMockRecorder) SetContentLength(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetContentLength", reflect.TypeOf((*MockTask)(nil).SetContentLength), arg0) } @@ -378,7 +382,7 @@ func (m *MockTask) SetPieceMd5Sign(arg0 string) { } // SetPieceMd5Sign indicates an expected call of SetPieceMd5Sign. -func (mr *MockTaskMockRecorder) SetPieceMd5Sign(arg0 interface{}) *gomock.Call { +func (mr *MockTaskMockRecorder) SetPieceMd5Sign(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPieceMd5Sign", reflect.TypeOf((*MockTask)(nil).SetPieceMd5Sign), arg0) } @@ -390,7 +394,7 @@ func (m *MockTask) SetTotalPieces(arg0 int32) { } // SetTotalPieces indicates an expected call of SetTotalPieces. -func (mr *MockTaskMockRecorder) SetTotalPieces(arg0 interface{}) *gomock.Call { +func (mr *MockTaskMockRecorder) SetTotalPieces(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTotalPieces", reflect.TypeOf((*MockTask)(nil).SetTotalPieces), arg0) } @@ -402,7 +406,7 @@ func (m *MockTask) UpdateSourceErrorStatus(st *status.Status) { } // UpdateSourceErrorStatus indicates an expected call of UpdateSourceErrorStatus. -func (mr *MockTaskMockRecorder) UpdateSourceErrorStatus(st interface{}) *gomock.Call { +func (mr *MockTaskMockRecorder) UpdateSourceErrorStatus(st any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSourceErrorStatus", reflect.TypeOf((*MockTask)(nil).UpdateSourceErrorStatus), st) } @@ -431,10 +435,10 @@ func (m *MockLogger) EXPECT() *MockLoggerMockRecorder { } // Log mocks base method. -func (m *MockLogger) Log() *dflog.SugaredLoggerOnWith { +func (m *MockLogger) Log() *logger.SugaredLoggerOnWith { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Log") - ret0, _ := ret[0].(*dflog.SugaredLoggerOnWith) + ret0, _ := ret[0].(*logger.SugaredLoggerOnWith) return ret0 } diff --git a/client/daemon/peer/peertask_manager_test.go b/client/daemon/peer/peertask_manager_test.go index ad4825b8f9a..facec4c5dd7 100644 --- a/client/daemon/peer/peertask_manager_test.go +++ b/client/daemon/peer/peertask_manager_test.go @@ -32,10 +32,10 @@ import ( "time" "github.com/go-http-utils/headers" - "github.com/golang/mock/gomock" "github.com/phayes/freeport" testifyassert "github.com/stretchr/testify/assert" testifyrequire "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "go.uber.org/zap/zapcore" "golang.org/x/time/rate" "google.golang.org/grpc" diff --git a/client/daemon/peer/peertask_piecetask_synchronizer_test.go b/client/daemon/peer/peertask_piecetask_synchronizer_test.go index c51d9ab6718..7e3e452bc83 100644 --- a/client/daemon/peer/peertask_piecetask_synchronizer_test.go +++ b/client/daemon/peer/peertask_piecetask_synchronizer_test.go @@ -21,9 +21,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" testifyassert "github.com/stretchr/testify/assert" "go.uber.org/atomic" + "go.uber.org/mock/gomock" schedulerv1 "d7y.io/api/v2/pkg/apis/scheduler/v1" "d7y.io/api/v2/pkg/apis/scheduler/v1/mocks" diff --git a/client/daemon/peer/peertask_reuse_test.go b/client/daemon/peer/peertask_reuse_test.go index 478ffdc2472..c9136a00268 100644 --- a/client/daemon/peer/peertask_reuse_test.go +++ b/client/daemon/peer/peertask_reuse_test.go @@ -27,8 +27,8 @@ import ( "time" "github.com/go-http-utils/headers" - "github.com/golang/mock/gomock" testifyassert "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "google.golang.org/grpc/credentials/insecure" commonv1 "d7y.io/api/v2/pkg/apis/common/v1" diff --git a/client/daemon/peer/peertask_stream_backsource_partial_test.go b/client/daemon/peer/peertask_stream_backsource_partial_test.go index a62359e561a..eb81a18f31e 100644 --- a/client/daemon/peer/peertask_stream_backsource_partial_test.go +++ b/client/daemon/peer/peertask_stream_backsource_partial_test.go @@ -29,11 +29,11 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/phayes/freeport" testifyassert "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/atomic" + "go.uber.org/mock/gomock" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/health" diff --git a/client/daemon/peer/peertask_stream_resume_test.go b/client/daemon/peer/peertask_stream_resume_test.go index ebd99ab0048..8306cb03593 100644 --- a/client/daemon/peer/peertask_stream_resume_test.go +++ b/client/daemon/peer/peertask_stream_resume_test.go @@ -26,9 +26,9 @@ import ( "time" "github.com/go-http-utils/headers" - "github.com/golang/mock/gomock" testifyassert "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" diff --git a/client/daemon/peer/piece_downloader_mock.go b/client/daemon/peer/piece_downloader_mock.go index bacd6a89b89..6f56ec358d7 100644 --- a/client/daemon/peer/piece_downloader_mock.go +++ b/client/daemon/peer/piece_downloader_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: piece_downloader.go - +// +// Generated by this command: +// +// mockgen -destination piece_downloader_mock.go -source piece_downloader.go -package peer +// // Package peer is a generated GoMock package. package peer @@ -9,7 +13,7 @@ import ( io "io" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockPieceDownloader is a mock of PieceDownloader interface. @@ -46,7 +50,7 @@ func (m *MockPieceDownloader) DownloadPiece(arg0 context.Context, arg1 *Download } // DownloadPiece indicates an expected call of DownloadPiece. -func (mr *MockPieceDownloaderMockRecorder) DownloadPiece(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockPieceDownloaderMockRecorder) DownloadPiece(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DownloadPiece", reflect.TypeOf((*MockPieceDownloader)(nil).DownloadPiece), arg0, arg1) } diff --git a/client/daemon/peer/piece_manager_mock.go b/client/daemon/peer/piece_manager_mock.go index 6aad5da6edc..4764bfcd377 100644 --- a/client/daemon/peer/piece_manager_mock.go +++ b/client/daemon/peer/piece_manager_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: piece_manager.go - +// +// Generated by this command: +// +// mockgen -destination piece_manager_mock.go -source piece_manager.go -package peer +// // Package peer is a generated GoMock package. package peer @@ -9,11 +13,11 @@ import ( io "io" reflect "reflect" - v1 "d7y.io/api/v2/pkg/apis/dfdaemon/v1" - v10 "d7y.io/api/v2/pkg/apis/scheduler/v1" + dfdaemon "d7y.io/api/v2/pkg/apis/dfdaemon/v1" + scheduler "d7y.io/api/v2/pkg/apis/scheduler/v1" storage "d7y.io/dragonfly/v2/client/daemon/storage" http "d7y.io/dragonfly/v2/pkg/net/http" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockPieceManager is a mock of PieceManager interface. @@ -49,13 +53,13 @@ func (m *MockPieceManager) DownloadPiece(ctx context.Context, request *DownloadP } // DownloadPiece indicates an expected call of DownloadPiece. -func (mr *MockPieceManagerMockRecorder) DownloadPiece(ctx, request interface{}) *gomock.Call { +func (mr *MockPieceManagerMockRecorder) DownloadPiece(ctx, request any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DownloadPiece", reflect.TypeOf((*MockPieceManager)(nil).DownloadPiece), ctx, request) } // DownloadSource mocks base method. -func (m *MockPieceManager) DownloadSource(ctx context.Context, pt Task, request *v10.PeerTaskRequest, parsedRange *http.Range) error { +func (m *MockPieceManager) DownloadSource(ctx context.Context, pt Task, request *scheduler.PeerTaskRequest, parsedRange *http.Range) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DownloadSource", ctx, pt, request, parsedRange) ret0, _ := ret[0].(error) @@ -63,7 +67,7 @@ func (m *MockPieceManager) DownloadSource(ctx context.Context, pt Task, request } // DownloadSource indicates an expected call of DownloadSource. -func (mr *MockPieceManagerMockRecorder) DownloadSource(ctx, pt, request, parsedRange interface{}) *gomock.Call { +func (mr *MockPieceManagerMockRecorder) DownloadSource(ctx, pt, request, parsedRange any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DownloadSource", reflect.TypeOf((*MockPieceManager)(nil).DownloadSource), ctx, pt, request, parsedRange) } @@ -77,13 +81,13 @@ func (m *MockPieceManager) Import(ctx context.Context, ptm storage.PeerTaskMetad } // Import indicates an expected call of Import. -func (mr *MockPieceManagerMockRecorder) Import(ctx, ptm, tsd, contentLength, reader interface{}) *gomock.Call { +func (mr *MockPieceManagerMockRecorder) Import(ctx, ptm, tsd, contentLength, reader any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Import", reflect.TypeOf((*MockPieceManager)(nil).Import), ctx, ptm, tsd, contentLength, reader) } // ImportFile mocks base method. -func (m *MockPieceManager) ImportFile(ctx context.Context, ptm storage.PeerTaskMetadata, tsd storage.TaskStorageDriver, req *v1.ImportTaskRequest) error { +func (m *MockPieceManager) ImportFile(ctx context.Context, ptm storage.PeerTaskMetadata, tsd storage.TaskStorageDriver, req *dfdaemon.ImportTaskRequest) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ImportFile", ctx, ptm, tsd, req) ret0, _ := ret[0].(error) @@ -91,7 +95,7 @@ func (m *MockPieceManager) ImportFile(ctx context.Context, ptm storage.PeerTaskM } // ImportFile indicates an expected call of ImportFile. -func (mr *MockPieceManagerMockRecorder) ImportFile(ctx, ptm, tsd, req interface{}) *gomock.Call { +func (mr *MockPieceManagerMockRecorder) ImportFile(ctx, ptm, tsd, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImportFile", reflect.TypeOf((*MockPieceManager)(nil).ImportFile), ctx, ptm, tsd, req) } diff --git a/client/daemon/peer/piece_manager_test.go b/client/daemon/peer/piece_manager_test.go index 8cf36356fc9..493aebdf6b3 100644 --- a/client/daemon/peer/piece_manager_test.go +++ b/client/daemon/peer/piece_manager_test.go @@ -30,10 +30,10 @@ import ( "time" "github.com/go-http-utils/headers" - "github.com/golang/mock/gomock" testifyassert "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/atomic" + "go.uber.org/mock/gomock" "golang.org/x/time/rate" commonv1 "d7y.io/api/v2/pkg/apis/common/v1" diff --git a/client/daemon/peer/traffic_shaper_test.go b/client/daemon/peer/traffic_shaper_test.go index d90512e33cc..a609b2db3ba 100644 --- a/client/daemon/peer/traffic_shaper_test.go +++ b/client/daemon/peer/traffic_shaper_test.go @@ -28,10 +28,10 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/phayes/freeport" testifyassert "github.com/stretchr/testify/assert" testifyrequire "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "golang.org/x/time/rate" "google.golang.org/grpc" "google.golang.org/grpc/codes" diff --git a/client/daemon/proxy/mocks/proxy_manager_mock.go b/client/daemon/proxy/mocks/proxy_manager_mock.go index b62d445f6a7..21d2b63f096 100644 --- a/client/daemon/proxy/mocks/proxy_manager_mock.go +++ b/client/daemon/proxy/mocks/proxy_manager_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: proxy_manager.go - +// +// Generated by this command: +// +// mockgen -destination mocks/proxy_manager_mock.go -source proxy_manager.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -9,7 +13,7 @@ import ( reflect "reflect" config "d7y.io/dragonfly/v2/client/config" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockManager is a mock of Manager interface. @@ -58,7 +62,7 @@ func (m *MockManager) Serve(arg0 net.Listener) error { } // Serve indicates an expected call of Serve. -func (mr *MockManagerMockRecorder) Serve(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) Serve(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Serve", reflect.TypeOf((*MockManager)(nil).Serve), arg0) } @@ -72,7 +76,7 @@ func (m *MockManager) ServeSNI(arg0 net.Listener) error { } // ServeSNI indicates an expected call of ServeSNI. -func (mr *MockManagerMockRecorder) ServeSNI(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) ServeSNI(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServeSNI", reflect.TypeOf((*MockManager)(nil).ServeSNI), arg0) } @@ -98,7 +102,7 @@ func (m *MockManager) Watch(arg0 *config.ProxyOption) { } // Watch indicates an expected call of Watch. -func (mr *MockManagerMockRecorder) Watch(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) Watch(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Watch", reflect.TypeOf((*MockManager)(nil).Watch), arg0) } @@ -133,7 +137,7 @@ func (m *MockConfigWatcher) Watch(arg0 *config.ProxyOption) { } // Watch indicates an expected call of Watch. -func (mr *MockConfigWatcherMockRecorder) Watch(arg0 interface{}) *gomock.Call { +func (mr *MockConfigWatcherMockRecorder) Watch(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Watch", reflect.TypeOf((*MockConfigWatcher)(nil).Watch), arg0) } diff --git a/client/daemon/rpcserver/mocks/rpcserver_mock.go b/client/daemon/rpcserver/mocks/rpcserver_mock.go index 59864c169ed..d6034e951d4 100644 --- a/client/daemon/rpcserver/mocks/rpcserver_mock.go +++ b/client/daemon/rpcserver/mocks/rpcserver_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: rpcserver.go - +// +// Generated by this command: +// +// mockgen -destination mocks/rpcserver_mock.go -source rpcserver.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -11,7 +15,7 @@ import ( dfdaemon "d7y.io/api/v2/pkg/apis/dfdaemon/v1" config "d7y.io/dragonfly/v2/client/config" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockServer is a mock of Server interface. @@ -46,7 +50,7 @@ func (m *MockServer) Alive(alive time.Duration) bool { } // Alive indicates an expected call of Alive. -func (mr *MockServerMockRecorder) Alive(alive interface{}) *gomock.Call { +func (mr *MockServerMockRecorder) Alive(alive any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Alive", reflect.TypeOf((*MockServer)(nil).Alive), alive) } @@ -70,7 +74,7 @@ func (m *MockServer) OnNotify(arg0 *config.DynconfigData) { } // OnNotify indicates an expected call of OnNotify. -func (mr *MockServerMockRecorder) OnNotify(arg0 interface{}) *gomock.Call { +func (mr *MockServerMockRecorder) OnNotify(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnNotify", reflect.TypeOf((*MockServer)(nil).OnNotify), arg0) } @@ -84,7 +88,7 @@ func (m *MockServer) ServeDownload(listener net.Listener) error { } // ServeDownload indicates an expected call of ServeDownload. -func (mr *MockServerMockRecorder) ServeDownload(listener interface{}) *gomock.Call { +func (mr *MockServerMockRecorder) ServeDownload(listener any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServeDownload", reflect.TypeOf((*MockServer)(nil).ServeDownload), listener) } @@ -98,7 +102,7 @@ func (m *MockServer) ServePeer(listener net.Listener) error { } // ServePeer indicates an expected call of ServePeer. -func (mr *MockServerMockRecorder) ServePeer(listener interface{}) *gomock.Call { +func (mr *MockServerMockRecorder) ServePeer(listener any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServePeer", reflect.TypeOf((*MockServer)(nil).ServePeer), listener) } @@ -147,7 +151,7 @@ func (m *MockResultSender) Send(arg0 *dfdaemon.DownResult) error { } // Send indicates an expected call of Send. -func (mr *MockResultSenderMockRecorder) Send(arg0 interface{}) *gomock.Call { +func (mr *MockResultSenderMockRecorder) Send(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockResultSender)(nil).Send), arg0) } diff --git a/client/daemon/rpcserver/rpcserver_test.go b/client/daemon/rpcserver/rpcserver_test.go index e7afbf59aa3..4dc840d176c 100644 --- a/client/daemon/rpcserver/rpcserver_test.go +++ b/client/daemon/rpcserver/rpcserver_test.go @@ -26,8 +26,8 @@ import ( "testing" "github.com/distribution/distribution/v3/uuid" - "github.com/golang/mock/gomock" testifyassert "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "google.golang.org/grpc" "google.golang.org/grpc/health" diff --git a/client/daemon/rpcserver/seeder_test.go b/client/daemon/rpcserver/seeder_test.go index 2fe2a517858..13f7c62b914 100644 --- a/client/daemon/rpcserver/seeder_test.go +++ b/client/daemon/rpcserver/seeder_test.go @@ -24,11 +24,11 @@ import ( "sync" "testing" - "github.com/golang/mock/gomock" "github.com/phayes/freeport" testifyassert "github.com/stretchr/testify/assert" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/trace" + "go.uber.org/mock/gomock" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/health" diff --git a/client/daemon/storage/mocks/stroage_manager_mock.go b/client/daemon/storage/mocks/stroage_manager_mock.go index e17af27a465..3d1d8cb6519 100644 --- a/client/daemon/storage/mocks/stroage_manager_mock.go +++ b/client/daemon/storage/mocks/stroage_manager_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: storage_manager.go - +// +// Generated by this command: +// +// mockgen -destination mocks/stroage_manager_mock.go -source storage_manager.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -13,7 +17,7 @@ import ( common "d7y.io/api/v2/pkg/apis/common/v1" storage "d7y.io/dragonfly/v2/client/daemon/storage" http "d7y.io/dragonfly/v2/pkg/net/http" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockTaskStorageDriver is a mock of TaskStorageDriver interface. @@ -49,7 +53,7 @@ func (m *MockTaskStorageDriver) GetExtendAttribute(ctx context.Context, req *sto } // GetExtendAttribute indicates an expected call of GetExtendAttribute. -func (mr *MockTaskStorageDriverMockRecorder) GetExtendAttribute(ctx, req interface{}) *gomock.Call { +func (mr *MockTaskStorageDriverMockRecorder) GetExtendAttribute(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExtendAttribute", reflect.TypeOf((*MockTaskStorageDriver)(nil).GetExtendAttribute), ctx, req) } @@ -64,7 +68,7 @@ func (m *MockTaskStorageDriver) GetPieces(ctx context.Context, req *common.Piece } // GetPieces indicates an expected call of GetPieces. -func (mr *MockTaskStorageDriverMockRecorder) GetPieces(ctx, req interface{}) *gomock.Call { +func (mr *MockTaskStorageDriverMockRecorder) GetPieces(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPieces", reflect.TypeOf((*MockTaskStorageDriver)(nil).GetPieces), ctx, req) } @@ -79,7 +83,7 @@ func (m *MockTaskStorageDriver) GetTotalPieces(ctx context.Context, req *storage } // GetTotalPieces indicates an expected call of GetTotalPieces. -func (mr *MockTaskStorageDriverMockRecorder) GetTotalPieces(ctx, req interface{}) *gomock.Call { +func (mr *MockTaskStorageDriverMockRecorder) GetTotalPieces(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTotalPieces", reflect.TypeOf((*MockTaskStorageDriver)(nil).GetTotalPieces), ctx, req) } @@ -94,7 +98,7 @@ func (m *MockTaskStorageDriver) IsInvalid(req *storage.PeerTaskMetadata) (bool, } // IsInvalid indicates an expected call of IsInvalid. -func (mr *MockTaskStorageDriverMockRecorder) IsInvalid(req interface{}) *gomock.Call { +func (mr *MockTaskStorageDriverMockRecorder) IsInvalid(req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsInvalid", reflect.TypeOf((*MockTaskStorageDriver)(nil).IsInvalid), req) } @@ -109,7 +113,7 @@ func (m *MockTaskStorageDriver) ReadAllPieces(ctx context.Context, req *storage. } // ReadAllPieces indicates an expected call of ReadAllPieces. -func (mr *MockTaskStorageDriverMockRecorder) ReadAllPieces(ctx, req interface{}) *gomock.Call { +func (mr *MockTaskStorageDriverMockRecorder) ReadAllPieces(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadAllPieces", reflect.TypeOf((*MockTaskStorageDriver)(nil).ReadAllPieces), ctx, req) } @@ -125,7 +129,7 @@ func (m *MockTaskStorageDriver) ReadPiece(ctx context.Context, req *storage.Read } // ReadPiece indicates an expected call of ReadPiece. -func (mr *MockTaskStorageDriverMockRecorder) ReadPiece(ctx, req interface{}) *gomock.Call { +func (mr *MockTaskStorageDriverMockRecorder) ReadPiece(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadPiece", reflect.TypeOf((*MockTaskStorageDriver)(nil).ReadPiece), ctx, req) } @@ -139,7 +143,7 @@ func (m *MockTaskStorageDriver) Store(ctx context.Context, req *storage.StoreReq } // Store indicates an expected call of Store. -func (mr *MockTaskStorageDriverMockRecorder) Store(ctx, req interface{}) *gomock.Call { +func (mr *MockTaskStorageDriverMockRecorder) Store(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Store", reflect.TypeOf((*MockTaskStorageDriver)(nil).Store), ctx, req) } @@ -153,7 +157,7 @@ func (m *MockTaskStorageDriver) UpdateTask(ctx context.Context, req *storage.Upd } // UpdateTask indicates an expected call of UpdateTask. -func (mr *MockTaskStorageDriverMockRecorder) UpdateTask(ctx, req interface{}) *gomock.Call { +func (mr *MockTaskStorageDriverMockRecorder) UpdateTask(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTask", reflect.TypeOf((*MockTaskStorageDriver)(nil).UpdateTask), ctx, req) } @@ -167,7 +171,7 @@ func (m *MockTaskStorageDriver) ValidateDigest(req *storage.PeerTaskMetadata) er } // ValidateDigest indicates an expected call of ValidateDigest. -func (mr *MockTaskStorageDriverMockRecorder) ValidateDigest(req interface{}) *gomock.Call { +func (mr *MockTaskStorageDriverMockRecorder) ValidateDigest(req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateDigest", reflect.TypeOf((*MockTaskStorageDriver)(nil).ValidateDigest), req) } @@ -182,7 +186,7 @@ func (m *MockTaskStorageDriver) WritePiece(ctx context.Context, req *storage.Wri } // WritePiece indicates an expected call of WritePiece. -func (mr *MockTaskStorageDriverMockRecorder) WritePiece(ctx, req interface{}) *gomock.Call { +func (mr *MockTaskStorageDriverMockRecorder) WritePiece(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WritePiece", reflect.TypeOf((*MockTaskStorageDriver)(nil).WritePiece), ctx, req) } @@ -282,7 +286,7 @@ func (m *MockManager) Alive(alive time.Duration) bool { } // Alive indicates an expected call of Alive. -func (mr *MockManagerMockRecorder) Alive(alive interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) Alive(alive any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Alive", reflect.TypeOf((*MockManager)(nil).Alive), alive) } @@ -308,7 +312,7 @@ func (m *MockManager) FindCompletedSubTask(taskID string) *storage.ReusePeerTask } // FindCompletedSubTask indicates an expected call of FindCompletedSubTask. -func (mr *MockManagerMockRecorder) FindCompletedSubTask(taskID interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) FindCompletedSubTask(taskID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindCompletedSubTask", reflect.TypeOf((*MockManager)(nil).FindCompletedSubTask), taskID) } @@ -322,7 +326,7 @@ func (m *MockManager) FindCompletedTask(taskID string) *storage.ReusePeerTask { } // FindCompletedTask indicates an expected call of FindCompletedTask. -func (mr *MockManagerMockRecorder) FindCompletedTask(taskID interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) FindCompletedTask(taskID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindCompletedTask", reflect.TypeOf((*MockManager)(nil).FindCompletedTask), taskID) } @@ -336,7 +340,7 @@ func (m *MockManager) FindPartialCompletedTask(taskID string, rg *http.Range) *s } // FindPartialCompletedTask indicates an expected call of FindPartialCompletedTask. -func (mr *MockManagerMockRecorder) FindPartialCompletedTask(taskID, rg interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) FindPartialCompletedTask(taskID, rg any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindPartialCompletedTask", reflect.TypeOf((*MockManager)(nil).FindPartialCompletedTask), taskID, rg) } @@ -351,7 +355,7 @@ func (m *MockManager) GetExtendAttribute(ctx context.Context, req *storage.PeerT } // GetExtendAttribute indicates an expected call of GetExtendAttribute. -func (mr *MockManagerMockRecorder) GetExtendAttribute(ctx, req interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) GetExtendAttribute(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExtendAttribute", reflect.TypeOf((*MockManager)(nil).GetExtendAttribute), ctx, req) } @@ -366,7 +370,7 @@ func (m *MockManager) GetPieces(ctx context.Context, req *common.PieceTaskReques } // GetPieces indicates an expected call of GetPieces. -func (mr *MockManagerMockRecorder) GetPieces(ctx, req interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) GetPieces(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPieces", reflect.TypeOf((*MockManager)(nil).GetPieces), ctx, req) } @@ -381,7 +385,7 @@ func (m *MockManager) GetTotalPieces(ctx context.Context, req *storage.PeerTaskM } // GetTotalPieces indicates an expected call of GetTotalPieces. -func (mr *MockManagerMockRecorder) GetTotalPieces(ctx, req interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) GetTotalPieces(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTotalPieces", reflect.TypeOf((*MockManager)(nil).GetTotalPieces), ctx, req) } @@ -396,7 +400,7 @@ func (m *MockManager) IsInvalid(req *storage.PeerTaskMetadata) (bool, error) { } // IsInvalid indicates an expected call of IsInvalid. -func (mr *MockManagerMockRecorder) IsInvalid(req interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) IsInvalid(req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsInvalid", reflect.TypeOf((*MockManager)(nil).IsInvalid), req) } @@ -423,7 +427,7 @@ func (m *MockManager) ReadAllPieces(ctx context.Context, req *storage.ReadAllPie } // ReadAllPieces indicates an expected call of ReadAllPieces. -func (mr *MockManagerMockRecorder) ReadAllPieces(ctx, req interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) ReadAllPieces(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadAllPieces", reflect.TypeOf((*MockManager)(nil).ReadAllPieces), ctx, req) } @@ -439,7 +443,7 @@ func (m *MockManager) ReadPiece(ctx context.Context, req *storage.ReadPieceReque } // ReadPiece indicates an expected call of ReadPiece. -func (mr *MockManagerMockRecorder) ReadPiece(ctx, req interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) ReadPiece(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadPiece", reflect.TypeOf((*MockManager)(nil).ReadPiece), ctx, req) } @@ -454,7 +458,7 @@ func (m *MockManager) RegisterSubTask(ctx context.Context, req *storage.Register } // RegisterSubTask indicates an expected call of RegisterSubTask. -func (mr *MockManagerMockRecorder) RegisterSubTask(ctx, req interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) RegisterSubTask(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterSubTask", reflect.TypeOf((*MockManager)(nil).RegisterSubTask), ctx, req) } @@ -469,7 +473,7 @@ func (m *MockManager) RegisterTask(ctx context.Context, req *storage.RegisterTas } // RegisterTask indicates an expected call of RegisterTask. -func (mr *MockManagerMockRecorder) RegisterTask(ctx, req interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) RegisterTask(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterTask", reflect.TypeOf((*MockManager)(nil).RegisterTask), ctx, req) } @@ -483,7 +487,7 @@ func (m *MockManager) Store(ctx context.Context, req *storage.StoreRequest) erro } // Store indicates an expected call of Store. -func (mr *MockManagerMockRecorder) Store(ctx, req interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) Store(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Store", reflect.TypeOf((*MockManager)(nil).Store), ctx, req) } @@ -497,7 +501,7 @@ func (m *MockManager) UnregisterTask(ctx context.Context, req storage.CommonTask } // UnregisterTask indicates an expected call of UnregisterTask. -func (mr *MockManagerMockRecorder) UnregisterTask(ctx, req interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) UnregisterTask(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterTask", reflect.TypeOf((*MockManager)(nil).UnregisterTask), ctx, req) } @@ -511,7 +515,7 @@ func (m *MockManager) UpdateTask(ctx context.Context, req *storage.UpdateTaskReq } // UpdateTask indicates an expected call of UpdateTask. -func (mr *MockManagerMockRecorder) UpdateTask(ctx, req interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) UpdateTask(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTask", reflect.TypeOf((*MockManager)(nil).UpdateTask), ctx, req) } @@ -525,7 +529,7 @@ func (m *MockManager) ValidateDigest(req *storage.PeerTaskMetadata) error { } // ValidateDigest indicates an expected call of ValidateDigest. -func (mr *MockManagerMockRecorder) ValidateDigest(req interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) ValidateDigest(req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateDigest", reflect.TypeOf((*MockManager)(nil).ValidateDigest), req) } @@ -540,7 +544,7 @@ func (m *MockManager) WritePiece(ctx context.Context, req *storage.WritePieceReq } // WritePiece indicates an expected call of WritePiece. -func (mr *MockManagerMockRecorder) WritePiece(ctx, req interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) WritePiece(ctx, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WritePiece", reflect.TypeOf((*MockManager)(nil).WritePiece), ctx, req) } diff --git a/client/daemon/transport/transport_test.go b/client/daemon/transport/transport_test.go index 6d8f679f3a2..6568c4f6a06 100644 --- a/client/daemon/transport/transport_test.go +++ b/client/daemon/transport/transport_test.go @@ -24,8 +24,8 @@ import ( "os" "testing" - "github.com/golang/mock/gomock" testifyassert "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "d7y.io/dragonfly/v2/client/daemon/peer" "d7y.io/dragonfly/v2/client/daemon/test" diff --git a/client/daemon/upload/mocks/upload_manager_mock.go b/client/daemon/upload/mocks/upload_manager_mock.go index 79908cd4348..d6cbe8aa8e9 100644 --- a/client/daemon/upload/mocks/upload_manager_mock.go +++ b/client/daemon/upload/mocks/upload_manager_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: upload_manager.go - +// +// Generated by this command: +// +// mockgen -destination mocks/upload_manager_mock.go -source upload_manager.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -8,7 +12,7 @@ import ( net "net" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockManager is a mock of Manager interface. @@ -43,7 +47,7 @@ func (m *MockManager) Serve(lis net.Listener) error { } // Serve indicates an expected call of Serve. -func (mr *MockManagerMockRecorder) Serve(lis interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) Serve(lis any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Serve", reflect.TypeOf((*MockManager)(nil).Serve), lis) } diff --git a/client/daemon/upload/upload_manager_test.go b/client/daemon/upload/upload_manager_test.go index d96ed99b22a..2b8164e420b 100644 --- a/client/daemon/upload/upload_manager_test.go +++ b/client/daemon/upload/upload_manager_test.go @@ -26,8 +26,8 @@ import ( "os" "testing" - "github.com/golang/mock/gomock" testifyassert "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "golang.org/x/time/rate" "d7y.io/dragonfly/v2/client/config" diff --git a/client/dfget/dfget_test.go b/client/dfget/dfget_test.go index 7959ad28406..264bea1cd3f 100644 --- a/client/dfget/dfget_test.go +++ b/client/dfget/dfget_test.go @@ -24,10 +24,10 @@ import ( "strings" "testing" - "github.com/golang/mock/gomock" "github.com/google/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "d7y.io/dragonfly/v2/client/config" "d7y.io/dragonfly/v2/pkg/digest" diff --git a/client/dfstore/mocks/dfstore_mock.go b/client/dfstore/mocks/dfstore_mock.go index 1122d99691e..d6dcc5d200f 100644 --- a/client/dfstore/mocks/dfstore_mock.go +++ b/client/dfstore/mocks/dfstore_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: dfstore.go - +// +// Generated by this command: +// +// mockgen -destination mocks/dfstore_mock.go -source dfstore.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -12,7 +16,7 @@ import ( dfstore "d7y.io/dragonfly/v2/client/dfstore" objectstorage "d7y.io/dragonfly/v2/pkg/objectstorage" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockDfstore is a mock of Dfstore interface. @@ -48,7 +52,7 @@ func (m *MockDfstore) CopyObjectRequestWithContext(ctx context.Context, input *d } // CopyObjectRequestWithContext indicates an expected call of CopyObjectRequestWithContext. -func (mr *MockDfstoreMockRecorder) CopyObjectRequestWithContext(ctx, input interface{}) *gomock.Call { +func (mr *MockDfstoreMockRecorder) CopyObjectRequestWithContext(ctx, input any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CopyObjectRequestWithContext", reflect.TypeOf((*MockDfstore)(nil).CopyObjectRequestWithContext), ctx, input) } @@ -62,7 +66,7 @@ func (m *MockDfstore) CopyObjectWithContext(ctx context.Context, input *dfstore. } // CopyObjectWithContext indicates an expected call of CopyObjectWithContext. -func (mr *MockDfstoreMockRecorder) CopyObjectWithContext(ctx, input interface{}) *gomock.Call { +func (mr *MockDfstoreMockRecorder) CopyObjectWithContext(ctx, input any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CopyObjectWithContext", reflect.TypeOf((*MockDfstore)(nil).CopyObjectWithContext), ctx, input) } @@ -77,7 +81,7 @@ func (m *MockDfstore) CreateBucketRequestWithContext(ctx context.Context, input } // CreateBucketRequestWithContext indicates an expected call of CreateBucketRequestWithContext. -func (mr *MockDfstoreMockRecorder) CreateBucketRequestWithContext(ctx, input interface{}) *gomock.Call { +func (mr *MockDfstoreMockRecorder) CreateBucketRequestWithContext(ctx, input any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBucketRequestWithContext", reflect.TypeOf((*MockDfstore)(nil).CreateBucketRequestWithContext), ctx, input) } @@ -91,7 +95,7 @@ func (m *MockDfstore) CreateBucketWithContext(ctx context.Context, input *dfstor } // CreateBucketWithContext indicates an expected call of CreateBucketWithContext. -func (mr *MockDfstoreMockRecorder) CreateBucketWithContext(ctx, input interface{}) *gomock.Call { +func (mr *MockDfstoreMockRecorder) CreateBucketWithContext(ctx, input any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBucketWithContext", reflect.TypeOf((*MockDfstore)(nil).CreateBucketWithContext), ctx, input) } @@ -106,7 +110,7 @@ func (m *MockDfstore) DeleteObjectRequestWithContext(ctx context.Context, input } // DeleteObjectRequestWithContext indicates an expected call of DeleteObjectRequestWithContext. -func (mr *MockDfstoreMockRecorder) DeleteObjectRequestWithContext(ctx, input interface{}) *gomock.Call { +func (mr *MockDfstoreMockRecorder) DeleteObjectRequestWithContext(ctx, input any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteObjectRequestWithContext", reflect.TypeOf((*MockDfstore)(nil).DeleteObjectRequestWithContext), ctx, input) } @@ -120,7 +124,7 @@ func (m *MockDfstore) DeleteObjectWithContext(ctx context.Context, input *dfstor } // DeleteObjectWithContext indicates an expected call of DeleteObjectWithContext. -func (mr *MockDfstoreMockRecorder) DeleteObjectWithContext(ctx, input interface{}) *gomock.Call { +func (mr *MockDfstoreMockRecorder) DeleteObjectWithContext(ctx, input any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteObjectWithContext", reflect.TypeOf((*MockDfstore)(nil).DeleteObjectWithContext), ctx, input) } @@ -135,7 +139,7 @@ func (m *MockDfstore) GetObjectMetadataRequestWithContext(ctx context.Context, i } // GetObjectMetadataRequestWithContext indicates an expected call of GetObjectMetadataRequestWithContext. -func (mr *MockDfstoreMockRecorder) GetObjectMetadataRequestWithContext(ctx, input interface{}) *gomock.Call { +func (mr *MockDfstoreMockRecorder) GetObjectMetadataRequestWithContext(ctx, input any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetObjectMetadataRequestWithContext", reflect.TypeOf((*MockDfstore)(nil).GetObjectMetadataRequestWithContext), ctx, input) } @@ -150,7 +154,7 @@ func (m *MockDfstore) GetObjectMetadataWithContext(ctx context.Context, input *d } // GetObjectMetadataWithContext indicates an expected call of GetObjectMetadataWithContext. -func (mr *MockDfstoreMockRecorder) GetObjectMetadataWithContext(ctx, input interface{}) *gomock.Call { +func (mr *MockDfstoreMockRecorder) GetObjectMetadataWithContext(ctx, input any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetObjectMetadataWithContext", reflect.TypeOf((*MockDfstore)(nil).GetObjectMetadataWithContext), ctx, input) } @@ -165,7 +169,7 @@ func (m *MockDfstore) GetObjectMetadatasRequestWithContext(ctx context.Context, } // GetObjectMetadatasRequestWithContext indicates an expected call of GetObjectMetadatasRequestWithContext. -func (mr *MockDfstoreMockRecorder) GetObjectMetadatasRequestWithContext(ctx, input interface{}) *gomock.Call { +func (mr *MockDfstoreMockRecorder) GetObjectMetadatasRequestWithContext(ctx, input any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetObjectMetadatasRequestWithContext", reflect.TypeOf((*MockDfstore)(nil).GetObjectMetadatasRequestWithContext), ctx, input) } @@ -180,7 +184,7 @@ func (m *MockDfstore) GetObjectMetadatasWithContext(ctx context.Context, input * } // GetObjectMetadatasWithContext indicates an expected call of GetObjectMetadatasWithContext. -func (mr *MockDfstoreMockRecorder) GetObjectMetadatasWithContext(ctx, input interface{}) *gomock.Call { +func (mr *MockDfstoreMockRecorder) GetObjectMetadatasWithContext(ctx, input any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetObjectMetadatasWithContext", reflect.TypeOf((*MockDfstore)(nil).GetObjectMetadatasWithContext), ctx, input) } @@ -195,7 +199,7 @@ func (m *MockDfstore) GetObjectRequestWithContext(ctx context.Context, input *df } // GetObjectRequestWithContext indicates an expected call of GetObjectRequestWithContext. -func (mr *MockDfstoreMockRecorder) GetObjectRequestWithContext(ctx, input interface{}) *gomock.Call { +func (mr *MockDfstoreMockRecorder) GetObjectRequestWithContext(ctx, input any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetObjectRequestWithContext", reflect.TypeOf((*MockDfstore)(nil).GetObjectRequestWithContext), ctx, input) } @@ -210,7 +214,7 @@ func (m *MockDfstore) GetObjectWithContext(ctx context.Context, input *dfstore.G } // GetObjectWithContext indicates an expected call of GetObjectWithContext. -func (mr *MockDfstoreMockRecorder) GetObjectWithContext(ctx, input interface{}) *gomock.Call { +func (mr *MockDfstoreMockRecorder) GetObjectWithContext(ctx, input any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetObjectWithContext", reflect.TypeOf((*MockDfstore)(nil).GetObjectWithContext), ctx, input) } @@ -225,7 +229,7 @@ func (m *MockDfstore) IsObjectExistRequestWithContext(ctx context.Context, input } // IsObjectExistRequestWithContext indicates an expected call of IsObjectExistRequestWithContext. -func (mr *MockDfstoreMockRecorder) IsObjectExistRequestWithContext(ctx, input interface{}) *gomock.Call { +func (mr *MockDfstoreMockRecorder) IsObjectExistRequestWithContext(ctx, input any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsObjectExistRequestWithContext", reflect.TypeOf((*MockDfstore)(nil).IsObjectExistRequestWithContext), ctx, input) } @@ -240,7 +244,7 @@ func (m *MockDfstore) IsObjectExistWithContext(ctx context.Context, input *dfsto } // IsObjectExistWithContext indicates an expected call of IsObjectExistWithContext. -func (mr *MockDfstoreMockRecorder) IsObjectExistWithContext(ctx, input interface{}) *gomock.Call { +func (mr *MockDfstoreMockRecorder) IsObjectExistWithContext(ctx, input any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsObjectExistWithContext", reflect.TypeOf((*MockDfstore)(nil).IsObjectExistWithContext), ctx, input) } @@ -255,7 +259,7 @@ func (m *MockDfstore) PutObjectRequestWithContext(ctx context.Context, input *df } // PutObjectRequestWithContext indicates an expected call of PutObjectRequestWithContext. -func (mr *MockDfstoreMockRecorder) PutObjectRequestWithContext(ctx, input interface{}) *gomock.Call { +func (mr *MockDfstoreMockRecorder) PutObjectRequestWithContext(ctx, input any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutObjectRequestWithContext", reflect.TypeOf((*MockDfstore)(nil).PutObjectRequestWithContext), ctx, input) } @@ -269,7 +273,7 @@ func (m *MockDfstore) PutObjectWithContext(ctx context.Context, input *dfstore.P } // PutObjectWithContext indicates an expected call of PutObjectWithContext. -func (mr *MockDfstoreMockRecorder) PutObjectWithContext(ctx, input interface{}) *gomock.Call { +func (mr *MockDfstoreMockRecorder) PutObjectWithContext(ctx, input any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutObjectWithContext", reflect.TypeOf((*MockDfstore)(nil).PutObjectWithContext), ctx, input) } diff --git a/client/util/mocks/keepalive_mock.go b/client/util/mocks/keepalive_mock.go index 71067fe21b0..cba04e12601 100644 --- a/client/util/mocks/keepalive_mock.go +++ b/client/util/mocks/keepalive_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: keepalive.go - +// +// Generated by this command: +// +// mockgen -destination mocks/keepalive_mock.go -source keepalive.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -8,7 +12,7 @@ import ( reflect "reflect" time "time" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockKeepAlive is a mock of KeepAlive interface. @@ -43,7 +47,7 @@ func (m *MockKeepAlive) Alive(alive time.Duration) bool { } // Alive indicates an expected call of Alive. -func (mr *MockKeepAliveMockRecorder) Alive(alive interface{}) *gomock.Call { +func (mr *MockKeepAliveMockRecorder) Alive(alive any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Alive", reflect.TypeOf((*MockKeepAlive)(nil).Alive), alive) } diff --git a/go.mod b/go.mod index ec5425af12d..3afb950cef6 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module d7y.io/dragonfly/v2 go 1.21 require ( - d7y.io/api/v2 v2.0.29 + d7y.io/api/v2 v2.0.34 github.com/MysteriousPotato/go-lockable v1.0.0 github.com/RichardKnop/machinery v1.10.6 github.com/Showmax/go-fqdn v1.0.0 @@ -33,7 +33,6 @@ require ( github.com/gocarina/gocsv v0.0.0-20221105105431-c8ef78125b99 github.com/gofrs/flock v0.8.1 github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da - github.com/golang/mock v1.6.0 github.com/gomodule/redigo v2.0.0+incompatible github.com/google/go-github v17.0.0+incompatible github.com/google/uuid v1.3.1 @@ -71,6 +70,7 @@ require ( go.opentelemetry.io/otel/sdk v1.19.0 go.opentelemetry.io/otel/trace v1.19.0 go.uber.org/atomic v1.11.0 + go.uber.org/mock v0.3.0 go.uber.org/zap v1.25.0 golang.org/x/crypto v0.14.0 golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d @@ -133,6 +133,7 @@ require ( github.com/golang-jwt/jwt/v4 v4.4.3 // indirect github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect github.com/golang-sql/sqlexp v0.1.0 // indirect + github.com/golang/mock v1.6.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/go-cmp v0.5.9 // indirect diff --git a/go.sum b/go.sum index 219e119eefe..11b668ce6a9 100644 --- a/go.sum +++ b/go.sum @@ -51,8 +51,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -d7y.io/api/v2 v2.0.29 h1:aXuK0Iqxe9YeCVuFGhaI1Xl0le4Bu3s32v6Czj3osYY= -d7y.io/api/v2 v2.0.29/go.mod h1:Wit7VpDkM+gP/eZf4DEJo+Mm+mT8fa/FpWQEeJWSTSk= +d7y.io/api/v2 v2.0.34 h1:rNFDs1VEHFZoejmU7wP+x6kWZUz6Fy9xlw+/ZObGnqA= +d7y.io/api/v2 v2.0.34/go.mod h1:yeVjEpNTQB4vEqnTxtdzLizDzsICcBzq3zTIyhQJF5E= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= @@ -1195,6 +1195,8 @@ go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= +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.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= diff --git a/internal/dynconfig/dynconfig_test.go b/internal/dynconfig/dynconfig_test.go index 7fe05ab05da..5b341aa31cc 100644 --- a/internal/dynconfig/dynconfig_test.go +++ b/internal/dynconfig/dynconfig_test.go @@ -23,9 +23,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/mitchellh/mapstructure" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "d7y.io/dragonfly/v2/internal/dynconfig/mocks" ) diff --git a/internal/dynconfig/mocks/dynconfig_mock.go b/internal/dynconfig/mocks/dynconfig_mock.go index bcff2f359c1..32814dd4802 100644 --- a/internal/dynconfig/mocks/dynconfig_mock.go +++ b/internal/dynconfig/mocks/dynconfig_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: dynconfig.go - +// +// Generated by this command: +// +// mockgen -destination mocks/dynconfig_mock.go -source dynconfig.go -package mocks +// // Package mocks is a generated GoMock package. package mocks import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockDynconfig is a mock of Dynconfig interface. diff --git a/internal/dynconfig/mocks/manager_client_mock.go b/internal/dynconfig/mocks/manager_client_mock.go index c2ccda378e3..5bff348c6d7 100644 --- a/internal/dynconfig/mocks/manager_client_mock.go +++ b/internal/dynconfig/mocks/manager_client_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: manager_client.go - +// +// Generated by this command: +// +// mockgen -destination mocks/manager_client_mock.go -source manager_client.go -package mocks +// // Package mocks is a generated GoMock package. package mocks import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockManagerClient is a mock of ManagerClient interface. diff --git a/manager/auth/oauth/mocks/oauth_mock.go b/manager/auth/oauth/mocks/oauth_mock.go index 3f046349b2d..25966f4ff04 100644 --- a/manager/auth/oauth/mocks/oauth_mock.go +++ b/manager/auth/oauth/mocks/oauth_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: oauth.go - +// +// Generated by this command: +// +// mockgen -destination mocks/oauth_mock.go -source oauth.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -8,7 +12,7 @@ import ( reflect "reflect" oauth "d7y.io/dragonfly/v2/manager/auth/oauth" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" oauth2 "golang.org/x/oauth2" ) @@ -60,7 +64,7 @@ func (m *MockOauth) Exchange(arg0 string) (*oauth2.Token, error) { } // Exchange indicates an expected call of Exchange. -func (mr *MockOauthMockRecorder) Exchange(arg0 interface{}) *gomock.Call { +func (mr *MockOauthMockRecorder) Exchange(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exchange", reflect.TypeOf((*MockOauth)(nil).Exchange), arg0) } @@ -75,7 +79,7 @@ func (m *MockOauth) GetUser(arg0 *oauth2.Token) (*oauth.User, error) { } // GetUser indicates an expected call of GetUser. -func (mr *MockOauthMockRecorder) GetUser(arg0 interface{}) *gomock.Call { +func (mr *MockOauthMockRecorder) GetUser(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUser", reflect.TypeOf((*MockOauth)(nil).GetUser), arg0) } diff --git a/manager/job/mocks/preheat_mock.go b/manager/job/mocks/preheat_mock.go index 3cae40bcb70..6a8f9e065ee 100644 --- a/manager/job/mocks/preheat_mock.go +++ b/manager/job/mocks/preheat_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: preheat.go - +// +// Generated by this command: +// +// mockgen -destination mocks/preheat_mock.go -source preheat.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -11,7 +15,7 @@ import ( job "d7y.io/dragonfly/v2/internal/job" models "d7y.io/dragonfly/v2/manager/models" types "d7y.io/dragonfly/v2/manager/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockPreheat is a mock of Preheat interface. @@ -47,7 +51,7 @@ func (m *MockPreheat) CreatePreheat(arg0 context.Context, arg1 []models.Schedule } // CreatePreheat indicates an expected call of CreatePreheat. -func (mr *MockPreheatMockRecorder) CreatePreheat(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockPreheatMockRecorder) CreatePreheat(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePreheat", reflect.TypeOf((*MockPreheat)(nil).CreatePreheat), arg0, arg1, arg2) } diff --git a/manager/job/mocks/sync_peers_mock.go b/manager/job/mocks/sync_peers_mock.go index 6b50e8c4615..0f665196c54 100644 --- a/manager/job/mocks/sync_peers_mock.go +++ b/manager/job/mocks/sync_peers_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: sync_peers.go - +// +// Generated by this command: +// +// mockgen -destination mocks/sync_peers_mock.go -source sync_peers.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockSyncPeers is a mock of SyncPeers interface. @@ -43,7 +47,7 @@ func (m *MockSyncPeers) Run(arg0 context.Context) error { } // Run indicates an expected call of Run. -func (mr *MockSyncPeersMockRecorder) Run(arg0 interface{}) *gomock.Call { +func (mr *MockSyncPeersMockRecorder) Run(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Run", reflect.TypeOf((*MockSyncPeers)(nil).Run), arg0) } diff --git a/manager/searcher/mocks/searcher_mock.go b/manager/searcher/mocks/searcher_mock.go index 6cdf3f3635e..2bd5948f9f2 100644 --- a/manager/searcher/mocks/searcher_mock.go +++ b/manager/searcher/mocks/searcher_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: searcher.go - +// +// Generated by this command: +// +// mockgen -destination mocks/searcher_mock.go -source searcher.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -9,7 +13,7 @@ import ( reflect "reflect" models "d7y.io/dragonfly/v2/manager/models" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" zap "go.uber.org/zap" ) @@ -46,7 +50,7 @@ func (m *MockSearcher) FindSchedulerClusters(ctx context.Context, schedulerClust } // FindSchedulerClusters indicates an expected call of FindSchedulerClusters. -func (mr *MockSearcherMockRecorder) FindSchedulerClusters(ctx, schedulerClusters, ip, hostname, conditions, log interface{}) *gomock.Call { +func (mr *MockSearcherMockRecorder) FindSchedulerClusters(ctx, schedulerClusters, ip, hostname, conditions, log any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindSchedulerClusters", reflect.TypeOf((*MockSearcher)(nil).FindSchedulerClusters), ctx, schedulerClusters, ip, hostname, conditions, log) } diff --git a/manager/service/mocks/service_mock.go b/manager/service/mocks/service_mock.go index 244a9953344..c4a39ac4246 100644 --- a/manager/service/mocks/service_mock.go +++ b/manager/service/mocks/service_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: service.go - +// +// Generated by this command: +// +// mockgen -destination mocks/service_mock.go -source service.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -13,7 +17,7 @@ import ( types "d7y.io/dragonfly/v2/manager/types" objectstorage "d7y.io/dragonfly/v2/pkg/objectstorage" gin "github.com/gin-gonic/gin" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockService is a mock of Service interface. @@ -49,7 +53,7 @@ func (m *MockService) AddPermissionForRole(arg0 context.Context, arg1 string, ar } // AddPermissionForRole indicates an expected call of AddPermissionForRole. -func (mr *MockServiceMockRecorder) AddPermissionForRole(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) AddPermissionForRole(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddPermissionForRole", reflect.TypeOf((*MockService)(nil).AddPermissionForRole), arg0, arg1, arg2) } @@ -64,7 +68,7 @@ func (m *MockService) AddRoleForUser(arg0 context.Context, arg1 types.AddRoleFor } // AddRoleForUser indicates an expected call of AddRoleForUser. -func (mr *MockServiceMockRecorder) AddRoleForUser(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) AddRoleForUser(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddRoleForUser", reflect.TypeOf((*MockService)(nil).AddRoleForUser), arg0, arg1) } @@ -78,7 +82,7 @@ func (m *MockService) AddSchedulerClusterToSeedPeerCluster(arg0 context.Context, } // AddSchedulerClusterToSeedPeerCluster indicates an expected call of AddSchedulerClusterToSeedPeerCluster. -func (mr *MockServiceMockRecorder) AddSchedulerClusterToSeedPeerCluster(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) AddSchedulerClusterToSeedPeerCluster(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSchedulerClusterToSeedPeerCluster", reflect.TypeOf((*MockService)(nil).AddSchedulerClusterToSeedPeerCluster), arg0, arg1, arg2) } @@ -92,7 +96,7 @@ func (m *MockService) AddSchedulerToSchedulerCluster(arg0 context.Context, arg1, } // AddSchedulerToSchedulerCluster indicates an expected call of AddSchedulerToSchedulerCluster. -func (mr *MockServiceMockRecorder) AddSchedulerToSchedulerCluster(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) AddSchedulerToSchedulerCluster(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSchedulerToSchedulerCluster", reflect.TypeOf((*MockService)(nil).AddSchedulerToSchedulerCluster), arg0, arg1, arg2) } @@ -106,7 +110,7 @@ func (m *MockService) AddSeedPeerToSeedPeerCluster(arg0 context.Context, arg1, a } // AddSeedPeerToSeedPeerCluster indicates an expected call of AddSeedPeerToSeedPeerCluster. -func (mr *MockServiceMockRecorder) AddSeedPeerToSeedPeerCluster(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) AddSeedPeerToSeedPeerCluster(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSeedPeerToSeedPeerCluster", reflect.TypeOf((*MockService)(nil).AddSeedPeerToSeedPeerCluster), arg0, arg1, arg2) } @@ -121,7 +125,7 @@ func (m *MockService) CreateApplication(arg0 context.Context, arg1 types.CreateA } // CreateApplication indicates an expected call of CreateApplication. -func (mr *MockServiceMockRecorder) CreateApplication(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) CreateApplication(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateApplication", reflect.TypeOf((*MockService)(nil).CreateApplication), arg0, arg1) } @@ -135,7 +139,7 @@ func (m *MockService) CreateBucket(arg0 context.Context, arg1 types.CreateBucket } // CreateBucket indicates an expected call of CreateBucket. -func (mr *MockServiceMockRecorder) CreateBucket(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) CreateBucket(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBucket", reflect.TypeOf((*MockService)(nil).CreateBucket), arg0, arg1) } @@ -150,7 +154,7 @@ func (m *MockService) CreateCluster(arg0 context.Context, arg1 types.CreateClust } // CreateCluster indicates an expected call of CreateCluster. -func (mr *MockServiceMockRecorder) CreateCluster(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) CreateCluster(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateCluster", reflect.TypeOf((*MockService)(nil).CreateCluster), arg0, arg1) } @@ -165,7 +169,7 @@ func (m *MockService) CreateConfig(arg0 context.Context, arg1 types.CreateConfig } // CreateConfig indicates an expected call of CreateConfig. -func (mr *MockServiceMockRecorder) CreateConfig(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) CreateConfig(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateConfig", reflect.TypeOf((*MockService)(nil).CreateConfig), arg0, arg1) } @@ -180,11 +184,26 @@ func (m *MockService) CreateOauth(arg0 context.Context, arg1 types.CreateOauthRe } // CreateOauth indicates an expected call of CreateOauth. -func (mr *MockServiceMockRecorder) CreateOauth(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) CreateOauth(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOauth", reflect.TypeOf((*MockService)(nil).CreateOauth), arg0, arg1) } +// CreatePeer mocks base method. +func (m *MockService) CreatePeer(arg0 context.Context, arg1 types.CreatePeerRequest) (*models.Peer, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreatePeer", arg0, arg1) + ret0, _ := ret[0].(*models.Peer) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreatePeer indicates an expected call of CreatePeer. +func (mr *MockServiceMockRecorder) CreatePeer(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePeer", reflect.TypeOf((*MockService)(nil).CreatePeer), arg0, arg1) +} + // CreatePersonalAccessToken mocks base method. func (m *MockService) CreatePersonalAccessToken(arg0 context.Context, arg1 types.CreatePersonalAccessTokenRequest) (*models.PersonalAccessToken, error) { m.ctrl.T.Helper() @@ -195,7 +214,7 @@ func (m *MockService) CreatePersonalAccessToken(arg0 context.Context, arg1 types } // CreatePersonalAccessToken indicates an expected call of CreatePersonalAccessToken. -func (mr *MockServiceMockRecorder) CreatePersonalAccessToken(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) CreatePersonalAccessToken(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePersonalAccessToken", reflect.TypeOf((*MockService)(nil).CreatePersonalAccessToken), arg0, arg1) } @@ -210,7 +229,7 @@ func (m *MockService) CreatePreheatJob(arg0 context.Context, arg1 types.CreatePr } // CreatePreheatJob indicates an expected call of CreatePreheatJob. -func (mr *MockServiceMockRecorder) CreatePreheatJob(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) CreatePreheatJob(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePreheatJob", reflect.TypeOf((*MockService)(nil).CreatePreheatJob), arg0, arg1) } @@ -224,7 +243,7 @@ func (m *MockService) CreateRole(arg0 context.Context, arg1 types.CreateRoleRequ } // CreateRole indicates an expected call of CreateRole. -func (mr *MockServiceMockRecorder) CreateRole(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) CreateRole(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRole", reflect.TypeOf((*MockService)(nil).CreateRole), arg0, arg1) } @@ -239,7 +258,7 @@ func (m *MockService) CreateScheduler(arg0 context.Context, arg1 types.CreateSch } // CreateScheduler indicates an expected call of CreateScheduler. -func (mr *MockServiceMockRecorder) CreateScheduler(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) CreateScheduler(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateScheduler", reflect.TypeOf((*MockService)(nil).CreateScheduler), arg0, arg1) } @@ -254,7 +273,7 @@ func (m *MockService) CreateSchedulerCluster(arg0 context.Context, arg1 types.Cr } // CreateSchedulerCluster indicates an expected call of CreateSchedulerCluster. -func (mr *MockServiceMockRecorder) CreateSchedulerCluster(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) CreateSchedulerCluster(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSchedulerCluster", reflect.TypeOf((*MockService)(nil).CreateSchedulerCluster), arg0, arg1) } @@ -269,7 +288,7 @@ func (m *MockService) CreateSeedPeer(arg0 context.Context, arg1 types.CreateSeed } // CreateSeedPeer indicates an expected call of CreateSeedPeer. -func (mr *MockServiceMockRecorder) CreateSeedPeer(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) CreateSeedPeer(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSeedPeer", reflect.TypeOf((*MockService)(nil).CreateSeedPeer), arg0, arg1) } @@ -284,7 +303,7 @@ func (m *MockService) CreateSeedPeerCluster(arg0 context.Context, arg1 types.Cre } // CreateSeedPeerCluster indicates an expected call of CreateSeedPeerCluster. -func (mr *MockServiceMockRecorder) CreateSeedPeerCluster(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) CreateSeedPeerCluster(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSeedPeerCluster", reflect.TypeOf((*MockService)(nil).CreateSeedPeerCluster), arg0, arg1) } @@ -299,7 +318,7 @@ func (m *MockService) CreateV1Preheat(arg0 context.Context, arg1 types.CreateV1P } // CreateV1Preheat indicates an expected call of CreateV1Preheat. -func (mr *MockServiceMockRecorder) CreateV1Preheat(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) CreateV1Preheat(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateV1Preheat", reflect.TypeOf((*MockService)(nil).CreateV1Preheat), arg0, arg1) } @@ -314,7 +333,7 @@ func (m *MockService) DeletePermissionForRole(arg0 context.Context, arg1 string, } // DeletePermissionForRole indicates an expected call of DeletePermissionForRole. -func (mr *MockServiceMockRecorder) DeletePermissionForRole(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) DeletePermissionForRole(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePermissionForRole", reflect.TypeOf((*MockService)(nil).DeletePermissionForRole), arg0, arg1, arg2) } @@ -329,7 +348,7 @@ func (m *MockService) DeleteRoleForUser(arg0 context.Context, arg1 types.DeleteR } // DeleteRoleForUser indicates an expected call of DeleteRoleForUser. -func (mr *MockServiceMockRecorder) DeleteRoleForUser(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) DeleteRoleForUser(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRoleForUser", reflect.TypeOf((*MockService)(nil).DeleteRoleForUser), arg0, arg1) } @@ -343,7 +362,7 @@ func (m *MockService) DestroyApplication(arg0 context.Context, arg1 uint) error } // DestroyApplication indicates an expected call of DestroyApplication. -func (mr *MockServiceMockRecorder) DestroyApplication(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) DestroyApplication(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DestroyApplication", reflect.TypeOf((*MockService)(nil).DestroyApplication), arg0, arg1) } @@ -357,7 +376,7 @@ func (m *MockService) DestroyBucket(arg0 context.Context, arg1 string) error { } // DestroyBucket indicates an expected call of DestroyBucket. -func (mr *MockServiceMockRecorder) DestroyBucket(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) DestroyBucket(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DestroyBucket", reflect.TypeOf((*MockService)(nil).DestroyBucket), arg0, arg1) } @@ -371,7 +390,7 @@ func (m *MockService) DestroyCluster(arg0 context.Context, arg1 uint) error { } // DestroyCluster indicates an expected call of DestroyCluster. -func (mr *MockServiceMockRecorder) DestroyCluster(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) DestroyCluster(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DestroyCluster", reflect.TypeOf((*MockService)(nil).DestroyCluster), arg0, arg1) } @@ -385,7 +404,7 @@ func (m *MockService) DestroyConfig(arg0 context.Context, arg1 uint) error { } // DestroyConfig indicates an expected call of DestroyConfig. -func (mr *MockServiceMockRecorder) DestroyConfig(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) DestroyConfig(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DestroyConfig", reflect.TypeOf((*MockService)(nil).DestroyConfig), arg0, arg1) } @@ -399,7 +418,7 @@ func (m *MockService) DestroyJob(arg0 context.Context, arg1 uint) error { } // DestroyJob indicates an expected call of DestroyJob. -func (mr *MockServiceMockRecorder) DestroyJob(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) DestroyJob(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DestroyJob", reflect.TypeOf((*MockService)(nil).DestroyJob), arg0, arg1) } @@ -413,7 +432,7 @@ func (m *MockService) DestroyModel(arg0 context.Context, arg1 uint) error { } // DestroyModel indicates an expected call of DestroyModel. -func (mr *MockServiceMockRecorder) DestroyModel(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) DestroyModel(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DestroyModel", reflect.TypeOf((*MockService)(nil).DestroyModel), arg0, arg1) } @@ -427,7 +446,7 @@ func (m *MockService) DestroyOauth(arg0 context.Context, arg1 uint) error { } // DestroyOauth indicates an expected call of DestroyOauth. -func (mr *MockServiceMockRecorder) DestroyOauth(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) DestroyOauth(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DestroyOauth", reflect.TypeOf((*MockService)(nil).DestroyOauth), arg0, arg1) } @@ -441,7 +460,7 @@ func (m *MockService) DestroyPeer(arg0 context.Context, arg1 uint) error { } // DestroyPeer indicates an expected call of DestroyPeer. -func (mr *MockServiceMockRecorder) DestroyPeer(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) DestroyPeer(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DestroyPeer", reflect.TypeOf((*MockService)(nil).DestroyPeer), arg0, arg1) } @@ -455,7 +474,7 @@ func (m *MockService) DestroyPersonalAccessToken(arg0 context.Context, arg1 uint } // DestroyPersonalAccessToken indicates an expected call of DestroyPersonalAccessToken. -func (mr *MockServiceMockRecorder) DestroyPersonalAccessToken(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) DestroyPersonalAccessToken(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DestroyPersonalAccessToken", reflect.TypeOf((*MockService)(nil).DestroyPersonalAccessToken), arg0, arg1) } @@ -470,7 +489,7 @@ func (m *MockService) DestroyRole(arg0 context.Context, arg1 string) (bool, erro } // DestroyRole indicates an expected call of DestroyRole. -func (mr *MockServiceMockRecorder) DestroyRole(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) DestroyRole(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DestroyRole", reflect.TypeOf((*MockService)(nil).DestroyRole), arg0, arg1) } @@ -484,7 +503,7 @@ func (m *MockService) DestroyScheduler(arg0 context.Context, arg1 uint) error { } // DestroyScheduler indicates an expected call of DestroyScheduler. -func (mr *MockServiceMockRecorder) DestroyScheduler(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) DestroyScheduler(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DestroyScheduler", reflect.TypeOf((*MockService)(nil).DestroyScheduler), arg0, arg1) } @@ -498,7 +517,7 @@ func (m *MockService) DestroySchedulerCluster(arg0 context.Context, arg1 uint) e } // DestroySchedulerCluster indicates an expected call of DestroySchedulerCluster. -func (mr *MockServiceMockRecorder) DestroySchedulerCluster(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) DestroySchedulerCluster(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DestroySchedulerCluster", reflect.TypeOf((*MockService)(nil).DestroySchedulerCluster), arg0, arg1) } @@ -512,7 +531,7 @@ func (m *MockService) DestroySeedPeer(arg0 context.Context, arg1 uint) error { } // DestroySeedPeer indicates an expected call of DestroySeedPeer. -func (mr *MockServiceMockRecorder) DestroySeedPeer(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) DestroySeedPeer(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DestroySeedPeer", reflect.TypeOf((*MockService)(nil).DestroySeedPeer), arg0, arg1) } @@ -526,7 +545,7 @@ func (m *MockService) DestroySeedPeerCluster(arg0 context.Context, arg1 uint) er } // DestroySeedPeerCluster indicates an expected call of DestroySeedPeerCluster. -func (mr *MockServiceMockRecorder) DestroySeedPeerCluster(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) DestroySeedPeerCluster(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DestroySeedPeerCluster", reflect.TypeOf((*MockService)(nil).DestroySeedPeerCluster), arg0, arg1) } @@ -541,7 +560,7 @@ func (m *MockService) GetApplication(arg0 context.Context, arg1 uint) (*models.A } // GetApplication indicates an expected call of GetApplication. -func (mr *MockServiceMockRecorder) GetApplication(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetApplication(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetApplication", reflect.TypeOf((*MockService)(nil).GetApplication), arg0, arg1) } @@ -557,7 +576,7 @@ func (m *MockService) GetApplications(arg0 context.Context, arg1 types.GetApplic } // GetApplications indicates an expected call of GetApplications. -func (mr *MockServiceMockRecorder) GetApplications(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetApplications(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetApplications", reflect.TypeOf((*MockService)(nil).GetApplications), arg0, arg1) } @@ -572,7 +591,7 @@ func (m *MockService) GetBucket(arg0 context.Context, arg1 string) (*objectstora } // GetBucket indicates an expected call of GetBucket. -func (mr *MockServiceMockRecorder) GetBucket(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetBucket(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBucket", reflect.TypeOf((*MockService)(nil).GetBucket), arg0, arg1) } @@ -587,7 +606,7 @@ func (m *MockService) GetBuckets(arg0 context.Context) ([]*objectstorage.BucketM } // GetBuckets indicates an expected call of GetBuckets. -func (mr *MockServiceMockRecorder) GetBuckets(arg0 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetBuckets(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBuckets", reflect.TypeOf((*MockService)(nil).GetBuckets), arg0) } @@ -602,7 +621,7 @@ func (m *MockService) GetCluster(arg0 context.Context, arg1 uint) (*types.GetClu } // GetCluster indicates an expected call of GetCluster. -func (mr *MockServiceMockRecorder) GetCluster(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetCluster(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCluster", reflect.TypeOf((*MockService)(nil).GetCluster), arg0, arg1) } @@ -618,7 +637,7 @@ func (m *MockService) GetClusters(arg0 context.Context, arg1 types.GetClustersQu } // GetClusters indicates an expected call of GetClusters. -func (mr *MockServiceMockRecorder) GetClusters(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetClusters(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClusters", reflect.TypeOf((*MockService)(nil).GetClusters), arg0, arg1) } @@ -633,7 +652,7 @@ func (m *MockService) GetConfig(arg0 context.Context, arg1 uint) (*models.Config } // GetConfig indicates an expected call of GetConfig. -func (mr *MockServiceMockRecorder) GetConfig(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetConfig(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConfig", reflect.TypeOf((*MockService)(nil).GetConfig), arg0, arg1) } @@ -649,7 +668,7 @@ func (m *MockService) GetConfigs(arg0 context.Context, arg1 types.GetConfigsQuer } // GetConfigs indicates an expected call of GetConfigs. -func (mr *MockServiceMockRecorder) GetConfigs(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetConfigs(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConfigs", reflect.TypeOf((*MockService)(nil).GetConfigs), arg0, arg1) } @@ -664,7 +683,7 @@ func (m *MockService) GetJob(arg0 context.Context, arg1 uint) (*models.Job, erro } // GetJob indicates an expected call of GetJob. -func (mr *MockServiceMockRecorder) GetJob(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetJob(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetJob", reflect.TypeOf((*MockService)(nil).GetJob), arg0, arg1) } @@ -680,7 +699,7 @@ func (m *MockService) GetJobs(arg0 context.Context, arg1 types.GetJobsQuery) ([] } // GetJobs indicates an expected call of GetJobs. -func (mr *MockServiceMockRecorder) GetJobs(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetJobs(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetJobs", reflect.TypeOf((*MockService)(nil).GetJobs), arg0, arg1) } @@ -695,7 +714,7 @@ func (m *MockService) GetModel(arg0 context.Context, arg1 uint) (*models.Model, } // GetModel indicates an expected call of GetModel. -func (mr *MockServiceMockRecorder) GetModel(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetModel(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModel", reflect.TypeOf((*MockService)(nil).GetModel), arg0, arg1) } @@ -711,7 +730,7 @@ func (m *MockService) GetModels(arg0 context.Context, arg1 types.GetModelsQuery) } // GetModels indicates an expected call of GetModels. -func (mr *MockServiceMockRecorder) GetModels(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetModels(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModels", reflect.TypeOf((*MockService)(nil).GetModels), arg0, arg1) } @@ -726,7 +745,7 @@ func (m *MockService) GetOauth(arg0 context.Context, arg1 uint) (*models.Oauth, } // GetOauth indicates an expected call of GetOauth. -func (mr *MockServiceMockRecorder) GetOauth(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetOauth(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOauth", reflect.TypeOf((*MockService)(nil).GetOauth), arg0, arg1) } @@ -742,7 +761,7 @@ func (m *MockService) GetOauths(arg0 context.Context, arg1 types.GetOauthsQuery) } // GetOauths indicates an expected call of GetOauths. -func (mr *MockServiceMockRecorder) GetOauths(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetOauths(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOauths", reflect.TypeOf((*MockService)(nil).GetOauths), arg0, arg1) } @@ -757,7 +776,7 @@ func (m *MockService) GetPeer(arg0 context.Context, arg1 uint) (*models.Peer, er } // GetPeer indicates an expected call of GetPeer. -func (mr *MockServiceMockRecorder) GetPeer(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetPeer(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPeer", reflect.TypeOf((*MockService)(nil).GetPeer), arg0, arg1) } @@ -773,7 +792,7 @@ func (m *MockService) GetPeers(arg0 context.Context, arg1 types.GetPeersQuery) ( } // GetPeers indicates an expected call of GetPeers. -func (mr *MockServiceMockRecorder) GetPeers(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetPeers(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPeers", reflect.TypeOf((*MockService)(nil).GetPeers), arg0, arg1) } @@ -787,7 +806,7 @@ func (m *MockService) GetPermissions(arg0 context.Context, arg1 *gin.Engine) []r } // GetPermissions indicates an expected call of GetPermissions. -func (mr *MockServiceMockRecorder) GetPermissions(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetPermissions(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPermissions", reflect.TypeOf((*MockService)(nil).GetPermissions), arg0, arg1) } @@ -802,7 +821,7 @@ func (m *MockService) GetPersonalAccessToken(arg0 context.Context, arg1 uint) (* } // GetPersonalAccessToken indicates an expected call of GetPersonalAccessToken. -func (mr *MockServiceMockRecorder) GetPersonalAccessToken(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetPersonalAccessToken(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPersonalAccessToken", reflect.TypeOf((*MockService)(nil).GetPersonalAccessToken), arg0, arg1) } @@ -818,7 +837,7 @@ func (m *MockService) GetPersonalAccessTokens(arg0 context.Context, arg1 types.G } // GetPersonalAccessTokens indicates an expected call of GetPersonalAccessTokens. -func (mr *MockServiceMockRecorder) GetPersonalAccessTokens(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetPersonalAccessTokens(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPersonalAccessTokens", reflect.TypeOf((*MockService)(nil).GetPersonalAccessTokens), arg0, arg1) } @@ -832,7 +851,7 @@ func (m *MockService) GetRole(arg0 context.Context, arg1 string) [][]string { } // GetRole indicates an expected call of GetRole. -func (mr *MockServiceMockRecorder) GetRole(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetRole(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRole", reflect.TypeOf((*MockService)(nil).GetRole), arg0, arg1) } @@ -846,7 +865,7 @@ func (m *MockService) GetRoles(arg0 context.Context) []string { } // GetRoles indicates an expected call of GetRoles. -func (mr *MockServiceMockRecorder) GetRoles(arg0 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetRoles(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRoles", reflect.TypeOf((*MockService)(nil).GetRoles), arg0) } @@ -861,7 +880,7 @@ func (m *MockService) GetRolesForUser(arg0 context.Context, arg1 uint) ([]string } // GetRolesForUser indicates an expected call of GetRolesForUser. -func (mr *MockServiceMockRecorder) GetRolesForUser(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetRolesForUser(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRolesForUser", reflect.TypeOf((*MockService)(nil).GetRolesForUser), arg0, arg1) } @@ -876,7 +895,7 @@ func (m *MockService) GetScheduler(arg0 context.Context, arg1 uint) (*models.Sch } // GetScheduler indicates an expected call of GetScheduler. -func (mr *MockServiceMockRecorder) GetScheduler(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetScheduler(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetScheduler", reflect.TypeOf((*MockService)(nil).GetScheduler), arg0, arg1) } @@ -891,7 +910,7 @@ func (m *MockService) GetSchedulerCluster(arg0 context.Context, arg1 uint) (*mod } // GetSchedulerCluster indicates an expected call of GetSchedulerCluster. -func (mr *MockServiceMockRecorder) GetSchedulerCluster(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetSchedulerCluster(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSchedulerCluster", reflect.TypeOf((*MockService)(nil).GetSchedulerCluster), arg0, arg1) } @@ -907,7 +926,7 @@ func (m *MockService) GetSchedulerClusters(arg0 context.Context, arg1 types.GetS } // GetSchedulerClusters indicates an expected call of GetSchedulerClusters. -func (mr *MockServiceMockRecorder) GetSchedulerClusters(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetSchedulerClusters(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSchedulerClusters", reflect.TypeOf((*MockService)(nil).GetSchedulerClusters), arg0, arg1) } @@ -923,7 +942,7 @@ func (m *MockService) GetSchedulers(arg0 context.Context, arg1 types.GetSchedule } // GetSchedulers indicates an expected call of GetSchedulers. -func (mr *MockServiceMockRecorder) GetSchedulers(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetSchedulers(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSchedulers", reflect.TypeOf((*MockService)(nil).GetSchedulers), arg0, arg1) } @@ -938,7 +957,7 @@ func (m *MockService) GetSeedPeer(arg0 context.Context, arg1 uint) (*models.Seed } // GetSeedPeer indicates an expected call of GetSeedPeer. -func (mr *MockServiceMockRecorder) GetSeedPeer(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetSeedPeer(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSeedPeer", reflect.TypeOf((*MockService)(nil).GetSeedPeer), arg0, arg1) } @@ -953,7 +972,7 @@ func (m *MockService) GetSeedPeerCluster(arg0 context.Context, arg1 uint) (*mode } // GetSeedPeerCluster indicates an expected call of GetSeedPeerCluster. -func (mr *MockServiceMockRecorder) GetSeedPeerCluster(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetSeedPeerCluster(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSeedPeerCluster", reflect.TypeOf((*MockService)(nil).GetSeedPeerCluster), arg0, arg1) } @@ -969,7 +988,7 @@ func (m *MockService) GetSeedPeerClusters(arg0 context.Context, arg1 types.GetSe } // GetSeedPeerClusters indicates an expected call of GetSeedPeerClusters. -func (mr *MockServiceMockRecorder) GetSeedPeerClusters(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetSeedPeerClusters(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSeedPeerClusters", reflect.TypeOf((*MockService)(nil).GetSeedPeerClusters), arg0, arg1) } @@ -985,7 +1004,7 @@ func (m *MockService) GetSeedPeers(arg0 context.Context, arg1 types.GetSeedPeers } // GetSeedPeers indicates an expected call of GetSeedPeers. -func (mr *MockServiceMockRecorder) GetSeedPeers(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetSeedPeers(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSeedPeers", reflect.TypeOf((*MockService)(nil).GetSeedPeers), arg0, arg1) } @@ -1000,7 +1019,7 @@ func (m *MockService) GetUser(arg0 context.Context, arg1 uint) (*models.User, er } // GetUser indicates an expected call of GetUser. -func (mr *MockServiceMockRecorder) GetUser(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetUser(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUser", reflect.TypeOf((*MockService)(nil).GetUser), arg0, arg1) } @@ -1016,7 +1035,7 @@ func (m *MockService) GetUsers(arg0 context.Context, arg1 types.GetUsersQuery) ( } // GetUsers indicates an expected call of GetUsers. -func (mr *MockServiceMockRecorder) GetUsers(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetUsers(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUsers", reflect.TypeOf((*MockService)(nil).GetUsers), arg0, arg1) } @@ -1031,7 +1050,7 @@ func (m *MockService) GetV1Preheat(arg0 context.Context, arg1 string) (*types.Ge } // GetV1Preheat indicates an expected call of GetV1Preheat. -func (mr *MockServiceMockRecorder) GetV1Preheat(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) GetV1Preheat(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetV1Preheat", reflect.TypeOf((*MockService)(nil).GetV1Preheat), arg0, arg1) } @@ -1046,7 +1065,7 @@ func (m *MockService) OauthSignin(arg0 context.Context, arg1 string) (string, er } // OauthSignin indicates an expected call of OauthSignin. -func (mr *MockServiceMockRecorder) OauthSignin(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) OauthSignin(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OauthSignin", reflect.TypeOf((*MockService)(nil).OauthSignin), arg0, arg1) } @@ -1061,7 +1080,7 @@ func (m *MockService) OauthSigninCallback(arg0 context.Context, arg1, arg2 strin } // OauthSigninCallback indicates an expected call of OauthSigninCallback. -func (mr *MockServiceMockRecorder) OauthSigninCallback(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) OauthSigninCallback(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OauthSigninCallback", reflect.TypeOf((*MockService)(nil).OauthSigninCallback), arg0, arg1, arg2) } @@ -1075,7 +1094,7 @@ func (m *MockService) ResetPassword(arg0 context.Context, arg1 uint, arg2 types. } // ResetPassword indicates an expected call of ResetPassword. -func (mr *MockServiceMockRecorder) ResetPassword(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) ResetPassword(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResetPassword", reflect.TypeOf((*MockService)(nil).ResetPassword), arg0, arg1, arg2) } @@ -1090,7 +1109,7 @@ func (m *MockService) SignIn(arg0 context.Context, arg1 types.SignInRequest) (*m } // SignIn indicates an expected call of SignIn. -func (mr *MockServiceMockRecorder) SignIn(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) SignIn(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SignIn", reflect.TypeOf((*MockService)(nil).SignIn), arg0, arg1) } @@ -1105,7 +1124,7 @@ func (m *MockService) SignUp(arg0 context.Context, arg1 types.SignUpRequest) (*m } // SignUp indicates an expected call of SignUp. -func (mr *MockServiceMockRecorder) SignUp(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) SignUp(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SignUp", reflect.TypeOf((*MockService)(nil).SignUp), arg0, arg1) } @@ -1120,7 +1139,7 @@ func (m *MockService) UpdateApplication(arg0 context.Context, arg1 uint, arg2 ty } // UpdateApplication indicates an expected call of UpdateApplication. -func (mr *MockServiceMockRecorder) UpdateApplication(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) UpdateApplication(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateApplication", reflect.TypeOf((*MockService)(nil).UpdateApplication), arg0, arg1, arg2) } @@ -1135,7 +1154,7 @@ func (m *MockService) UpdateCluster(arg0 context.Context, arg1 uint, arg2 types. } // UpdateCluster indicates an expected call of UpdateCluster. -func (mr *MockServiceMockRecorder) UpdateCluster(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) UpdateCluster(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateCluster", reflect.TypeOf((*MockService)(nil).UpdateCluster), arg0, arg1, arg2) } @@ -1150,7 +1169,7 @@ func (m *MockService) UpdateConfig(arg0 context.Context, arg1 uint, arg2 types.U } // UpdateConfig indicates an expected call of UpdateConfig. -func (mr *MockServiceMockRecorder) UpdateConfig(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) UpdateConfig(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateConfig", reflect.TypeOf((*MockService)(nil).UpdateConfig), arg0, arg1, arg2) } @@ -1165,7 +1184,7 @@ func (m *MockService) UpdateJob(arg0 context.Context, arg1 uint, arg2 types.Upda } // UpdateJob indicates an expected call of UpdateJob. -func (mr *MockServiceMockRecorder) UpdateJob(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) UpdateJob(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateJob", reflect.TypeOf((*MockService)(nil).UpdateJob), arg0, arg1, arg2) } @@ -1180,7 +1199,7 @@ func (m *MockService) UpdateModel(arg0 context.Context, arg1 uint, arg2 types.Up } // UpdateModel indicates an expected call of UpdateModel. -func (mr *MockServiceMockRecorder) UpdateModel(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) UpdateModel(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateModel", reflect.TypeOf((*MockService)(nil).UpdateModel), arg0, arg1, arg2) } @@ -1195,7 +1214,7 @@ func (m *MockService) UpdateOauth(arg0 context.Context, arg1 uint, arg2 types.Up } // UpdateOauth indicates an expected call of UpdateOauth. -func (mr *MockServiceMockRecorder) UpdateOauth(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) UpdateOauth(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateOauth", reflect.TypeOf((*MockService)(nil).UpdateOauth), arg0, arg1, arg2) } @@ -1210,7 +1229,7 @@ func (m *MockService) UpdatePersonalAccessToken(arg0 context.Context, arg1 uint, } // UpdatePersonalAccessToken indicates an expected call of UpdatePersonalAccessToken. -func (mr *MockServiceMockRecorder) UpdatePersonalAccessToken(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) UpdatePersonalAccessToken(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePersonalAccessToken", reflect.TypeOf((*MockService)(nil).UpdatePersonalAccessToken), arg0, arg1, arg2) } @@ -1225,7 +1244,7 @@ func (m *MockService) UpdateScheduler(arg0 context.Context, arg1 uint, arg2 type } // UpdateScheduler indicates an expected call of UpdateScheduler. -func (mr *MockServiceMockRecorder) UpdateScheduler(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) UpdateScheduler(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateScheduler", reflect.TypeOf((*MockService)(nil).UpdateScheduler), arg0, arg1, arg2) } @@ -1240,7 +1259,7 @@ func (m *MockService) UpdateSchedulerCluster(arg0 context.Context, arg1 uint, ar } // UpdateSchedulerCluster indicates an expected call of UpdateSchedulerCluster. -func (mr *MockServiceMockRecorder) UpdateSchedulerCluster(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) UpdateSchedulerCluster(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSchedulerCluster", reflect.TypeOf((*MockService)(nil).UpdateSchedulerCluster), arg0, arg1, arg2) } @@ -1255,7 +1274,7 @@ func (m *MockService) UpdateSeedPeer(arg0 context.Context, arg1 uint, arg2 types } // UpdateSeedPeer indicates an expected call of UpdateSeedPeer. -func (mr *MockServiceMockRecorder) UpdateSeedPeer(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) UpdateSeedPeer(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSeedPeer", reflect.TypeOf((*MockService)(nil).UpdateSeedPeer), arg0, arg1, arg2) } @@ -1270,7 +1289,7 @@ func (m *MockService) UpdateSeedPeerCluster(arg0 context.Context, arg1 uint, arg } // UpdateSeedPeerCluster indicates an expected call of UpdateSeedPeerCluster. -func (mr *MockServiceMockRecorder) UpdateSeedPeerCluster(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) UpdateSeedPeerCluster(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSeedPeerCluster", reflect.TypeOf((*MockService)(nil).UpdateSeedPeerCluster), arg0, arg1, arg2) } @@ -1285,7 +1304,7 @@ func (m *MockService) UpdateUser(arg0 context.Context, arg1 uint, arg2 types.Upd } // UpdateUser indicates an expected call of UpdateUser. -func (mr *MockServiceMockRecorder) UpdateUser(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServiceMockRecorder) UpdateUser(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateUser", reflect.TypeOf((*MockService)(nil).UpdateUser), arg0, arg1, arg2) } diff --git a/pkg/container/set/mocks/safe_set_mock.go b/pkg/container/set/mocks/safe_set_mock.go index a5582db0bc6..33d1e716969 100644 --- a/pkg/container/set/mocks/safe_set_mock.go +++ b/pkg/container/set/mocks/safe_set_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: safe_set.go - +// +// Generated by this command: +// +// mockgen -destination mocks/safe_set_mock.go -source safe_set.go -package mocks +// // Package mocks is a generated GoMock package. package mocks import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockSafeSet is a mock of SafeSet interface. @@ -42,7 +46,7 @@ func (m *MockSafeSet[T]) Add(arg0 T) bool { } // Add indicates an expected call of Add. -func (mr *MockSafeSetMockRecorder[T]) Add(arg0 interface{}) *gomock.Call { +func (mr *MockSafeSetMockRecorder[T]) Add(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockSafeSet[T])(nil).Add), arg0) } @@ -62,7 +66,7 @@ func (mr *MockSafeSetMockRecorder[T]) Clear() *gomock.Call { // Contains mocks base method. func (m *MockSafeSet[T]) Contains(arg0 ...T) bool { m.ctrl.T.Helper() - varargs := []interface{}{} + varargs := []any{} for _, a := range arg0 { varargs = append(varargs, a) } @@ -72,7 +76,7 @@ func (m *MockSafeSet[T]) Contains(arg0 ...T) bool { } // Contains indicates an expected call of Contains. -func (mr *MockSafeSetMockRecorder[T]) Contains(arg0 ...interface{}) *gomock.Call { +func (mr *MockSafeSetMockRecorder[T]) Contains(arg0 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Contains", reflect.TypeOf((*MockSafeSet[T])(nil).Contains), arg0...) } @@ -84,7 +88,7 @@ func (m *MockSafeSet[T]) Delete(arg0 T) { } // Delete indicates an expected call of Delete. -func (mr *MockSafeSetMockRecorder[T]) Delete(arg0 interface{}) *gomock.Call { +func (mr *MockSafeSetMockRecorder[T]) Delete(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockSafeSet[T])(nil).Delete), arg0) } diff --git a/pkg/container/set/mocks/set_mock.go b/pkg/container/set/mocks/set_mock.go index 803d07d7f08..e1b8bfd7ec5 100644 --- a/pkg/container/set/mocks/set_mock.go +++ b/pkg/container/set/mocks/set_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: set.go - +// +// Generated by this command: +// +// mockgen -destination mocks/set_mock.go -source set.go -package mocks +// // Package mocks is a generated GoMock package. package mocks import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockSet is a mock of Set interface. @@ -42,7 +46,7 @@ func (m *MockSet[T]) Add(arg0 T) bool { } // Add indicates an expected call of Add. -func (mr *MockSetMockRecorder[T]) Add(arg0 interface{}) *gomock.Call { +func (mr *MockSetMockRecorder[T]) Add(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockSet[T])(nil).Add), arg0) } @@ -62,7 +66,7 @@ func (mr *MockSetMockRecorder[T]) Clear() *gomock.Call { // Contains mocks base method. func (m *MockSet[T]) Contains(arg0 ...T) bool { m.ctrl.T.Helper() - varargs := []interface{}{} + varargs := []any{} for _, a := range arg0 { varargs = append(varargs, a) } @@ -72,7 +76,7 @@ func (m *MockSet[T]) Contains(arg0 ...T) bool { } // Contains indicates an expected call of Contains. -func (mr *MockSetMockRecorder[T]) Contains(arg0 ...interface{}) *gomock.Call { +func (mr *MockSetMockRecorder[T]) Contains(arg0 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Contains", reflect.TypeOf((*MockSet[T])(nil).Contains), arg0...) } @@ -84,7 +88,7 @@ func (m *MockSet[T]) Delete(arg0 T) { } // Delete indicates an expected call of Delete. -func (mr *MockSetMockRecorder[T]) Delete(arg0 interface{}) *gomock.Call { +func (mr *MockSetMockRecorder[T]) Delete(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockSet[T])(nil).Delete), arg0) } diff --git a/pkg/dfpath/mocks/dfpath_mock.go b/pkg/dfpath/mocks/dfpath_mock.go index dcee7bfa56a..1b78d74e861 100644 --- a/pkg/dfpath/mocks/dfpath_mock.go +++ b/pkg/dfpath/mocks/dfpath_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: dfpath.go - +// +// Generated by this command: +// +// mockgen -destination mocks/dfpath_mock.go -source dfpath.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -8,7 +12,7 @@ import ( fs "io/fs" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockDfpath is a mock of Dfpath interface. diff --git a/pkg/digest/mocks/digest_reader_mock.go b/pkg/digest/mocks/digest_reader_mock.go index c52dbfe1b4e..91d4b5f30da 100644 --- a/pkg/digest/mocks/digest_reader_mock.go +++ b/pkg/digest/mocks/digest_reader_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: digest_reader.go - +// +// Generated by this command: +// +// mockgen -destination mocks/digest_reader_mock.go -source digest_reader.go -package mocks +// // Package mocks is a generated GoMock package. package mocks import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockReader is a mock of Reader interface. @@ -57,7 +61,7 @@ func (m *MockReader) Read(p []byte) (int, error) { } // Read indicates an expected call of Read. -func (mr *MockReaderMockRecorder) Read(p interface{}) *gomock.Call { +func (mr *MockReaderMockRecorder) Read(p any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockReader)(nil).Read), p) } diff --git a/pkg/gc/gc_mock.go b/pkg/gc/gc_mock.go index 5140e106c7e..429636c2346 100644 --- a/pkg/gc/gc_mock.go +++ b/pkg/gc/gc_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: gc.go - +// +// Generated by this command: +// +// mockgen -destination gc_mock.go -source gc.go -package gc +// // Package gc is a generated GoMock package. package gc import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockGC is a mock of GC interface. @@ -42,7 +46,7 @@ func (m *MockGC) Add(arg0 Task) error { } // Add indicates an expected call of Add. -func (mr *MockGCMockRecorder) Add(arg0 interface{}) *gomock.Call { +func (mr *MockGCMockRecorder) Add(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockGC)(nil).Add), arg0) } @@ -56,7 +60,7 @@ func (m *MockGC) Run(arg0 string) error { } // Run indicates an expected call of Run. -func (mr *MockGCMockRecorder) Run(arg0 interface{}) *gomock.Call { +func (mr *MockGCMockRecorder) Run(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Run", reflect.TypeOf((*MockGC)(nil).Run), arg0) } diff --git a/pkg/gc/gc_test.go b/pkg/gc/gc_test.go index 335f784ca07..27b0f655470 100644 --- a/pkg/gc/gc_test.go +++ b/pkg/gc/gc_test.go @@ -22,8 +22,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestGC_Add(t *testing.T) { diff --git a/pkg/gc/logger_mock.go b/pkg/gc/logger_mock.go index 31f24816644..d43d2758dfb 100644 --- a/pkg/gc/logger_mock.go +++ b/pkg/gc/logger_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: logger.go - +// +// Generated by this command: +// +// mockgen -destination logger_mock.go -source logger.go -package gc +// // Package gc is a generated GoMock package. package gc import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockLogger is a mock of Logger interface. @@ -36,7 +40,7 @@ func (m *MockLogger) EXPECT() *MockLoggerMockRecorder { // Errorf mocks base method. func (m *MockLogger) Errorf(template string, args ...any) { m.ctrl.T.Helper() - varargs := []interface{}{template} + varargs := []any{template} for _, a := range args { varargs = append(varargs, a) } @@ -44,16 +48,16 @@ func (m *MockLogger) Errorf(template string, args ...any) { } // Errorf indicates an expected call of Errorf. -func (mr *MockLoggerMockRecorder) Errorf(template interface{}, args ...interface{}) *gomock.Call { +func (mr *MockLoggerMockRecorder) Errorf(template any, args ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{template}, args...) + varargs := append([]any{template}, args...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Errorf", reflect.TypeOf((*MockLogger)(nil).Errorf), varargs...) } // Infof mocks base method. func (m *MockLogger) Infof(template string, args ...any) { m.ctrl.T.Helper() - varargs := []interface{}{template} + varargs := []any{template} for _, a := range args { varargs = append(varargs, a) } @@ -61,8 +65,8 @@ func (m *MockLogger) Infof(template string, args ...any) { } // Infof indicates an expected call of Infof. -func (mr *MockLoggerMockRecorder) Infof(template interface{}, args ...interface{}) *gomock.Call { +func (mr *MockLoggerMockRecorder) Infof(template any, args ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{template}, args...) + varargs := append([]any{template}, args...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Infof", reflect.TypeOf((*MockLogger)(nil).Infof), varargs...) } diff --git a/pkg/gc/runner_mock.go b/pkg/gc/runner_mock.go index 6f69f50846b..4434c37c3b7 100644 --- a/pkg/gc/runner_mock.go +++ b/pkg/gc/runner_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: task.go - +// +// Generated by this command: +// +// mockgen -destination runner_mock.go -source task.go -package gc +// // Package gc is a generated GoMock package. package gc import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockRunner is a mock of Runner interface. diff --git a/pkg/graph/dag/mocks/dag_mock.go b/pkg/graph/dag/mocks/dag_mock.go index c14d1543612..a8e04bb7199 100644 --- a/pkg/graph/dag/mocks/dag_mock.go +++ b/pkg/graph/dag/mocks/dag_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: dag.go - +// +// Generated by this command: +// +// mockgen -destination mocks/dag_mock.go -source dag.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -8,7 +12,7 @@ import ( reflect "reflect" dag "d7y.io/dragonfly/v2/pkg/graph/dag" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockDAG is a mock of DAG interface. @@ -43,7 +47,7 @@ func (m *MockDAG[T]) AddEdge(fromVertexID, toVertexID string) error { } // AddEdge indicates an expected call of AddEdge. -func (mr *MockDAGMockRecorder[T]) AddEdge(fromVertexID, toVertexID interface{}) *gomock.Call { +func (mr *MockDAGMockRecorder[T]) AddEdge(fromVertexID, toVertexID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddEdge", reflect.TypeOf((*MockDAG[T])(nil).AddEdge), fromVertexID, toVertexID) } @@ -57,7 +61,7 @@ func (m *MockDAG[T]) AddVertex(id string, value T) error { } // AddVertex indicates an expected call of AddVertex. -func (mr *MockDAGMockRecorder[T]) AddVertex(id, value interface{}) *gomock.Call { +func (mr *MockDAGMockRecorder[T]) AddVertex(id, value any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddVertex", reflect.TypeOf((*MockDAG[T])(nil).AddVertex), id, value) } @@ -71,7 +75,7 @@ func (m *MockDAG[T]) CanAddEdge(fromVertexID, toVertexID string) bool { } // CanAddEdge indicates an expected call of CanAddEdge. -func (mr *MockDAGMockRecorder[T]) CanAddEdge(fromVertexID, toVertexID interface{}) *gomock.Call { +func (mr *MockDAGMockRecorder[T]) CanAddEdge(fromVertexID, toVertexID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CanAddEdge", reflect.TypeOf((*MockDAG[T])(nil).CanAddEdge), fromVertexID, toVertexID) } @@ -85,7 +89,7 @@ func (m *MockDAG[T]) DeleteEdge(fromVertexID, toVertexID string) error { } // DeleteEdge indicates an expected call of DeleteEdge. -func (mr *MockDAGMockRecorder[T]) DeleteEdge(fromVertexID, toVertexID interface{}) *gomock.Call { +func (mr *MockDAGMockRecorder[T]) DeleteEdge(fromVertexID, toVertexID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteEdge", reflect.TypeOf((*MockDAG[T])(nil).DeleteEdge), fromVertexID, toVertexID) } @@ -97,7 +101,7 @@ func (m *MockDAG[T]) DeleteVertex(id string) { } // DeleteVertex indicates an expected call of DeleteVertex. -func (mr *MockDAGMockRecorder[T]) DeleteVertex(id interface{}) *gomock.Call { +func (mr *MockDAGMockRecorder[T]) DeleteVertex(id any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteVertex", reflect.TypeOf((*MockDAG[T])(nil).DeleteVertex), id) } @@ -111,7 +115,7 @@ func (m *MockDAG[T]) DeleteVertexInEdges(id string) error { } // DeleteVertexInEdges indicates an expected call of DeleteVertexInEdges. -func (mr *MockDAGMockRecorder[T]) DeleteVertexInEdges(id interface{}) *gomock.Call { +func (mr *MockDAGMockRecorder[T]) DeleteVertexInEdges(id any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteVertexInEdges", reflect.TypeOf((*MockDAG[T])(nil).DeleteVertexInEdges), id) } @@ -125,7 +129,7 @@ func (m *MockDAG[T]) DeleteVertexOutEdges(id string) error { } // DeleteVertexOutEdges indicates an expected call of DeleteVertexOutEdges. -func (mr *MockDAGMockRecorder[T]) DeleteVertexOutEdges(id interface{}) *gomock.Call { +func (mr *MockDAGMockRecorder[T]) DeleteVertexOutEdges(id any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteVertexOutEdges", reflect.TypeOf((*MockDAG[T])(nil).DeleteVertexOutEdges), id) } @@ -139,7 +143,7 @@ func (m *MockDAG[T]) GetRandomVertices(n uint) []*dag.Vertex[T] { } // GetRandomVertices indicates an expected call of GetRandomVertices. -func (mr *MockDAGMockRecorder[T]) GetRandomVertices(n interface{}) *gomock.Call { +func (mr *MockDAGMockRecorder[T]) GetRandomVertices(n any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRandomVertices", reflect.TypeOf((*MockDAG[T])(nil).GetRandomVertices), n) } @@ -182,7 +186,7 @@ func (m *MockDAG[T]) GetVertex(id string) (*dag.Vertex[T], error) { } // GetVertex indicates an expected call of GetVertex. -func (mr *MockDAGMockRecorder[T]) GetVertex(id interface{}) *gomock.Call { +func (mr *MockDAGMockRecorder[T]) GetVertex(id any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVertex", reflect.TypeOf((*MockDAG[T])(nil).GetVertex), id) } diff --git a/pkg/graph/dg/mocks/dg_mock.go b/pkg/graph/dg/mocks/dg_mock.go index 721b7b2f6b4..81800ad8f7d 100644 --- a/pkg/graph/dg/mocks/dg_mock.go +++ b/pkg/graph/dg/mocks/dg_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: dg.go - +// +// Generated by this command: +// +// mockgen -destination mocks/dg_mock.go -source dg.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -8,7 +12,7 @@ import ( reflect "reflect" dg "d7y.io/dragonfly/v2/pkg/graph/dg" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockDG is a mock of DG interface. @@ -43,7 +47,7 @@ func (m *MockDG[T]) AddEdge(fromVertexID, toVertexID string) error { } // AddEdge indicates an expected call of AddEdge. -func (mr *MockDGMockRecorder[T]) AddEdge(fromVertexID, toVertexID interface{}) *gomock.Call { +func (mr *MockDGMockRecorder[T]) AddEdge(fromVertexID, toVertexID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddEdge", reflect.TypeOf((*MockDG[T])(nil).AddEdge), fromVertexID, toVertexID) } @@ -57,7 +61,7 @@ func (m *MockDG[T]) AddVertex(id string, value T) error { } // AddVertex indicates an expected call of AddVertex. -func (mr *MockDGMockRecorder[T]) AddVertex(id, value interface{}) *gomock.Call { +func (mr *MockDGMockRecorder[T]) AddVertex(id, value any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddVertex", reflect.TypeOf((*MockDG[T])(nil).AddVertex), id, value) } @@ -71,7 +75,7 @@ func (m *MockDG[T]) CanAddEdge(fromVertexID, toVertexID string) bool { } // CanAddEdge indicates an expected call of CanAddEdge. -func (mr *MockDGMockRecorder[T]) CanAddEdge(fromVertexID, toVertexID interface{}) *gomock.Call { +func (mr *MockDGMockRecorder[T]) CanAddEdge(fromVertexID, toVertexID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CanAddEdge", reflect.TypeOf((*MockDG[T])(nil).CanAddEdge), fromVertexID, toVertexID) } @@ -85,7 +89,7 @@ func (m *MockDG[T]) DeleteEdge(fromVertexID, toVertexID string) error { } // DeleteEdge indicates an expected call of DeleteEdge. -func (mr *MockDGMockRecorder[T]) DeleteEdge(fromVertexID, toVertexID interface{}) *gomock.Call { +func (mr *MockDGMockRecorder[T]) DeleteEdge(fromVertexID, toVertexID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteEdge", reflect.TypeOf((*MockDG[T])(nil).DeleteEdge), fromVertexID, toVertexID) } @@ -97,7 +101,7 @@ func (m *MockDG[T]) DeleteVertex(id string) { } // DeleteVertex indicates an expected call of DeleteVertex. -func (mr *MockDGMockRecorder[T]) DeleteVertex(id interface{}) *gomock.Call { +func (mr *MockDGMockRecorder[T]) DeleteVertex(id any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteVertex", reflect.TypeOf((*MockDG[T])(nil).DeleteVertex), id) } @@ -111,7 +115,7 @@ func (m *MockDG[T]) DeleteVertexInEdges(id string) error { } // DeleteVertexInEdges indicates an expected call of DeleteVertexInEdges. -func (mr *MockDGMockRecorder[T]) DeleteVertexInEdges(id interface{}) *gomock.Call { +func (mr *MockDGMockRecorder[T]) DeleteVertexInEdges(id any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteVertexInEdges", reflect.TypeOf((*MockDG[T])(nil).DeleteVertexInEdges), id) } @@ -125,7 +129,7 @@ func (m *MockDG[T]) DeleteVertexOutEdges(id string) error { } // DeleteVertexOutEdges indicates an expected call of DeleteVertexOutEdges. -func (mr *MockDGMockRecorder[T]) DeleteVertexOutEdges(id interface{}) *gomock.Call { +func (mr *MockDGMockRecorder[T]) DeleteVertexOutEdges(id any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteVertexOutEdges", reflect.TypeOf((*MockDG[T])(nil).DeleteVertexOutEdges), id) } @@ -139,7 +143,7 @@ func (m *MockDG[T]) GetRandomVertices(n uint) []*dg.Vertex[T] { } // GetRandomVertices indicates an expected call of GetRandomVertices. -func (mr *MockDGMockRecorder[T]) GetRandomVertices(n interface{}) *gomock.Call { +func (mr *MockDGMockRecorder[T]) GetRandomVertices(n any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRandomVertices", reflect.TypeOf((*MockDG[T])(nil).GetRandomVertices), n) } @@ -182,7 +186,7 @@ func (m *MockDG[T]) GetVertex(id string) (*dg.Vertex[T], error) { } // GetVertex indicates an expected call of GetVertex. -func (mr *MockDGMockRecorder[T]) GetVertex(id interface{}) *gomock.Call { +func (mr *MockDGMockRecorder[T]) GetVertex(id any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVertex", reflect.TypeOf((*MockDG[T])(nil).GetVertex), id) } diff --git a/pkg/objectstorage/mocks/objectstorage_mock.go b/pkg/objectstorage/mocks/objectstorage_mock.go index 7c7d2e6ba5e..1eeec11dad6 100644 --- a/pkg/objectstorage/mocks/objectstorage_mock.go +++ b/pkg/objectstorage/mocks/objectstorage_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: objectstorage.go - +// +// Generated by this command: +// +// mockgen -destination mocks/objectstorage_mock.go -source objectstorage.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -11,7 +15,7 @@ import ( time "time" objectstorage "d7y.io/dragonfly/v2/pkg/objectstorage" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockObjectStorage is a mock of ObjectStorage interface. @@ -46,7 +50,7 @@ func (m *MockObjectStorage) CopyObject(ctx context.Context, bucketName, sourceOb } // CopyObject indicates an expected call of CopyObject. -func (mr *MockObjectStorageMockRecorder) CopyObject(ctx, bucketName, sourceObjectKey, destinationObjectKey interface{}) *gomock.Call { +func (mr *MockObjectStorageMockRecorder) CopyObject(ctx, bucketName, sourceObjectKey, destinationObjectKey any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CopyObject", reflect.TypeOf((*MockObjectStorage)(nil).CopyObject), ctx, bucketName, sourceObjectKey, destinationObjectKey) } @@ -60,7 +64,7 @@ func (m *MockObjectStorage) CreateBucket(ctx context.Context, bucketName string) } // CreateBucket indicates an expected call of CreateBucket. -func (mr *MockObjectStorageMockRecorder) CreateBucket(ctx, bucketName interface{}) *gomock.Call { +func (mr *MockObjectStorageMockRecorder) CreateBucket(ctx, bucketName any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBucket", reflect.TypeOf((*MockObjectStorage)(nil).CreateBucket), ctx, bucketName) } @@ -74,7 +78,7 @@ func (m *MockObjectStorage) DeleteBucket(ctx context.Context, bucketName string) } // DeleteBucket indicates an expected call of DeleteBucket. -func (mr *MockObjectStorageMockRecorder) DeleteBucket(ctx, bucketName interface{}) *gomock.Call { +func (mr *MockObjectStorageMockRecorder) DeleteBucket(ctx, bucketName any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteBucket", reflect.TypeOf((*MockObjectStorage)(nil).DeleteBucket), ctx, bucketName) } @@ -88,7 +92,7 @@ func (m *MockObjectStorage) DeleteObject(ctx context.Context, bucketName, object } // DeleteObject indicates an expected call of DeleteObject. -func (mr *MockObjectStorageMockRecorder) DeleteObject(ctx, bucketName, objectKey interface{}) *gomock.Call { +func (mr *MockObjectStorageMockRecorder) DeleteObject(ctx, bucketName, objectKey any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteObject", reflect.TypeOf((*MockObjectStorage)(nil).DeleteObject), ctx, bucketName, objectKey) } @@ -103,7 +107,7 @@ func (m *MockObjectStorage) GetBucketMetadata(ctx context.Context, bucketName st } // GetBucketMetadata indicates an expected call of GetBucketMetadata. -func (mr *MockObjectStorageMockRecorder) GetBucketMetadata(ctx, bucketName interface{}) *gomock.Call { +func (mr *MockObjectStorageMockRecorder) GetBucketMetadata(ctx, bucketName any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBucketMetadata", reflect.TypeOf((*MockObjectStorage)(nil).GetBucketMetadata), ctx, bucketName) } @@ -119,7 +123,7 @@ func (m *MockObjectStorage) GetObjectMetadata(ctx context.Context, bucketName, o } // GetObjectMetadata indicates an expected call of GetObjectMetadata. -func (mr *MockObjectStorageMockRecorder) GetObjectMetadata(ctx, bucketName, objectKey interface{}) *gomock.Call { +func (mr *MockObjectStorageMockRecorder) GetObjectMetadata(ctx, bucketName, objectKey any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetObjectMetadata", reflect.TypeOf((*MockObjectStorage)(nil).GetObjectMetadata), ctx, bucketName, objectKey) } @@ -134,7 +138,7 @@ func (m *MockObjectStorage) GetObjectMetadatas(ctx context.Context, bucketName, } // GetObjectMetadatas indicates an expected call of GetObjectMetadatas. -func (mr *MockObjectStorageMockRecorder) GetObjectMetadatas(ctx, bucketName, prefix, marker, delimiter, limit interface{}) *gomock.Call { +func (mr *MockObjectStorageMockRecorder) GetObjectMetadatas(ctx, bucketName, prefix, marker, delimiter, limit any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetObjectMetadatas", reflect.TypeOf((*MockObjectStorage)(nil).GetObjectMetadatas), ctx, bucketName, prefix, marker, delimiter, limit) } @@ -149,7 +153,7 @@ func (m *MockObjectStorage) GetOject(ctx context.Context, bucketName, objectKey } // GetOject indicates an expected call of GetOject. -func (mr *MockObjectStorageMockRecorder) GetOject(ctx, bucketName, objectKey interface{}) *gomock.Call { +func (mr *MockObjectStorageMockRecorder) GetOject(ctx, bucketName, objectKey any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOject", reflect.TypeOf((*MockObjectStorage)(nil).GetOject), ctx, bucketName, objectKey) } @@ -164,7 +168,7 @@ func (m *MockObjectStorage) GetSignURL(ctx context.Context, bucketName, objectKe } // GetSignURL indicates an expected call of GetSignURL. -func (mr *MockObjectStorageMockRecorder) GetSignURL(ctx, bucketName, objectKey, method, expire interface{}) *gomock.Call { +func (mr *MockObjectStorageMockRecorder) GetSignURL(ctx, bucketName, objectKey, method, expire any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSignURL", reflect.TypeOf((*MockObjectStorage)(nil).GetSignURL), ctx, bucketName, objectKey, method, expire) } @@ -179,7 +183,7 @@ func (m *MockObjectStorage) IsBucketExist(ctx context.Context, bucketName string } // IsBucketExist indicates an expected call of IsBucketExist. -func (mr *MockObjectStorageMockRecorder) IsBucketExist(ctx, bucketName interface{}) *gomock.Call { +func (mr *MockObjectStorageMockRecorder) IsBucketExist(ctx, bucketName any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsBucketExist", reflect.TypeOf((*MockObjectStorage)(nil).IsBucketExist), ctx, bucketName) } @@ -194,7 +198,7 @@ func (m *MockObjectStorage) IsObjectExist(ctx context.Context, bucketName, objec } // IsObjectExist indicates an expected call of IsObjectExist. -func (mr *MockObjectStorageMockRecorder) IsObjectExist(ctx, bucketName, objectKey interface{}) *gomock.Call { +func (mr *MockObjectStorageMockRecorder) IsObjectExist(ctx, bucketName, objectKey any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsObjectExist", reflect.TypeOf((*MockObjectStorage)(nil).IsObjectExist), ctx, bucketName, objectKey) } @@ -209,7 +213,7 @@ func (m *MockObjectStorage) ListBucketMetadatas(ctx context.Context) ([]*objects } // ListBucketMetadatas indicates an expected call of ListBucketMetadatas. -func (mr *MockObjectStorageMockRecorder) ListBucketMetadatas(ctx interface{}) *gomock.Call { +func (mr *MockObjectStorageMockRecorder) ListBucketMetadatas(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListBucketMetadatas", reflect.TypeOf((*MockObjectStorage)(nil).ListBucketMetadatas), ctx) } @@ -223,7 +227,7 @@ func (m *MockObjectStorage) PutObject(ctx context.Context, bucketName, objectKey } // PutObject indicates an expected call of PutObject. -func (mr *MockObjectStorageMockRecorder) PutObject(ctx, bucketName, objectKey, digest, reader interface{}) *gomock.Call { +func (mr *MockObjectStorageMockRecorder) PutObject(ctx, bucketName, objectKey, digest, reader any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutObject", reflect.TypeOf((*MockObjectStorage)(nil).PutObject), ctx, bucketName, objectKey, digest, reader) } diff --git a/pkg/reachable/mocks/reachable_mock.go b/pkg/reachable/mocks/reachable_mock.go index 5f71e4b731c..90106348aeb 100644 --- a/pkg/reachable/mocks/reachable_mock.go +++ b/pkg/reachable/mocks/reachable_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: reachable.go - +// +// Generated by this command: +// +// mockgen -destination mocks/reachable_mock.go -source reachable.go -package mocks +// // Package mocks is a generated GoMock package. package mocks import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockReachable is a mock of Reachable interface. diff --git a/pkg/rpc/cdnsystem/client/mocks/client_mock.go b/pkg/rpc/cdnsystem/client/mocks/client_mock.go index b527e3b9cd0..a28757a93bc 100644 --- a/pkg/rpc/cdnsystem/client/mocks/client_mock.go +++ b/pkg/rpc/cdnsystem/client/mocks/client_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: client.go - +// +// Generated by this command: +// +// mockgen -destination mocks/client_mock.go -source client.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -10,7 +14,7 @@ import ( cdnsystem "d7y.io/api/v2/pkg/apis/cdnsystem/v1" common "d7y.io/api/v2/pkg/apis/common/v1" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" ) @@ -54,7 +58,7 @@ func (mr *MockClientMockRecorder) Close() *gomock.Call { // GetPieceTasks mocks base method. func (m *MockClient) GetPieceTasks(arg0 context.Context, arg1 *common.PieceTaskRequest, arg2 ...grpc.CallOption) (*common.PiecePacket, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -65,16 +69,16 @@ func (m *MockClient) GetPieceTasks(arg0 context.Context, arg1 *common.PieceTaskR } // GetPieceTasks indicates an expected call of GetPieceTasks. -func (mr *MockClientMockRecorder) GetPieceTasks(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetPieceTasks(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, "GetPieceTasks", reflect.TypeOf((*MockClient)(nil).GetPieceTasks), varargs...) } // ObtainSeeds mocks base method. func (m *MockClient) ObtainSeeds(arg0 context.Context, arg1 *cdnsystem.SeedRequest, arg2 ...grpc.CallOption) (cdnsystem.Seeder_ObtainSeedsClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -85,16 +89,16 @@ func (m *MockClient) ObtainSeeds(arg0 context.Context, arg1 *cdnsystem.SeedReque } // ObtainSeeds indicates an expected call of ObtainSeeds. -func (mr *MockClientMockRecorder) ObtainSeeds(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) ObtainSeeds(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, "ObtainSeeds", reflect.TypeOf((*MockClient)(nil).ObtainSeeds), varargs...) } // SyncPieceTasks mocks base method. func (m *MockClient) SyncPieceTasks(arg0 context.Context, arg1 *common.PieceTaskRequest, arg2 ...grpc.CallOption) (cdnsystem.Seeder_SyncPieceTasksClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -105,8 +109,8 @@ func (m *MockClient) SyncPieceTasks(arg0 context.Context, arg1 *common.PieceTask } // SyncPieceTasks indicates an expected call of SyncPieceTasks. -func (mr *MockClientMockRecorder) SyncPieceTasks(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) SyncPieceTasks(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, "SyncPieceTasks", reflect.TypeOf((*MockClient)(nil).SyncPieceTasks), varargs...) } diff --git a/pkg/rpc/dfdaemon/client/mocks/client_v1_mock.go b/pkg/rpc/dfdaemon/client/mocks/client_v1_mock.go index 09a5fd83de3..c4644207e05 100644 --- a/pkg/rpc/dfdaemon/client/mocks/client_v1_mock.go +++ b/pkg/rpc/dfdaemon/client/mocks/client_v1_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: client_v1.go - +// +// Generated by this command: +// +// mockgen -destination mocks/client_v1_mock.go -source client_v1.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -10,7 +14,7 @@ import ( common "d7y.io/api/v2/pkg/apis/common/v1" dfdaemon "d7y.io/api/v2/pkg/apis/dfdaemon/v1" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" ) @@ -40,7 +44,7 @@ func (m *MockV1) EXPECT() *MockV1MockRecorder { // CheckHealth mocks base method. func (m *MockV1) CheckHealth(arg0 context.Context, arg1 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -50,9 +54,9 @@ func (m *MockV1) CheckHealth(arg0 context.Context, arg1 ...grpc.CallOption) erro } // CheckHealth indicates an expected call of CheckHealth. -func (mr *MockV1MockRecorder) CheckHealth(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) CheckHealth(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, "CheckHealth", reflect.TypeOf((*MockV1)(nil).CheckHealth), varargs...) } @@ -73,7 +77,7 @@ func (mr *MockV1MockRecorder) Close() *gomock.Call { // DeleteTask mocks base method. func (m *MockV1) DeleteTask(arg0 context.Context, arg1 *dfdaemon.DeleteTaskRequest, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -83,16 +87,16 @@ func (m *MockV1) DeleteTask(arg0 context.Context, arg1 *dfdaemon.DeleteTaskReque } // DeleteTask indicates an expected call of DeleteTask. -func (mr *MockV1MockRecorder) DeleteTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) DeleteTask(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, "DeleteTask", reflect.TypeOf((*MockV1)(nil).DeleteTask), varargs...) } // Download mocks base method. func (m *MockV1) Download(arg0 context.Context, arg1 *dfdaemon.DownRequest, arg2 ...grpc.CallOption) (dfdaemon.Daemon_DownloadClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -103,16 +107,16 @@ func (m *MockV1) Download(arg0 context.Context, arg1 *dfdaemon.DownRequest, arg2 } // Download indicates an expected call of Download. -func (mr *MockV1MockRecorder) Download(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) Download(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, "Download", reflect.TypeOf((*MockV1)(nil).Download), varargs...) } // ExportTask mocks base method. func (m *MockV1) ExportTask(arg0 context.Context, arg1 *dfdaemon.ExportTaskRequest, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -122,16 +126,16 @@ func (m *MockV1) ExportTask(arg0 context.Context, arg1 *dfdaemon.ExportTaskReque } // ExportTask indicates an expected call of ExportTask. -func (mr *MockV1MockRecorder) ExportTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) ExportTask(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, "ExportTask", reflect.TypeOf((*MockV1)(nil).ExportTask), varargs...) } // GetPieceTasks mocks base method. func (m *MockV1) GetPieceTasks(arg0 context.Context, arg1 *common.PieceTaskRequest, arg2 ...grpc.CallOption) (*common.PiecePacket, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -142,16 +146,16 @@ func (m *MockV1) GetPieceTasks(arg0 context.Context, arg1 *common.PieceTaskReque } // GetPieceTasks indicates an expected call of GetPieceTasks. -func (mr *MockV1MockRecorder) GetPieceTasks(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) GetPieceTasks(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, "GetPieceTasks", reflect.TypeOf((*MockV1)(nil).GetPieceTasks), varargs...) } // ImportTask mocks base method. func (m *MockV1) ImportTask(arg0 context.Context, arg1 *dfdaemon.ImportTaskRequest, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -161,16 +165,16 @@ func (m *MockV1) ImportTask(arg0 context.Context, arg1 *dfdaemon.ImportTaskReque } // ImportTask indicates an expected call of ImportTask. -func (mr *MockV1MockRecorder) ImportTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) ImportTask(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, "ImportTask", reflect.TypeOf((*MockV1)(nil).ImportTask), varargs...) } // StatTask mocks base method. func (m *MockV1) StatTask(arg0 context.Context, arg1 *dfdaemon.StatTaskRequest, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -180,16 +184,16 @@ func (m *MockV1) StatTask(arg0 context.Context, arg1 *dfdaemon.StatTaskRequest, } // StatTask indicates an expected call of StatTask. -func (mr *MockV1MockRecorder) StatTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) StatTask(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, "StatTask", reflect.TypeOf((*MockV1)(nil).StatTask), varargs...) } // SyncPieceTasks mocks base method. func (m *MockV1) SyncPieceTasks(arg0 context.Context, arg1 *common.PieceTaskRequest, arg2 ...grpc.CallOption) (dfdaemon.Daemon_SyncPieceTasksClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -200,8 +204,8 @@ func (m *MockV1) SyncPieceTasks(arg0 context.Context, arg1 *common.PieceTaskRequ } // SyncPieceTasks indicates an expected call of SyncPieceTasks. -func (mr *MockV1MockRecorder) SyncPieceTasks(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) SyncPieceTasks(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, "SyncPieceTasks", reflect.TypeOf((*MockV1)(nil).SyncPieceTasks), varargs...) } diff --git a/pkg/rpc/dfdaemon/client/mocks/client_v2_mock.go b/pkg/rpc/dfdaemon/client/mocks/client_v2_mock.go index a788a0676f3..bba2848e9ae 100644 --- a/pkg/rpc/dfdaemon/client/mocks/client_v2_mock.go +++ b/pkg/rpc/dfdaemon/client/mocks/client_v2_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: client_v2.go - +// +// Generated by this command: +// +// mockgen -destination mocks/client_v2_mock.go -source client_v2.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -10,7 +14,7 @@ import ( common "d7y.io/api/v2/pkg/apis/common/v2" dfdaemon "d7y.io/api/v2/pkg/apis/dfdaemon/v2" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" ) @@ -54,7 +58,7 @@ func (mr *MockV2MockRecorder) Close() *gomock.Call { // DeleteTask mocks base method. func (m *MockV2) DeleteTask(arg0 context.Context, arg1 *dfdaemon.DeleteTaskRequest, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -64,16 +68,16 @@ func (m *MockV2) DeleteTask(arg0 context.Context, arg1 *dfdaemon.DeleteTaskReque } // DeleteTask indicates an expected call of DeleteTask. -func (mr *MockV2MockRecorder) DeleteTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) DeleteTask(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, "DeleteTask", reflect.TypeOf((*MockV2)(nil).DeleteTask), varargs...) } // DownloadTask mocks base method. func (m *MockV2) DownloadTask(arg0 context.Context, arg1 *dfdaemon.DownloadTaskRequest, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -83,16 +87,16 @@ func (m *MockV2) DownloadTask(arg0 context.Context, arg1 *dfdaemon.DownloadTaskR } // DownloadTask indicates an expected call of DownloadTask. -func (mr *MockV2MockRecorder) DownloadTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) DownloadTask(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, "DownloadTask", reflect.TypeOf((*MockV2)(nil).DownloadTask), varargs...) } // StatTask mocks base method. func (m *MockV2) StatTask(arg0 context.Context, arg1 *dfdaemon.StatTaskRequest, arg2 ...grpc.CallOption) (*common.Task, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -103,16 +107,16 @@ func (m *MockV2) StatTask(arg0 context.Context, arg1 *dfdaemon.StatTaskRequest, } // StatTask indicates an expected call of StatTask. -func (mr *MockV2MockRecorder) StatTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) StatTask(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, "StatTask", reflect.TypeOf((*MockV2)(nil).StatTask), varargs...) } // SyncPieces mocks base method. func (m *MockV2) SyncPieces(arg0 context.Context, arg1 ...grpc.CallOption) (dfdaemon.Dfdaemon_SyncPiecesClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -123,16 +127,16 @@ func (m *MockV2) SyncPieces(arg0 context.Context, arg1 ...grpc.CallOption) (dfda } // SyncPieces indicates an expected call of SyncPieces. -func (mr *MockV2MockRecorder) SyncPieces(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) SyncPieces(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, "SyncPieces", reflect.TypeOf((*MockV2)(nil).SyncPieces), varargs...) } // UploadTask mocks base method. func (m *MockV2) UploadTask(arg0 context.Context, arg1 *dfdaemon.UploadTaskRequest, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -142,8 +146,8 @@ func (m *MockV2) UploadTask(arg0 context.Context, arg1 *dfdaemon.UploadTaskReque } // UploadTask indicates an expected call of UploadTask. -func (mr *MockV2MockRecorder) UploadTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) UploadTask(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, "UploadTask", reflect.TypeOf((*MockV2)(nil).UploadTask), varargs...) } diff --git a/pkg/rpc/health/client/mocks/client_mock.go b/pkg/rpc/health/client/mocks/client_mock.go index fada0ef90d1..1f9c78b4928 100644 --- a/pkg/rpc/health/client/mocks/client_mock.go +++ b/pkg/rpc/health/client/mocks/client_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: client.go - +// +// Generated by this command: +// +// mockgen -destination mocks/client_mock.go -source client.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" grpc_health_v1 "google.golang.org/grpc/health/grpc_health_v1" ) @@ -39,7 +43,7 @@ func (m *MockClient) EXPECT() *MockClientMockRecorder { // Check mocks base method. func (m *MockClient) Check(arg0 context.Context, arg1 *grpc_health_v1.HealthCheckRequest, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -49,9 +53,9 @@ func (m *MockClient) Check(arg0 context.Context, arg1 *grpc_health_v1.HealthChec } // Check indicates an expected call of Check. -func (mr *MockClientMockRecorder) Check(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) Check(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, "Check", reflect.TypeOf((*MockClient)(nil).Check), varargs...) } diff --git a/pkg/rpc/inference/client/mocks/client_v1_mock.go b/pkg/rpc/inference/client/mocks/client_v1_mock.go index be28322cbc8..ca495cd3ddb 100644 --- a/pkg/rpc/inference/client/mocks/client_v1_mock.go +++ b/pkg/rpc/inference/client/mocks/client_v1_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: client_v1.go - +// +// Generated by this command: +// +// mockgen -destination mocks/client_v1_mock.go -source client_v1.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -9,7 +13,7 @@ import ( reflect "reflect" inference "d7y.io/api/v2/pkg/apis/inference/v1" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" ) @@ -53,7 +57,7 @@ func (mr *MockV1MockRecorder) Close() *gomock.Call { // ModelInfer mocks base method. func (m *MockV1) ModelInfer(arg0 context.Context, arg1 *inference.ModelInferRequest, arg2 ...grpc.CallOption) (*inference.ModelInferResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -64,16 +68,16 @@ func (m *MockV1) ModelInfer(arg0 context.Context, arg1 *inference.ModelInferRequ } // ModelInfer indicates an expected call of ModelInfer. -func (mr *MockV1MockRecorder) ModelInfer(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) ModelInfer(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, "ModelInfer", reflect.TypeOf((*MockV1)(nil).ModelInfer), varargs...) } // ModelReady mocks base method. func (m *MockV1) ModelReady(arg0 context.Context, arg1 *inference.ModelReadyRequest, arg2 ...grpc.CallOption) (*inference.ModelReadyResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -84,16 +88,16 @@ func (m *MockV1) ModelReady(arg0 context.Context, arg1 *inference.ModelReadyRequ } // ModelReady indicates an expected call of ModelReady. -func (mr *MockV1MockRecorder) ModelReady(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) ModelReady(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, "ModelReady", reflect.TypeOf((*MockV1)(nil).ModelReady), varargs...) } // ServerReady mocks base method. func (m *MockV1) ServerReady(arg0 context.Context, arg1 *inference.ServerReadyRequest, arg2 ...grpc.CallOption) (*inference.ServerReadyResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -104,8 +108,8 @@ func (m *MockV1) ServerReady(arg0 context.Context, arg1 *inference.ServerReadyRe } // ServerReady indicates an expected call of ServerReady. -func (mr *MockV1MockRecorder) ServerReady(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) ServerReady(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, "ServerReady", reflect.TypeOf((*MockV1)(nil).ServerReady), varargs...) } diff --git a/pkg/rpc/manager/client/mocks/client_v1_mock.go b/pkg/rpc/manager/client/mocks/client_v1_mock.go index 3cf1a9afad0..36727c3388d 100644 --- a/pkg/rpc/manager/client/mocks/client_v1_mock.go +++ b/pkg/rpc/manager/client/mocks/client_v1_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: client_v1.go - +// +// Generated by this command: +// +// mockgen -destination mocks/client_v1_mock.go -source client_v1.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -10,7 +14,7 @@ import ( time "time" manager "d7y.io/api/v2/pkg/apis/manager/v1" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" ) @@ -54,7 +58,7 @@ func (mr *MockV1MockRecorder) Close() *gomock.Call { // CreateModel mocks base method. func (m *MockV1) CreateModel(arg0 context.Context, arg1 *manager.CreateModelRequest, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -64,16 +68,16 @@ func (m *MockV1) CreateModel(arg0 context.Context, arg1 *manager.CreateModelRequ } // CreateModel indicates an expected call of CreateModel. -func (mr *MockV1MockRecorder) CreateModel(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) CreateModel(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, "CreateModel", reflect.TypeOf((*MockV1)(nil).CreateModel), varargs...) } // GetObjectStorage mocks base method. func (m *MockV1) GetObjectStorage(arg0 context.Context, arg1 *manager.GetObjectStorageRequest, arg2 ...grpc.CallOption) (*manager.ObjectStorage, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -84,16 +88,16 @@ func (m *MockV1) GetObjectStorage(arg0 context.Context, arg1 *manager.GetObjectS } // GetObjectStorage indicates an expected call of GetObjectStorage. -func (mr *MockV1MockRecorder) GetObjectStorage(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) GetObjectStorage(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, "GetObjectStorage", reflect.TypeOf((*MockV1)(nil).GetObjectStorage), varargs...) } // GetScheduler mocks base method. func (m *MockV1) GetScheduler(arg0 context.Context, arg1 *manager.GetSchedulerRequest, arg2 ...grpc.CallOption) (*manager.Scheduler, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -104,16 +108,16 @@ func (m *MockV1) GetScheduler(arg0 context.Context, arg1 *manager.GetSchedulerRe } // GetScheduler indicates an expected call of GetScheduler. -func (mr *MockV1MockRecorder) GetScheduler(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) GetScheduler(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, "GetScheduler", reflect.TypeOf((*MockV1)(nil).GetScheduler), varargs...) } // KeepAlive mocks base method. func (m *MockV1) KeepAlive(arg0 time.Duration, arg1 *manager.KeepAliveRequest, arg2 <-chan struct{}, arg3 ...grpc.CallOption) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2} + varargs := []any{arg0, arg1, arg2} for _, a := range arg3 { varargs = append(varargs, a) } @@ -121,16 +125,16 @@ func (m *MockV1) KeepAlive(arg0 time.Duration, arg1 *manager.KeepAliveRequest, a } // KeepAlive indicates an expected call of KeepAlive. -func (mr *MockV1MockRecorder) KeepAlive(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) KeepAlive(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, "KeepAlive", reflect.TypeOf((*MockV1)(nil).KeepAlive), varargs...) } // ListApplications mocks base method. func (m *MockV1) ListApplications(arg0 context.Context, arg1 *manager.ListApplicationsRequest, arg2 ...grpc.CallOption) (*manager.ListApplicationsResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -141,16 +145,16 @@ func (m *MockV1) ListApplications(arg0 context.Context, arg1 *manager.ListApplic } // ListApplications indicates an expected call of ListApplications. -func (mr *MockV1MockRecorder) ListApplications(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) ListApplications(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, "ListApplications", reflect.TypeOf((*MockV1)(nil).ListApplications), varargs...) } // ListBuckets mocks base method. func (m *MockV1) ListBuckets(arg0 context.Context, arg1 *manager.ListBucketsRequest, arg2 ...grpc.CallOption) (*manager.ListBucketsResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -161,16 +165,16 @@ func (m *MockV1) ListBuckets(arg0 context.Context, arg1 *manager.ListBucketsRequ } // ListBuckets indicates an expected call of ListBuckets. -func (mr *MockV1MockRecorder) ListBuckets(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) ListBuckets(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, "ListBuckets", reflect.TypeOf((*MockV1)(nil).ListBuckets), varargs...) } // ListSchedulers mocks base method. func (m *MockV1) ListSchedulers(arg0 context.Context, arg1 *manager.ListSchedulersRequest, arg2 ...grpc.CallOption) (*manager.ListSchedulersResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -181,16 +185,16 @@ func (m *MockV1) ListSchedulers(arg0 context.Context, arg1 *manager.ListSchedule } // ListSchedulers indicates an expected call of ListSchedulers. -func (mr *MockV1MockRecorder) ListSchedulers(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) ListSchedulers(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, "ListSchedulers", reflect.TypeOf((*MockV1)(nil).ListSchedulers), varargs...) } // UpdateScheduler mocks base method. func (m *MockV1) UpdateScheduler(arg0 context.Context, arg1 *manager.UpdateSchedulerRequest, arg2 ...grpc.CallOption) (*manager.Scheduler, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -201,16 +205,16 @@ func (m *MockV1) UpdateScheduler(arg0 context.Context, arg1 *manager.UpdateSched } // UpdateScheduler indicates an expected call of UpdateScheduler. -func (mr *MockV1MockRecorder) UpdateScheduler(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) UpdateScheduler(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, "UpdateScheduler", reflect.TypeOf((*MockV1)(nil).UpdateScheduler), varargs...) } // UpdateSeedPeer mocks base method. func (m *MockV1) UpdateSeedPeer(arg0 context.Context, arg1 *manager.UpdateSeedPeerRequest, arg2 ...grpc.CallOption) (*manager.SeedPeer, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -221,8 +225,8 @@ func (m *MockV1) UpdateSeedPeer(arg0 context.Context, arg1 *manager.UpdateSeedPe } // UpdateSeedPeer indicates an expected call of UpdateSeedPeer. -func (mr *MockV1MockRecorder) UpdateSeedPeer(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) UpdateSeedPeer(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, "UpdateSeedPeer", reflect.TypeOf((*MockV1)(nil).UpdateSeedPeer), varargs...) } diff --git a/pkg/rpc/manager/client/mocks/client_v2_mock.go b/pkg/rpc/manager/client/mocks/client_v2_mock.go index f56deb17a07..934d9de7b95 100644 --- a/pkg/rpc/manager/client/mocks/client_v2_mock.go +++ b/pkg/rpc/manager/client/mocks/client_v2_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: client_v2.go - +// +// Generated by this command: +// +// mockgen -destination mocks/client_v2_mock.go -source client_v2.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -10,7 +14,7 @@ import ( time "time" manager "d7y.io/api/v2/pkg/apis/manager/v2" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" ) @@ -54,7 +58,7 @@ func (mr *MockV2MockRecorder) Close() *gomock.Call { // CreateModel mocks base method. func (m *MockV2) CreateModel(arg0 context.Context, arg1 *manager.CreateModelRequest, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -64,16 +68,16 @@ func (m *MockV2) CreateModel(arg0 context.Context, arg1 *manager.CreateModelRequ } // CreateModel indicates an expected call of CreateModel. -func (mr *MockV2MockRecorder) CreateModel(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) CreateModel(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, "CreateModel", reflect.TypeOf((*MockV2)(nil).CreateModel), varargs...) } // DeleteSeedPeer mocks base method. func (m *MockV2) DeleteSeedPeer(arg0 context.Context, arg1 *manager.DeleteSeedPeerRequest, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -83,16 +87,16 @@ func (m *MockV2) DeleteSeedPeer(arg0 context.Context, arg1 *manager.DeleteSeedPe } // DeleteSeedPeer indicates an expected call of DeleteSeedPeer. -func (mr *MockV2MockRecorder) DeleteSeedPeer(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) DeleteSeedPeer(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, "DeleteSeedPeer", reflect.TypeOf((*MockV2)(nil).DeleteSeedPeer), varargs...) } // GetObjectStorage mocks base method. func (m *MockV2) GetObjectStorage(arg0 context.Context, arg1 *manager.GetObjectStorageRequest, arg2 ...grpc.CallOption) (*manager.ObjectStorage, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -103,16 +107,16 @@ func (m *MockV2) GetObjectStorage(arg0 context.Context, arg1 *manager.GetObjectS } // GetObjectStorage indicates an expected call of GetObjectStorage. -func (mr *MockV2MockRecorder) GetObjectStorage(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) GetObjectStorage(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, "GetObjectStorage", reflect.TypeOf((*MockV2)(nil).GetObjectStorage), varargs...) } // GetScheduler mocks base method. func (m *MockV2) GetScheduler(arg0 context.Context, arg1 *manager.GetSchedulerRequest, arg2 ...grpc.CallOption) (*manager.Scheduler, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -123,16 +127,16 @@ func (m *MockV2) GetScheduler(arg0 context.Context, arg1 *manager.GetSchedulerRe } // GetScheduler indicates an expected call of GetScheduler. -func (mr *MockV2MockRecorder) GetScheduler(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) GetScheduler(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, "GetScheduler", reflect.TypeOf((*MockV2)(nil).GetScheduler), varargs...) } // KeepAlive mocks base method. func (m *MockV2) KeepAlive(arg0 time.Duration, arg1 *manager.KeepAliveRequest, arg2 <-chan struct{}, arg3 ...grpc.CallOption) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2} + varargs := []any{arg0, arg1, arg2} for _, a := range arg3 { varargs = append(varargs, a) } @@ -140,16 +144,16 @@ func (m *MockV2) KeepAlive(arg0 time.Duration, arg1 *manager.KeepAliveRequest, a } // KeepAlive indicates an expected call of KeepAlive. -func (mr *MockV2MockRecorder) KeepAlive(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) KeepAlive(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, "KeepAlive", reflect.TypeOf((*MockV2)(nil).KeepAlive), varargs...) } // ListApplications mocks base method. func (m *MockV2) ListApplications(arg0 context.Context, arg1 *manager.ListApplicationsRequest, arg2 ...grpc.CallOption) (*manager.ListApplicationsResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -160,16 +164,16 @@ func (m *MockV2) ListApplications(arg0 context.Context, arg1 *manager.ListApplic } // ListApplications indicates an expected call of ListApplications. -func (mr *MockV2MockRecorder) ListApplications(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) ListApplications(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, "ListApplications", reflect.TypeOf((*MockV2)(nil).ListApplications), varargs...) } // ListBuckets mocks base method. func (m *MockV2) ListBuckets(arg0 context.Context, arg1 *manager.ListBucketsRequest, arg2 ...grpc.CallOption) (*manager.ListBucketsResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -180,16 +184,16 @@ func (m *MockV2) ListBuckets(arg0 context.Context, arg1 *manager.ListBucketsRequ } // ListBuckets indicates an expected call of ListBuckets. -func (mr *MockV2MockRecorder) ListBuckets(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) ListBuckets(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, "ListBuckets", reflect.TypeOf((*MockV2)(nil).ListBuckets), varargs...) } // ListSchedulers mocks base method. func (m *MockV2) ListSchedulers(arg0 context.Context, arg1 *manager.ListSchedulersRequest, arg2 ...grpc.CallOption) (*manager.ListSchedulersResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -200,16 +204,16 @@ func (m *MockV2) ListSchedulers(arg0 context.Context, arg1 *manager.ListSchedule } // ListSchedulers indicates an expected call of ListSchedulers. -func (mr *MockV2MockRecorder) ListSchedulers(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) ListSchedulers(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, "ListSchedulers", reflect.TypeOf((*MockV2)(nil).ListSchedulers), varargs...) } // UpdateScheduler mocks base method. func (m *MockV2) UpdateScheduler(arg0 context.Context, arg1 *manager.UpdateSchedulerRequest, arg2 ...grpc.CallOption) (*manager.Scheduler, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -220,16 +224,16 @@ func (m *MockV2) UpdateScheduler(arg0 context.Context, arg1 *manager.UpdateSched } // UpdateScheduler indicates an expected call of UpdateScheduler. -func (mr *MockV2MockRecorder) UpdateScheduler(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) UpdateScheduler(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, "UpdateScheduler", reflect.TypeOf((*MockV2)(nil).UpdateScheduler), varargs...) } // UpdateSeedPeer mocks base method. func (m *MockV2) UpdateSeedPeer(arg0 context.Context, arg1 *manager.UpdateSeedPeerRequest, arg2 ...grpc.CallOption) (*manager.SeedPeer, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -240,8 +244,8 @@ func (m *MockV2) UpdateSeedPeer(arg0 context.Context, arg1 *manager.UpdateSeedPe } // UpdateSeedPeer indicates an expected call of UpdateSeedPeer. -func (mr *MockV2MockRecorder) UpdateSeedPeer(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) UpdateSeedPeer(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, "UpdateSeedPeer", reflect.TypeOf((*MockV2)(nil).UpdateSeedPeer), varargs...) } diff --git a/pkg/rpc/scheduler/client/mocks/client_v1_mock.go b/pkg/rpc/scheduler/client/mocks/client_v1_mock.go index 1ec27295b9d..2ddd4cad514 100644 --- a/pkg/rpc/scheduler/client/mocks/client_v1_mock.go +++ b/pkg/rpc/scheduler/client/mocks/client_v1_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: client_v1.go - +// +// Generated by this command: +// +// mockgen -destination mocks/client_v1_mock.go -source client_v1.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -9,7 +13,7 @@ import ( reflect "reflect" scheduler "d7y.io/api/v2/pkg/apis/scheduler/v1" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" ) @@ -39,7 +43,7 @@ func (m *MockV1) EXPECT() *MockV1MockRecorder { // AnnounceHost mocks base method. func (m *MockV1) AnnounceHost(arg0 context.Context, arg1 *scheduler.AnnounceHostRequest, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -49,16 +53,16 @@ func (m *MockV1) AnnounceHost(arg0 context.Context, arg1 *scheduler.AnnounceHost } // AnnounceHost indicates an expected call of AnnounceHost. -func (mr *MockV1MockRecorder) AnnounceHost(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) AnnounceHost(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, "AnnounceHost", reflect.TypeOf((*MockV1)(nil).AnnounceHost), varargs...) } // AnnounceTask mocks base method. func (m *MockV1) AnnounceTask(arg0 context.Context, arg1 *scheduler.AnnounceTaskRequest, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -68,9 +72,9 @@ func (m *MockV1) AnnounceTask(arg0 context.Context, arg1 *scheduler.AnnounceTask } // AnnounceTask indicates an expected call of AnnounceTask. -func (mr *MockV1MockRecorder) AnnounceTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) AnnounceTask(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, "AnnounceTask", reflect.TypeOf((*MockV1)(nil).AnnounceTask), varargs...) } @@ -91,7 +95,7 @@ func (mr *MockV1MockRecorder) Close() *gomock.Call { // LeaveHost mocks base method. func (m *MockV1) LeaveHost(arg0 context.Context, arg1 *scheduler.LeaveHostRequest, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -101,16 +105,16 @@ func (m *MockV1) LeaveHost(arg0 context.Context, arg1 *scheduler.LeaveHostReques } // LeaveHost indicates an expected call of LeaveHost. -func (mr *MockV1MockRecorder) LeaveHost(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) LeaveHost(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, "LeaveHost", reflect.TypeOf((*MockV1)(nil).LeaveHost), varargs...) } // LeaveTask mocks base method. func (m *MockV1) LeaveTask(arg0 context.Context, arg1 *scheduler.PeerTarget, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -120,16 +124,16 @@ func (m *MockV1) LeaveTask(arg0 context.Context, arg1 *scheduler.PeerTarget, arg } // LeaveTask indicates an expected call of LeaveTask. -func (mr *MockV1MockRecorder) LeaveTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) LeaveTask(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, "LeaveTask", reflect.TypeOf((*MockV1)(nil).LeaveTask), varargs...) } // RegisterPeerTask mocks base method. func (m *MockV1) RegisterPeerTask(arg0 context.Context, arg1 *scheduler.PeerTaskRequest, arg2 ...grpc.CallOption) (*scheduler.RegisterResult, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -140,16 +144,16 @@ func (m *MockV1) RegisterPeerTask(arg0 context.Context, arg1 *scheduler.PeerTask } // RegisterPeerTask indicates an expected call of RegisterPeerTask. -func (mr *MockV1MockRecorder) RegisterPeerTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) RegisterPeerTask(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, "RegisterPeerTask", reflect.TypeOf((*MockV1)(nil).RegisterPeerTask), varargs...) } // ReportPeerResult mocks base method. func (m *MockV1) ReportPeerResult(arg0 context.Context, arg1 *scheduler.PeerResult, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -159,16 +163,16 @@ func (m *MockV1) ReportPeerResult(arg0 context.Context, arg1 *scheduler.PeerResu } // ReportPeerResult indicates an expected call of ReportPeerResult. -func (mr *MockV1MockRecorder) ReportPeerResult(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) ReportPeerResult(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, "ReportPeerResult", reflect.TypeOf((*MockV1)(nil).ReportPeerResult), varargs...) } // ReportPieceResult mocks base method. func (m *MockV1) ReportPieceResult(arg0 context.Context, arg1 *scheduler.PeerTaskRequest, arg2 ...grpc.CallOption) (scheduler.Scheduler_ReportPieceResultClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -179,16 +183,16 @@ func (m *MockV1) ReportPieceResult(arg0 context.Context, arg1 *scheduler.PeerTas } // ReportPieceResult indicates an expected call of ReportPieceResult. -func (mr *MockV1MockRecorder) ReportPieceResult(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) ReportPieceResult(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, "ReportPieceResult", reflect.TypeOf((*MockV1)(nil).ReportPieceResult), varargs...) } // StatTask mocks base method. func (m *MockV1) StatTask(arg0 context.Context, arg1 *scheduler.StatTaskRequest, arg2 ...grpc.CallOption) (*scheduler.Task, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -199,16 +203,16 @@ func (m *MockV1) StatTask(arg0 context.Context, arg1 *scheduler.StatTaskRequest, } // StatTask indicates an expected call of StatTask. -func (mr *MockV1MockRecorder) StatTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) StatTask(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, "StatTask", reflect.TypeOf((*MockV1)(nil).StatTask), varargs...) } // SyncProbes mocks base method. func (m *MockV1) SyncProbes(arg0 context.Context, arg1 *scheduler.SyncProbesRequest, arg2 ...grpc.CallOption) (scheduler.Scheduler_SyncProbesClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -219,8 +223,8 @@ func (m *MockV1) SyncProbes(arg0 context.Context, arg1 *scheduler.SyncProbesRequ } // SyncProbes indicates an expected call of SyncProbes. -func (mr *MockV1MockRecorder) SyncProbes(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) SyncProbes(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, "SyncProbes", reflect.TypeOf((*MockV1)(nil).SyncProbes), varargs...) } diff --git a/pkg/rpc/scheduler/client/mocks/client_v2_mock.go b/pkg/rpc/scheduler/client/mocks/client_v2_mock.go index 137bff5695d..0f85d6a2980 100644 --- a/pkg/rpc/scheduler/client/mocks/client_v2_mock.go +++ b/pkg/rpc/scheduler/client/mocks/client_v2_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: client_v2.go - +// +// Generated by this command: +// +// mockgen -destination mocks/client_v2_mock.go -source client_v2.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -10,7 +14,7 @@ import ( common "d7y.io/api/v2/pkg/apis/common/v2" scheduler "d7y.io/api/v2/pkg/apis/scheduler/v2" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" ) @@ -40,7 +44,7 @@ func (m *MockV2) EXPECT() *MockV2MockRecorder { // AnnounceHost mocks base method. func (m *MockV2) AnnounceHost(arg0 context.Context, arg1 *scheduler.AnnounceHostRequest, arg2 ...grpc.CallOption) 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 *MockV2) AnnounceHost(arg0 context.Context, arg1 *scheduler.AnnounceHost } // AnnounceHost indicates an expected call of AnnounceHost. -func (mr *MockV2MockRecorder) AnnounceHost(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) AnnounceHost(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, "AnnounceHost", reflect.TypeOf((*MockV2)(nil).AnnounceHost), varargs...) } // AnnouncePeer mocks base method. func (m *MockV2) AnnouncePeer(arg0 context.Context, arg1 string, arg2 ...grpc.CallOption) (scheduler.Scheduler_AnnouncePeerClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -70,9 +74,9 @@ func (m *MockV2) AnnouncePeer(arg0 context.Context, arg1 string, arg2 ...grpc.Ca } // AnnouncePeer indicates an expected call of AnnouncePeer. -func (mr *MockV2MockRecorder) AnnouncePeer(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) AnnouncePeer(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, "AnnouncePeer", reflect.TypeOf((*MockV2)(nil).AnnouncePeer), varargs...) } @@ -93,7 +97,7 @@ func (mr *MockV2MockRecorder) Close() *gomock.Call { // ExchangePeer mocks base method. func (m *MockV2) ExchangePeer(arg0 context.Context, arg1 *scheduler.ExchangePeerRequest, arg2 ...grpc.CallOption) (*scheduler.ExchangePeerResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -104,16 +108,16 @@ func (m *MockV2) ExchangePeer(arg0 context.Context, arg1 *scheduler.ExchangePeer } // ExchangePeer indicates an expected call of ExchangePeer. -func (mr *MockV2MockRecorder) ExchangePeer(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) ExchangePeer(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, "ExchangePeer", reflect.TypeOf((*MockV2)(nil).ExchangePeer), varargs...) } // LeaveHost mocks base method. func (m *MockV2) LeaveHost(arg0 context.Context, arg1 *scheduler.LeaveHostRequest, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -123,16 +127,16 @@ func (m *MockV2) LeaveHost(arg0 context.Context, arg1 *scheduler.LeaveHostReques } // LeaveHost indicates an expected call of LeaveHost. -func (mr *MockV2MockRecorder) LeaveHost(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) LeaveHost(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, "LeaveHost", reflect.TypeOf((*MockV2)(nil).LeaveHost), varargs...) } // LeavePeer mocks base method. func (m *MockV2) LeavePeer(arg0 context.Context, arg1 *scheduler.LeavePeerRequest, arg2 ...grpc.CallOption) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -142,16 +146,16 @@ func (m *MockV2) LeavePeer(arg0 context.Context, arg1 *scheduler.LeavePeerReques } // LeavePeer indicates an expected call of LeavePeer. -func (mr *MockV2MockRecorder) LeavePeer(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) LeavePeer(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, "LeavePeer", reflect.TypeOf((*MockV2)(nil).LeavePeer), varargs...) } // StatPeer mocks base method. func (m *MockV2) StatPeer(arg0 context.Context, arg1 *scheduler.StatPeerRequest, arg2 ...grpc.CallOption) (*common.Peer, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -162,16 +166,16 @@ func (m *MockV2) StatPeer(arg0 context.Context, arg1 *scheduler.StatPeerRequest, } // StatPeer indicates an expected call of StatPeer. -func (mr *MockV2MockRecorder) StatPeer(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) StatPeer(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, "StatPeer", reflect.TypeOf((*MockV2)(nil).StatPeer), varargs...) } // StatTask mocks base method. func (m *MockV2) StatTask(arg0 context.Context, arg1 *scheduler.StatTaskRequest, arg2 ...grpc.CallOption) (*common.Task, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -182,16 +186,16 @@ func (m *MockV2) StatTask(arg0 context.Context, arg1 *scheduler.StatTaskRequest, } // StatTask indicates an expected call of StatTask. -func (mr *MockV2MockRecorder) StatTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) StatTask(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, "StatTask", reflect.TypeOf((*MockV2)(nil).StatTask), varargs...) } // SyncProbes mocks base method. func (m *MockV2) SyncProbes(arg0 context.Context, arg1 *scheduler.SyncProbesRequest, arg2 ...grpc.CallOption) (scheduler.Scheduler_SyncProbesClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -202,8 +206,8 @@ func (m *MockV2) SyncProbes(arg0 context.Context, arg1 *scheduler.SyncProbesRequ } // SyncProbes indicates an expected call of SyncProbes. -func (mr *MockV2MockRecorder) SyncProbes(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV2MockRecorder) SyncProbes(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, "SyncProbes", reflect.TypeOf((*MockV2)(nil).SyncProbes), varargs...) } diff --git a/pkg/rpc/security/client/mocks/client_v1_mock.go b/pkg/rpc/security/client/mocks/client_v1_mock.go index 0f7f6cbca89..1f2b46a8d33 100644 --- a/pkg/rpc/security/client/mocks/client_v1_mock.go +++ b/pkg/rpc/security/client/mocks/client_v1_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: client_v1.go - +// +// Generated by this command: +// +// mockgen -destination mocks/client_v1_mock.go -source client_v1.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -9,7 +13,7 @@ import ( reflect "reflect" security "d7y.io/api/v2/pkg/apis/security/v1" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" ) @@ -53,7 +57,7 @@ func (mr *MockV1MockRecorder) Close() *gomock.Call { // IssueCertificate mocks base method. func (m *MockV1) IssueCertificate(arg0 context.Context, arg1 *security.CertificateRequest, arg2 ...grpc.CallOption) (*security.CertificateResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -64,8 +68,8 @@ func (m *MockV1) IssueCertificate(arg0 context.Context, arg1 *security.Certifica } // IssueCertificate indicates an expected call of IssueCertificate. -func (mr *MockV1MockRecorder) IssueCertificate(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) IssueCertificate(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, "IssueCertificate", reflect.TypeOf((*MockV1)(nil).IssueCertificate), varargs...) } diff --git a/pkg/rpc/trainer/client/mocks/client_v1_mock.go b/pkg/rpc/trainer/client/mocks/client_v1_mock.go index cdf903f69b2..956d7183365 100644 --- a/pkg/rpc/trainer/client/mocks/client_v1_mock.go +++ b/pkg/rpc/trainer/client/mocks/client_v1_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: client_v1.go - +// +// Generated by this command: +// +// mockgen -destination mocks/client_v1_mock.go -source client_v1.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -9,7 +13,7 @@ import ( reflect "reflect" trainer "d7y.io/api/v2/pkg/apis/trainer/v1" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" ) @@ -53,7 +57,7 @@ func (mr *MockV1MockRecorder) Close() *gomock.Call { // Train mocks base method. func (m *MockV1) Train(arg0 context.Context, arg1 ...grpc.CallOption) (trainer.Trainer_TrainClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -64,8 +68,8 @@ func (m *MockV1) Train(arg0 context.Context, arg1 ...grpc.CallOption) (trainer.T } // Train indicates an expected call of Train. -func (mr *MockV1MockRecorder) Train(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockV1MockRecorder) Train(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, "Train", reflect.TypeOf((*MockV1)(nil).Train), varargs...) } diff --git a/pkg/source/mocks/mock_source_client.go b/pkg/source/mocks/mock_source_client.go index b2a7d888cfa..774ddb2c3ae 100644 --- a/pkg/source/mocks/mock_source_client.go +++ b/pkg/source/mocks/mock_source_client.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: source_client.go - +// +// Generated by this command: +// +// mockgen -destination mocks/mock_source_client.go -source source_client.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -8,7 +12,7 @@ import ( reflect "reflect" source "d7y.io/dragonfly/v2/pkg/source" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockResourceClient is a mock of ResourceClient interface. @@ -44,7 +48,7 @@ func (m *MockResourceClient) Download(request *source.Request) (*source.Response } // Download indicates an expected call of Download. -func (mr *MockResourceClientMockRecorder) Download(request interface{}) *gomock.Call { +func (mr *MockResourceClientMockRecorder) Download(request any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Download", reflect.TypeOf((*MockResourceClient)(nil).Download), request) } @@ -59,7 +63,7 @@ func (m *MockResourceClient) GetContentLength(request *source.Request) (int64, e } // GetContentLength indicates an expected call of GetContentLength. -func (mr *MockResourceClientMockRecorder) GetContentLength(request interface{}) *gomock.Call { +func (mr *MockResourceClientMockRecorder) GetContentLength(request any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContentLength", reflect.TypeOf((*MockResourceClient)(nil).GetContentLength), request) } @@ -74,7 +78,7 @@ func (m *MockResourceClient) GetLastModified(request *source.Request) (int64, er } // GetLastModified indicates an expected call of GetLastModified. -func (mr *MockResourceClientMockRecorder) GetLastModified(request interface{}) *gomock.Call { +func (mr *MockResourceClientMockRecorder) GetLastModified(request any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLastModified", reflect.TypeOf((*MockResourceClient)(nil).GetLastModified), request) } @@ -89,7 +93,7 @@ func (m *MockResourceClient) IsExpired(request *source.Request, info *source.Exp } // IsExpired indicates an expected call of IsExpired. -func (mr *MockResourceClientMockRecorder) IsExpired(request, info interface{}) *gomock.Call { +func (mr *MockResourceClientMockRecorder) IsExpired(request, info any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsExpired", reflect.TypeOf((*MockResourceClient)(nil).IsExpired), request, info) } @@ -104,7 +108,7 @@ func (m *MockResourceClient) IsSupportRange(request *source.Request) (bool, erro } // IsSupportRange indicates an expected call of IsSupportRange. -func (mr *MockResourceClientMockRecorder) IsSupportRange(request interface{}) *gomock.Call { +func (mr *MockResourceClientMockRecorder) IsSupportRange(request any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsSupportRange", reflect.TypeOf((*MockResourceClient)(nil).IsSupportRange), request) } @@ -142,7 +146,7 @@ func (m *MockResourceMetadataGetter) GetMetadata(request *source.Request) (*sour } // GetMetadata indicates an expected call of GetMetadata. -func (mr *MockResourceMetadataGetterMockRecorder) GetMetadata(request interface{}) *gomock.Call { +func (mr *MockResourceMetadataGetterMockRecorder) GetMetadata(request any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetadata", reflect.TypeOf((*MockResourceMetadataGetter)(nil).GetMetadata), request) } @@ -180,7 +184,7 @@ func (m *MockResourceLister) List(request *source.Request) ([]source.URLEntry, e } // List indicates an expected call of List. -func (mr *MockResourceListerMockRecorder) List(request interface{}) *gomock.Call { +func (mr *MockResourceListerMockRecorder) List(request any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockResourceLister)(nil).List), request) } @@ -211,7 +215,7 @@ func (m *MockClientManager) EXPECT() *MockClientManagerMockRecorder { // GetClient mocks base method. func (m *MockClientManager) GetClient(scheme string, options ...source.Option) (source.ResourceClient, bool) { m.ctrl.T.Helper() - varargs := []interface{}{scheme} + varargs := []any{scheme} for _, a := range options { varargs = append(varargs, a) } @@ -222,9 +226,9 @@ func (m *MockClientManager) GetClient(scheme string, options ...source.Option) ( } // GetClient indicates an expected call of GetClient. -func (mr *MockClientManagerMockRecorder) GetClient(scheme interface{}, options ...interface{}) *gomock.Call { +func (mr *MockClientManagerMockRecorder) GetClient(scheme any, options ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{scheme}, options...) + varargs := append([]any{scheme}, options...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClient", reflect.TypeOf((*MockClientManager)(nil).GetClient), varargs...) } @@ -245,7 +249,7 @@ func (mr *MockClientManagerMockRecorder) ListClients() *gomock.Call { // Register mocks base method. func (m *MockClientManager) Register(scheme string, resourceClient source.ResourceClient, adapter source.RequestAdapter, hook ...source.Hook) error { m.ctrl.T.Helper() - varargs := []interface{}{scheme, resourceClient, adapter} + varargs := []any{scheme, resourceClient, adapter} for _, a := range hook { varargs = append(varargs, a) } @@ -255,9 +259,9 @@ func (m *MockClientManager) Register(scheme string, resourceClient source.Resour } // Register indicates an expected call of Register. -func (mr *MockClientManagerMockRecorder) Register(scheme, resourceClient, adapter interface{}, hook ...interface{}) *gomock.Call { +func (mr *MockClientManagerMockRecorder) Register(scheme, resourceClient, adapter any, hook ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{scheme, resourceClient, adapter}, hook...) + varargs := append([]any{scheme, resourceClient, adapter}, hook...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Register", reflect.TypeOf((*MockClientManager)(nil).Register), varargs...) } @@ -268,7 +272,7 @@ func (m *MockClientManager) UnRegister(scheme string) { } // UnRegister indicates an expected call of UnRegister. -func (mr *MockClientManagerMockRecorder) UnRegister(scheme interface{}) *gomock.Call { +func (mr *MockClientManagerMockRecorder) UnRegister(scheme any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnRegister", reflect.TypeOf((*MockClientManager)(nil).UnRegister), scheme) } @@ -305,7 +309,7 @@ func (m *MockHook) AfterResponse(response *source.Response) error { } // AfterResponse indicates an expected call of AfterResponse. -func (mr *MockHookMockRecorder) AfterResponse(response interface{}) *gomock.Call { +func (mr *MockHookMockRecorder) AfterResponse(response any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterResponse", reflect.TypeOf((*MockHook)(nil).AfterResponse), response) } @@ -319,7 +323,7 @@ func (m *MockHook) BeforeRequest(request *source.Request) error { } // BeforeRequest indicates an expected call of BeforeRequest. -func (mr *MockHookMockRecorder) BeforeRequest(request interface{}) *gomock.Call { +func (mr *MockHookMockRecorder) BeforeRequest(request any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeforeRequest", reflect.TypeOf((*MockHook)(nil).BeforeRequest), request) } diff --git a/pkg/source/request_fixture.go b/pkg/source/request_fixture.go index 5c90a9a8276..b833cd23ede 100644 --- a/pkg/source/request_fixture.go +++ b/pkg/source/request_fixture.go @@ -19,7 +19,7 @@ package source import ( "fmt" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) // RequestEq for gomock diff --git a/scheduler/announcer/announcer_test.go b/scheduler/announcer/announcer_test.go index 6975d3847c8..21fb4d8e7fb 100644 --- a/scheduler/announcer/announcer_test.go +++ b/scheduler/announcer/announcer_test.go @@ -25,8 +25,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" managerv2 "d7y.io/api/v2/pkg/apis/manager/v2" trainerv1 "d7y.io/api/v2/pkg/apis/trainer/v1" diff --git a/scheduler/announcer/mocks/announcer_mock.go b/scheduler/announcer/mocks/announcer_mock.go index b7b5f05d1e7..b6ed72cb26f 100644 --- a/scheduler/announcer/mocks/announcer_mock.go +++ b/scheduler/announcer/mocks/announcer_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: announcer.go - +// +// Generated by this command: +// +// mockgen -destination mocks/announcer_mock.go -source announcer.go -package mocks +// // Package mocks is a generated GoMock package. package mocks import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockAnnouncer is a mock of Announcer interface. diff --git a/scheduler/config/dynconfig_test.go b/scheduler/config/dynconfig_test.go index ab22d615e15..e14b90a6216 100644 --- a/scheduler/config/dynconfig_test.go +++ b/scheduler/config/dynconfig_test.go @@ -23,8 +23,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" commonv2 "d7y.io/api/v2/pkg/apis/common/v2" managerv2 "d7y.io/api/v2/pkg/apis/manager/v2" diff --git a/scheduler/config/mocks/dynconfig_mock.go b/scheduler/config/mocks/dynconfig_mock.go index 78272744bbc..9b5bd03c63a 100644 --- a/scheduler/config/mocks/dynconfig_mock.go +++ b/scheduler/config/mocks/dynconfig_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: dynconfig.go - +// +// Generated by this command: +// +// mockgen -destination mocks/dynconfig_mock.go -source dynconfig.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -10,7 +14,7 @@ import ( manager "d7y.io/api/v2/pkg/apis/manager/v2" types "d7y.io/dragonfly/v2/manager/types" config "d7y.io/dragonfly/v2/scheduler/config" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" resolver "google.golang.org/grpc/resolver" ) @@ -44,7 +48,7 @@ func (m *MockDynconfigInterface) Deregister(arg0 config.Observer) { } // Deregister indicates an expected call of Deregister. -func (mr *MockDynconfigInterfaceMockRecorder) Deregister(arg0 interface{}) *gomock.Call { +func (mr *MockDynconfigInterfaceMockRecorder) Deregister(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Deregister", reflect.TypeOf((*MockDynconfigInterface)(nil).Deregister), arg0) } @@ -204,7 +208,7 @@ func (m *MockDynconfigInterface) Register(arg0 config.Observer) { } // Register indicates an expected call of Register. -func (mr *MockDynconfigInterfaceMockRecorder) Register(arg0 interface{}) *gomock.Call { +func (mr *MockDynconfigInterfaceMockRecorder) Register(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Register", reflect.TypeOf((*MockDynconfigInterface)(nil).Register), arg0) } @@ -267,7 +271,7 @@ func (m *MockObserver) OnNotify(arg0 *config.DynconfigData) { } // OnNotify indicates an expected call of OnNotify. -func (mr *MockObserverMockRecorder) OnNotify(arg0 interface{}) *gomock.Call { +func (mr *MockObserverMockRecorder) OnNotify(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnNotify", reflect.TypeOf((*MockObserver)(nil).OnNotify), arg0) } diff --git a/scheduler/job/job.go b/scheduler/job/job.go index 74dc2e41a32..7f2071f5ae8 100644 --- a/scheduler/job/job.go +++ b/scheduler/job/job.go @@ -21,6 +21,7 @@ package job import ( "context" "errors" + "fmt" "strings" "time" @@ -152,8 +153,14 @@ func (j *job) preheat(ctx context.Context, req string) error { ctx, cancel := context.WithTimeout(ctx, preheatTimeout) defer cancel() + // If seed peer is disabled, return error. if !j.config.SeedPeer.Enable { - return errors.New("scheduler has disabled seed peer") + return fmt.Errorf("cluster %d scheduler %s has disabled seed peer", j.config.Manager.SchedulerClusterID, j.config.Server.AdvertiseIP) + } + + // If scheduler has no available seed peer, return error. + if len(j.resource.SeedPeer().Client().Addrs()) == 0 { + return fmt.Errorf("cluster %d scheduler %s has no available seed peer", j.config.Manager.SchedulerClusterID, j.config.Server.AdvertiseIP) } preheat := &internaljob.PreheatRequest{} diff --git a/scheduler/job/mocks/job_mock.go b/scheduler/job/mocks/job_mock.go index 9c8befc2d2b..7897b1e6147 100644 --- a/scheduler/job/mocks/job_mock.go +++ b/scheduler/job/mocks/job_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: job.go - +// +// Generated by this command: +// +// mockgen -destination mocks/job_mock.go -source job.go -package mocks +// // Package mocks is a generated GoMock package. package mocks import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockJob is a mock of Job interface. diff --git a/scheduler/networktopology/mocks/network_topology_mock.go b/scheduler/networktopology/mocks/network_topology_mock.go index 97dce985026..4fafe111617 100644 --- a/scheduler/networktopology/mocks/network_topology_mock.go +++ b/scheduler/networktopology/mocks/network_topology_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: network_topology.go - +// +// Generated by this command: +// +// mockgen -destination mocks/network_topology_mock.go -source network_topology.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -9,7 +13,7 @@ import ( networktopology "d7y.io/dragonfly/v2/scheduler/networktopology" resource "d7y.io/dragonfly/v2/scheduler/resource" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockNetworkTopology is a mock of NetworkTopology interface. @@ -44,7 +48,7 @@ func (m *MockNetworkTopology) DeleteHost(arg0 string) error { } // DeleteHost indicates an expected call of DeleteHost. -func (mr *MockNetworkTopologyMockRecorder) DeleteHost(arg0 interface{}) *gomock.Call { +func (mr *MockNetworkTopologyMockRecorder) DeleteHost(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteHost", reflect.TypeOf((*MockNetworkTopology)(nil).DeleteHost), arg0) } @@ -59,7 +63,7 @@ func (m *MockNetworkTopology) FindProbedHosts(arg0 string) ([]*resource.Host, er } // FindProbedHosts indicates an expected call of FindProbedHosts. -func (mr *MockNetworkTopologyMockRecorder) FindProbedHosts(arg0 interface{}) *gomock.Call { +func (mr *MockNetworkTopologyMockRecorder) FindProbedHosts(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindProbedHosts", reflect.TypeOf((*MockNetworkTopology)(nil).FindProbedHosts), arg0) } @@ -73,7 +77,7 @@ func (m *MockNetworkTopology) Has(arg0, arg1 string) bool { } // Has indicates an expected call of Has. -func (mr *MockNetworkTopologyMockRecorder) Has(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockNetworkTopologyMockRecorder) Has(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockNetworkTopology)(nil).Has), arg0, arg1) } @@ -88,7 +92,7 @@ func (m *MockNetworkTopology) ProbedCount(arg0 string) (uint64, error) { } // ProbedCount indicates an expected call of ProbedCount. -func (mr *MockNetworkTopologyMockRecorder) ProbedCount(arg0 interface{}) *gomock.Call { +func (mr *MockNetworkTopologyMockRecorder) ProbedCount(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProbedCount", reflect.TypeOf((*MockNetworkTopology)(nil).ProbedCount), arg0) } @@ -102,7 +106,7 @@ func (m *MockNetworkTopology) Probes(arg0, arg1 string) networktopology.Probes { } // Probes indicates an expected call of Probes. -func (mr *MockNetworkTopologyMockRecorder) Probes(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockNetworkTopologyMockRecorder) Probes(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Probes", reflect.TypeOf((*MockNetworkTopology)(nil).Probes), arg0, arg1) } @@ -154,7 +158,7 @@ func (m *MockNetworkTopology) Store(arg0, arg1 string) error { } // Store indicates an expected call of Store. -func (mr *MockNetworkTopologyMockRecorder) Store(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockNetworkTopologyMockRecorder) Store(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Store", reflect.TypeOf((*MockNetworkTopology)(nil).Store), arg0, arg1) } diff --git a/scheduler/networktopology/mocks/probes_mock.go b/scheduler/networktopology/mocks/probes_mock.go index a9d3d108cb7..f4ac3e585e9 100644 --- a/scheduler/networktopology/mocks/probes_mock.go +++ b/scheduler/networktopology/mocks/probes_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: probes.go - +// +// Generated by this command: +// +// mockgen -destination mocks/probes_mock.go -source probes.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -9,7 +13,7 @@ import ( time "time" networktopology "d7y.io/dragonfly/v2/scheduler/networktopology" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockProbes is a mock of Probes interface. @@ -74,7 +78,7 @@ func (m *MockProbes) Enqueue(arg0 *networktopology.Probe) error { } // Enqueue indicates an expected call of Enqueue. -func (mr *MockProbesMockRecorder) Enqueue(arg0 interface{}) *gomock.Call { +func (mr *MockProbesMockRecorder) Enqueue(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enqueue", reflect.TypeOf((*MockProbes)(nil).Enqueue), arg0) } diff --git a/scheduler/networktopology/network_topology_test.go b/scheduler/networktopology/network_topology_test.go index 8d2ae9320c5..1f4a3bd37c2 100644 --- a/scheduler/networktopology/network_topology_test.go +++ b/scheduler/networktopology/network_topology_test.go @@ -25,8 +25,8 @@ import ( "time" "github.com/go-redis/redismock/v8" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "d7y.io/dragonfly/v2/pkg/container/set" pkgredis "d7y.io/dragonfly/v2/pkg/redis" diff --git a/scheduler/networktopology/probes_test.go b/scheduler/networktopology/probes_test.go index 005a3dd7bad..a5ffa074763 100644 --- a/scheduler/networktopology/probes_test.go +++ b/scheduler/networktopology/probes_test.go @@ -25,9 +25,9 @@ import ( "time" "github.com/go-redis/redismock/v8" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "go.uber.org/atomic" + "go.uber.org/mock/gomock" "d7y.io/dragonfly/v2/pkg/idgen" pkgredis "d7y.io/dragonfly/v2/pkg/redis" diff --git a/scheduler/resource/host_manager_mock.go b/scheduler/resource/host_manager_mock.go index a22a8b05c3a..87583e3b8fc 100644 --- a/scheduler/resource/host_manager_mock.go +++ b/scheduler/resource/host_manager_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: host_manager.go - +// +// Generated by this command: +// +// mockgen -destination host_manager_mock.go -source host_manager.go -package resource +// // Package resource is a generated GoMock package. package resource @@ -8,7 +12,7 @@ import ( reflect "reflect" set "d7y.io/dragonfly/v2/pkg/container/set" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockHostManager is a mock of HostManager interface. @@ -41,7 +45,7 @@ func (m *MockHostManager) Delete(arg0 string) { } // Delete indicates an expected call of Delete. -func (mr *MockHostManagerMockRecorder) Delete(arg0 interface{}) *gomock.Call { +func (mr *MockHostManagerMockRecorder) Delete(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockHostManager)(nil).Delete), arg0) } @@ -56,7 +60,7 @@ func (m *MockHostManager) Load(arg0 string) (*Host, bool) { } // Load indicates an expected call of Load. -func (mr *MockHostManagerMockRecorder) Load(arg0 interface{}) *gomock.Call { +func (mr *MockHostManagerMockRecorder) Load(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Load", reflect.TypeOf((*MockHostManager)(nil).Load), arg0) } @@ -71,7 +75,7 @@ func (m *MockHostManager) LoadOrStore(arg0 *Host) (*Host, bool) { } // LoadOrStore indicates an expected call of LoadOrStore. -func (mr *MockHostManagerMockRecorder) LoadOrStore(arg0 interface{}) *gomock.Call { +func (mr *MockHostManagerMockRecorder) LoadOrStore(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadOrStore", reflect.TypeOf((*MockHostManager)(nil).LoadOrStore), arg0) } @@ -85,7 +89,7 @@ func (m *MockHostManager) LoadRandomHosts(arg0 int, arg1 set.SafeSet[string]) [] } // LoadRandomHosts indicates an expected call of LoadRandomHosts. -func (mr *MockHostManagerMockRecorder) LoadRandomHosts(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockHostManagerMockRecorder) LoadRandomHosts(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadRandomHosts", reflect.TypeOf((*MockHostManager)(nil).LoadRandomHosts), arg0, arg1) } @@ -97,7 +101,7 @@ func (m *MockHostManager) Range(f func(any, any) bool) { } // Range indicates an expected call of Range. -func (mr *MockHostManagerMockRecorder) Range(f interface{}) *gomock.Call { +func (mr *MockHostManagerMockRecorder) Range(f any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Range", reflect.TypeOf((*MockHostManager)(nil).Range), f) } @@ -123,7 +127,7 @@ func (m *MockHostManager) Store(arg0 *Host) { } // Store indicates an expected call of Store. -func (mr *MockHostManagerMockRecorder) Store(arg0 interface{}) *gomock.Call { +func (mr *MockHostManagerMockRecorder) Store(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Store", reflect.TypeOf((*MockHostManager)(nil).Store), arg0) } diff --git a/scheduler/resource/host_manager_test.go b/scheduler/resource/host_manager_test.go index 19085dba562..7a147ac83db 100644 --- a/scheduler/resource/host_manager_test.go +++ b/scheduler/resource/host_manager_test.go @@ -22,8 +22,8 @@ import ( "testing" "time" - gomock "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + gomock "go.uber.org/mock/gomock" commonv2 "d7y.io/api/v2/pkg/apis/common/v2" diff --git a/scheduler/resource/peer_manager_mock.go b/scheduler/resource/peer_manager_mock.go index 568670b7c1e..16c3cd75843 100644 --- a/scheduler/resource/peer_manager_mock.go +++ b/scheduler/resource/peer_manager_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: peer_manager.go - +// +// Generated by this command: +// +// mockgen -destination peer_manager_mock.go -source peer_manager.go -package resource +// // Package resource is a generated GoMock package. package resource import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockPeerManager is a mock of PeerManager interface. @@ -40,7 +44,7 @@ func (m *MockPeerManager) Delete(arg0 string) { } // Delete indicates an expected call of Delete. -func (mr *MockPeerManagerMockRecorder) Delete(arg0 interface{}) *gomock.Call { +func (mr *MockPeerManagerMockRecorder) Delete(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockPeerManager)(nil).Delete), arg0) } @@ -55,7 +59,7 @@ func (m *MockPeerManager) Load(arg0 string) (*Peer, bool) { } // Load indicates an expected call of Load. -func (mr *MockPeerManagerMockRecorder) Load(arg0 interface{}) *gomock.Call { +func (mr *MockPeerManagerMockRecorder) Load(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Load", reflect.TypeOf((*MockPeerManager)(nil).Load), arg0) } @@ -70,7 +74,7 @@ func (m *MockPeerManager) LoadOrStore(arg0 *Peer) (*Peer, bool) { } // LoadOrStore indicates an expected call of LoadOrStore. -func (mr *MockPeerManagerMockRecorder) LoadOrStore(arg0 interface{}) *gomock.Call { +func (mr *MockPeerManagerMockRecorder) LoadOrStore(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadOrStore", reflect.TypeOf((*MockPeerManager)(nil).LoadOrStore), arg0) } @@ -82,7 +86,7 @@ func (m *MockPeerManager) Range(f func(any, any) bool) { } // Range indicates an expected call of Range. -func (mr *MockPeerManagerMockRecorder) Range(f interface{}) *gomock.Call { +func (mr *MockPeerManagerMockRecorder) Range(f any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Range", reflect.TypeOf((*MockPeerManager)(nil).Range), f) } @@ -108,7 +112,7 @@ func (m *MockPeerManager) Store(arg0 *Peer) { } // Store indicates an expected call of Store. -func (mr *MockPeerManagerMockRecorder) Store(arg0 interface{}) *gomock.Call { +func (mr *MockPeerManagerMockRecorder) Store(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Store", reflect.TypeOf((*MockPeerManager)(nil).Store), arg0) } diff --git a/scheduler/resource/peer_manager_test.go b/scheduler/resource/peer_manager_test.go index e9cbf12cce4..209691b1784 100644 --- a/scheduler/resource/peer_manager_test.go +++ b/scheduler/resource/peer_manager_test.go @@ -22,8 +22,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" commonv2 "d7y.io/api/v2/pkg/apis/common/v2" diff --git a/scheduler/resource/peer_test.go b/scheduler/resource/peer_test.go index a234d5f3a6f..c46a961151e 100644 --- a/scheduler/resource/peer_test.go +++ b/scheduler/resource/peer_test.go @@ -28,8 +28,8 @@ import ( "time" "github.com/go-http-utils/headers" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" commonv2 "d7y.io/api/v2/pkg/apis/common/v2" managerv2 "d7y.io/api/v2/pkg/apis/manager/v2" diff --git a/scheduler/resource/resource_mock.go b/scheduler/resource/resource_mock.go index 5ecdd642b85..af600f223b9 100644 --- a/scheduler/resource/resource_mock.go +++ b/scheduler/resource/resource_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: resource.go - +// +// Generated by this command: +// +// mockgen -destination resource_mock.go -source resource.go -package resource +// // Package resource is a generated GoMock package. package resource import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockResource is a mock of Resource interface. diff --git a/scheduler/resource/resource_test.go b/scheduler/resource/resource_test.go index 2ac9039ee0f..489cfdff7bc 100644 --- a/scheduler/resource/resource_test.go +++ b/scheduler/resource/resource_test.go @@ -21,8 +21,8 @@ import ( "reflect" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "google.golang.org/grpc/resolver" managerv2 "d7y.io/api/v2/pkg/apis/manager/v2" diff --git a/scheduler/resource/seed_peer_client.go b/scheduler/resource/seed_peer_client.go index 69cdd5ed7a4..89fcf5132eb 100644 --- a/scheduler/resource/seed_peer_client.go +++ b/scheduler/resource/seed_peer_client.go @@ -37,6 +37,9 @@ import ( // SeedPeerClient is the interface used for client of seed peer. type SeedPeerClient interface { + // Addrs returns the addresses of seed peers. + Addrs() []string + // client is seed peer grpc client interface. client.Client diff --git a/scheduler/resource/seed_peer_client_mock.go b/scheduler/resource/seed_peer_client_mock.go index cf8654f10de..117036cea04 100644 --- a/scheduler/resource/seed_peer_client_mock.go +++ b/scheduler/resource/seed_peer_client_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: seed_peer_client.go - +// +// Generated by this command: +// +// mockgen -destination seed_peer_client_mock.go -source seed_peer_client.go -package resource +// // Package resource is a generated GoMock package. package resource @@ -11,7 +15,7 @@ import ( cdnsystem "d7y.io/api/v2/pkg/apis/cdnsystem/v1" common "d7y.io/api/v2/pkg/apis/common/v1" config "d7y.io/dragonfly/v2/scheduler/config" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" ) @@ -38,6 +42,20 @@ func (m *MockSeedPeerClient) EXPECT() *MockSeedPeerClientMockRecorder { return m.recorder } +// Addrs mocks base method. +func (m *MockSeedPeerClient) Addrs() []string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Addrs") + ret0, _ := ret[0].([]string) + return ret0 +} + +// Addrs indicates an expected call of Addrs. +func (mr *MockSeedPeerClientMockRecorder) Addrs() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Addrs", reflect.TypeOf((*MockSeedPeerClient)(nil).Addrs)) +} + // Close mocks base method. func (m *MockSeedPeerClient) Close() error { m.ctrl.T.Helper() @@ -55,7 +73,7 @@ func (mr *MockSeedPeerClientMockRecorder) Close() *gomock.Call { // GetPieceTasks mocks base method. func (m *MockSeedPeerClient) GetPieceTasks(arg0 context.Context, arg1 *common.PieceTaskRequest, arg2 ...grpc.CallOption) (*common.PiecePacket, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -66,16 +84,16 @@ func (m *MockSeedPeerClient) GetPieceTasks(arg0 context.Context, arg1 *common.Pi } // GetPieceTasks indicates an expected call of GetPieceTasks. -func (mr *MockSeedPeerClientMockRecorder) GetPieceTasks(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockSeedPeerClientMockRecorder) GetPieceTasks(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, "GetPieceTasks", reflect.TypeOf((*MockSeedPeerClient)(nil).GetPieceTasks), varargs...) } // ObtainSeeds mocks base method. func (m *MockSeedPeerClient) ObtainSeeds(arg0 context.Context, arg1 *cdnsystem.SeedRequest, arg2 ...grpc.CallOption) (cdnsystem.Seeder_ObtainSeedsClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -86,9 +104,9 @@ func (m *MockSeedPeerClient) ObtainSeeds(arg0 context.Context, arg1 *cdnsystem.S } // ObtainSeeds indicates an expected call of ObtainSeeds. -func (mr *MockSeedPeerClientMockRecorder) ObtainSeeds(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockSeedPeerClientMockRecorder) ObtainSeeds(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, "ObtainSeeds", reflect.TypeOf((*MockSeedPeerClient)(nil).ObtainSeeds), varargs...) } @@ -99,7 +117,7 @@ func (m *MockSeedPeerClient) OnNotify(arg0 *config.DynconfigData) { } // OnNotify indicates an expected call of OnNotify. -func (mr *MockSeedPeerClientMockRecorder) OnNotify(arg0 interface{}) *gomock.Call { +func (mr *MockSeedPeerClientMockRecorder) OnNotify(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnNotify", reflect.TypeOf((*MockSeedPeerClient)(nil).OnNotify), arg0) } @@ -107,7 +125,7 @@ func (mr *MockSeedPeerClientMockRecorder) OnNotify(arg0 interface{}) *gomock.Cal // SyncPieceTasks mocks base method. func (m *MockSeedPeerClient) SyncPieceTasks(arg0 context.Context, arg1 *common.PieceTaskRequest, arg2 ...grpc.CallOption) (cdnsystem.Seeder_SyncPieceTasksClient, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -118,8 +136,8 @@ func (m *MockSeedPeerClient) SyncPieceTasks(arg0 context.Context, arg1 *common.P } // SyncPieceTasks indicates an expected call of SyncPieceTasks. -func (mr *MockSeedPeerClientMockRecorder) SyncPieceTasks(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockSeedPeerClientMockRecorder) SyncPieceTasks(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, "SyncPieceTasks", reflect.TypeOf((*MockSeedPeerClient)(nil).SyncPieceTasks), varargs...) } diff --git a/scheduler/resource/seed_peer_client_test.go b/scheduler/resource/seed_peer_client_test.go index baf083bbc74..090bd65d408 100644 --- a/scheduler/resource/seed_peer_client_test.go +++ b/scheduler/resource/seed_peer_client_test.go @@ -21,8 +21,8 @@ import ( "fmt" "testing" - gomock "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + gomock "go.uber.org/mock/gomock" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/resolver" diff --git a/scheduler/resource/seed_peer_mock.go b/scheduler/resource/seed_peer_mock.go index 5425a59ebdb..b101cc2e214 100644 --- a/scheduler/resource/seed_peer_mock.go +++ b/scheduler/resource/seed_peer_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: seed_peer.go - +// +// Generated by this command: +// +// mockgen -destination seed_peer_mock.go -source seed_peer.go -package resource +// // Package resource is a generated GoMock package. package resource @@ -8,10 +12,10 @@ import ( context "context" reflect "reflect" - v1 "d7y.io/api/v2/pkg/apis/scheduler/v1" + scheduler "d7y.io/api/v2/pkg/apis/scheduler/v1" http "d7y.io/dragonfly/v2/pkg/net/http" types "d7y.io/dragonfly/v2/pkg/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockSeedPeer is a mock of SeedPeer interface. @@ -60,7 +64,7 @@ func (m *MockSeedPeer) DownloadTask(arg0 context.Context, arg1 *Task, arg2 types } // DownloadTask indicates an expected call of DownloadTask. -func (mr *MockSeedPeerMockRecorder) DownloadTask(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockSeedPeerMockRecorder) DownloadTask(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DownloadTask", reflect.TypeOf((*MockSeedPeer)(nil).DownloadTask), arg0, arg1, arg2) } @@ -80,17 +84,17 @@ func (mr *MockSeedPeerMockRecorder) Stop() *gomock.Call { } // TriggerTask mocks base method. -func (m *MockSeedPeer) TriggerTask(arg0 context.Context, arg1 *http.Range, arg2 *Task) (*Peer, *v1.PeerResult, error) { +func (m *MockSeedPeer) TriggerTask(arg0 context.Context, arg1 *http.Range, arg2 *Task) (*Peer, *scheduler.PeerResult, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "TriggerTask", arg0, arg1, arg2) ret0, _ := ret[0].(*Peer) - ret1, _ := ret[1].(*v1.PeerResult) + ret1, _ := ret[1].(*scheduler.PeerResult) ret2, _ := ret[2].(error) return ret0, ret1, ret2 } // TriggerTask indicates an expected call of TriggerTask. -func (mr *MockSeedPeerMockRecorder) TriggerTask(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockSeedPeerMockRecorder) TriggerTask(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TriggerTask", reflect.TypeOf((*MockSeedPeer)(nil).TriggerTask), arg0, arg1, arg2) } diff --git a/scheduler/resource/seed_peer_test.go b/scheduler/resource/seed_peer_test.go index 5d9fbcb36ac..3798eaa6c76 100644 --- a/scheduler/resource/seed_peer_test.go +++ b/scheduler/resource/seed_peer_test.go @@ -22,8 +22,8 @@ import ( "reflect" "testing" - gomock "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + gomock "go.uber.org/mock/gomock" commonv2 "d7y.io/api/v2/pkg/apis/common/v2" schedulerv1 "d7y.io/api/v2/pkg/apis/scheduler/v1" diff --git a/scheduler/resource/task_manager_mock.go b/scheduler/resource/task_manager_mock.go index f2021f89059..69e8ca35ac1 100644 --- a/scheduler/resource/task_manager_mock.go +++ b/scheduler/resource/task_manager_mock.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: task_manager.go - +// +// Generated by this command: +// +// mockgen -destination task_manager_mock.go -source task_manager.go -package resource +// // Package resource is a generated GoMock package. package resource import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockTaskManager is a mock of TaskManager interface. @@ -40,7 +44,7 @@ func (m *MockTaskManager) Delete(arg0 string) { } // Delete indicates an expected call of Delete. -func (mr *MockTaskManagerMockRecorder) Delete(arg0 interface{}) *gomock.Call { +func (mr *MockTaskManagerMockRecorder) Delete(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockTaskManager)(nil).Delete), arg0) } @@ -55,7 +59,7 @@ func (m *MockTaskManager) Load(arg0 string) (*Task, bool) { } // Load indicates an expected call of Load. -func (mr *MockTaskManagerMockRecorder) Load(arg0 interface{}) *gomock.Call { +func (mr *MockTaskManagerMockRecorder) Load(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Load", reflect.TypeOf((*MockTaskManager)(nil).Load), arg0) } @@ -70,7 +74,7 @@ func (m *MockTaskManager) LoadOrStore(arg0 *Task) (*Task, bool) { } // LoadOrStore indicates an expected call of LoadOrStore. -func (mr *MockTaskManagerMockRecorder) LoadOrStore(arg0 interface{}) *gomock.Call { +func (mr *MockTaskManagerMockRecorder) LoadOrStore(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadOrStore", reflect.TypeOf((*MockTaskManager)(nil).LoadOrStore), arg0) } @@ -82,7 +86,7 @@ func (m *MockTaskManager) Range(f func(any, any) bool) { } // Range indicates an expected call of Range. -func (mr *MockTaskManagerMockRecorder) Range(f interface{}) *gomock.Call { +func (mr *MockTaskManagerMockRecorder) Range(f any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Range", reflect.TypeOf((*MockTaskManager)(nil).Range), f) } @@ -108,7 +112,7 @@ func (m *MockTaskManager) Store(arg0 *Task) { } // Store indicates an expected call of Store. -func (mr *MockTaskManagerMockRecorder) Store(arg0 interface{}) *gomock.Call { +func (mr *MockTaskManagerMockRecorder) Store(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Store", reflect.TypeOf((*MockTaskManager)(nil).Store), arg0) } diff --git a/scheduler/resource/task_manager_test.go b/scheduler/resource/task_manager_test.go index 49dbe8927eb..6c41e6d9baf 100644 --- a/scheduler/resource/task_manager_test.go +++ b/scheduler/resource/task_manager_test.go @@ -22,8 +22,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" commonv2 "d7y.io/api/v2/pkg/apis/common/v2" diff --git a/scheduler/resource/task_test.go b/scheduler/resource/task_test.go index 6cfa6ab9acd..dfdc6bf8343 100644 --- a/scheduler/resource/task_test.go +++ b/scheduler/resource/task_test.go @@ -21,8 +21,8 @@ import ( "testing" "time" - gomock "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + gomock "go.uber.org/mock/gomock" commonv1 "d7y.io/api/v2/pkg/apis/common/v1" commonv2 "d7y.io/api/v2/pkg/apis/common/v2" diff --git a/scheduler/rpcserver/rpcserver_test.go b/scheduler/rpcserver/rpcserver_test.go index 3f006a03d8a..b59588a0beb 100644 --- a/scheduler/rpcserver/rpcserver_test.go +++ b/scheduler/rpcserver/rpcserver_test.go @@ -21,8 +21,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "d7y.io/dragonfly/v2/scheduler/config" configmocks "d7y.io/dragonfly/v2/scheduler/config/mocks" diff --git a/scheduler/scheduling/mocks/scheduling_mock.go b/scheduler/scheduling/mocks/scheduling_mock.go index 59186970593..794ea6bf62c 100644 --- a/scheduler/scheduling/mocks/scheduling_mock.go +++ b/scheduler/scheduling/mocks/scheduling_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: scheduling.go - +// +// Generated by this command: +// +// mockgen -destination mocks/scheduling_mock.go -source scheduling.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -10,7 +14,7 @@ import ( set "d7y.io/dragonfly/v2/pkg/container/set" resource "d7y.io/dragonfly/v2/scheduler/resource" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockScheduling is a mock of Scheduling interface. @@ -46,7 +50,7 @@ func (m *MockScheduling) FindCandidateParents(arg0 context.Context, arg1 *resour } // FindCandidateParents indicates an expected call of FindCandidateParents. -func (mr *MockSchedulingMockRecorder) FindCandidateParents(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockSchedulingMockRecorder) FindCandidateParents(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindCandidateParents", reflect.TypeOf((*MockScheduling)(nil).FindCandidateParents), arg0, arg1, arg2) } @@ -61,7 +65,7 @@ func (m *MockScheduling) FindSuccessParent(arg0 context.Context, arg1 *resource. } // FindSuccessParent indicates an expected call of FindSuccessParent. -func (mr *MockSchedulingMockRecorder) FindSuccessParent(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockSchedulingMockRecorder) FindSuccessParent(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindSuccessParent", reflect.TypeOf((*MockScheduling)(nil).FindSuccessParent), arg0, arg1, arg2) } @@ -75,7 +79,7 @@ func (m *MockScheduling) ScheduleCandidateParents(arg0 context.Context, arg1 *re } // ScheduleCandidateParents indicates an expected call of ScheduleCandidateParents. -func (mr *MockSchedulingMockRecorder) ScheduleCandidateParents(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockSchedulingMockRecorder) ScheduleCandidateParents(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ScheduleCandidateParents", reflect.TypeOf((*MockScheduling)(nil).ScheduleCandidateParents), arg0, arg1, arg2) } @@ -87,7 +91,7 @@ func (m *MockScheduling) ScheduleParentAndCandidateParents(arg0 context.Context, } // ScheduleParentAndCandidateParents indicates an expected call of ScheduleParentAndCandidateParents. -func (mr *MockSchedulingMockRecorder) ScheduleParentAndCandidateParents(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockSchedulingMockRecorder) ScheduleParentAndCandidateParents(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ScheduleParentAndCandidateParents", reflect.TypeOf((*MockScheduling)(nil).ScheduleParentAndCandidateParents), arg0, arg1, arg2) } diff --git a/scheduler/scheduling/scheduling_test.go b/scheduler/scheduling/scheduling_test.go index d2ec97ddcce..07f5b2b2769 100644 --- a/scheduler/scheduling/scheduling_test.go +++ b/scheduler/scheduling/scheduling_test.go @@ -24,10 +24,10 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/google/uuid" "github.com/stretchr/testify/assert" "go.uber.org/atomic" + "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/durationpb" diff --git a/scheduler/service/service_v1_test.go b/scheduler/service/service_v1_test.go index 08430e735aa..ce5be18ca5a 100644 --- a/scheduler/service/service_v1_test.go +++ b/scheduler/service/service_v1_test.go @@ -31,9 +31,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "go.uber.org/atomic" + "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/durationpb" diff --git a/scheduler/service/service_v2_test.go b/scheduler/service/service_v2_test.go index fac2437486e..1583d6631f5 100644 --- a/scheduler/service/service_v2_test.go +++ b/scheduler/service/service_v2_test.go @@ -29,8 +29,8 @@ import ( "sync" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/durationpb" diff --git a/scheduler/storage/mocks/storage_mock.go b/scheduler/storage/mocks/storage_mock.go index 6becbeb7cf4..03e23f7e4c3 100644 --- a/scheduler/storage/mocks/storage_mock.go +++ b/scheduler/storage/mocks/storage_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: storage.go - +// +// Generated by this command: +// +// mockgen -destination mocks/storage_mock.go -source storage.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -9,7 +13,7 @@ import ( reflect "reflect" storage "d7y.io/dragonfly/v2/scheduler/storage" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockStorage is a mock of Storage interface. @@ -72,7 +76,7 @@ func (m *MockStorage) CreateDownload(arg0 storage.Download) error { } // CreateDownload indicates an expected call of CreateDownload. -func (mr *MockStorageMockRecorder) CreateDownload(arg0 interface{}) *gomock.Call { +func (mr *MockStorageMockRecorder) CreateDownload(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateDownload", reflect.TypeOf((*MockStorage)(nil).CreateDownload), arg0) } @@ -86,7 +90,7 @@ func (m *MockStorage) CreateNetworkTopology(arg0 storage.NetworkTopology) error } // CreateNetworkTopology indicates an expected call of CreateNetworkTopology. -func (mr *MockStorageMockRecorder) CreateNetworkTopology(arg0 interface{}) *gomock.Call { +func (mr *MockStorageMockRecorder) CreateNetworkTopology(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateNetworkTopology", reflect.TypeOf((*MockStorage)(nil).CreateNetworkTopology), arg0) } diff --git a/trainer/rpcserver/rpcserver_test.go b/trainer/rpcserver/rpcserver_test.go index 6424495cf0b..34dfc50682a 100644 --- a/trainer/rpcserver/rpcserver_test.go +++ b/trainer/rpcserver/rpcserver_test.go @@ -20,8 +20,8 @@ import ( "reflect" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "d7y.io/dragonfly/v2/trainer/config" storagemocks "d7y.io/dragonfly/v2/trainer/storage/mocks" diff --git a/trainer/service/service_v1_test.go b/trainer/service/service_v1_test.go index 6a005ac68ff..c1879e95cfa 100644 --- a/trainer/service/service_v1_test.go +++ b/trainer/service/service_v1_test.go @@ -27,8 +27,8 @@ import ( "sync" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "google.golang.org/protobuf/types/known/emptypb" trainerv1 "d7y.io/api/v2/pkg/apis/trainer/v1" diff --git a/trainer/storage/mocks/storage_mock.go b/trainer/storage/mocks/storage_mock.go index 31c980a4414..f317ead7509 100644 --- a/trainer/storage/mocks/storage_mock.go +++ b/trainer/storage/mocks/storage_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: storage.go - +// +// Generated by this command: +// +// mockgen -destination mocks/storage_mock.go -source storage.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -9,7 +13,7 @@ import ( reflect "reflect" storage "d7y.io/dragonfly/v2/scheduler/storage" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockStorage is a mock of Storage interface. @@ -58,7 +62,7 @@ func (m *MockStorage) ClearDownload(arg0 string) error { } // ClearDownload indicates an expected call of ClearDownload. -func (mr *MockStorageMockRecorder) ClearDownload(arg0 interface{}) *gomock.Call { +func (mr *MockStorageMockRecorder) ClearDownload(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClearDownload", reflect.TypeOf((*MockStorage)(nil).ClearDownload), arg0) } @@ -72,7 +76,7 @@ func (m *MockStorage) ClearNetworkTopology(arg0 string) error { } // ClearNetworkTopology indicates an expected call of ClearNetworkTopology. -func (mr *MockStorageMockRecorder) ClearNetworkTopology(arg0 interface{}) *gomock.Call { +func (mr *MockStorageMockRecorder) ClearNetworkTopology(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClearNetworkTopology", reflect.TypeOf((*MockStorage)(nil).ClearNetworkTopology), arg0) } @@ -87,7 +91,7 @@ func (m *MockStorage) ListDownload(arg0 string) ([]storage.Download, error) { } // ListDownload indicates an expected call of ListDownload. -func (mr *MockStorageMockRecorder) ListDownload(arg0 interface{}) *gomock.Call { +func (mr *MockStorageMockRecorder) ListDownload(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListDownload", reflect.TypeOf((*MockStorage)(nil).ListDownload), arg0) } @@ -102,7 +106,7 @@ func (m *MockStorage) ListNetworkTopology(arg0 string) ([]storage.NetworkTopolog } // ListNetworkTopology indicates an expected call of ListNetworkTopology. -func (mr *MockStorageMockRecorder) ListNetworkTopology(arg0 interface{}) *gomock.Call { +func (mr *MockStorageMockRecorder) ListNetworkTopology(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListNetworkTopology", reflect.TypeOf((*MockStorage)(nil).ListNetworkTopology), arg0) } @@ -117,7 +121,7 @@ func (m *MockStorage) OpenDownload(arg0 string) (*os.File, error) { } // OpenDownload indicates an expected call of OpenDownload. -func (mr *MockStorageMockRecorder) OpenDownload(arg0 interface{}) *gomock.Call { +func (mr *MockStorageMockRecorder) OpenDownload(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenDownload", reflect.TypeOf((*MockStorage)(nil).OpenDownload), arg0) } @@ -132,7 +136,7 @@ func (m *MockStorage) OpenNetworkTopology(arg0 string) (*os.File, error) { } // OpenNetworkTopology indicates an expected call of OpenNetworkTopology. -func (mr *MockStorageMockRecorder) OpenNetworkTopology(arg0 interface{}) *gomock.Call { +func (mr *MockStorageMockRecorder) OpenNetworkTopology(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenNetworkTopology", reflect.TypeOf((*MockStorage)(nil).OpenNetworkTopology), arg0) } diff --git a/trainer/training/mocks/training_mock.go b/trainer/training/mocks/training_mock.go index 26fda78ca6c..98a55630ba0 100644 --- a/trainer/training/mocks/training_mock.go +++ b/trainer/training/mocks/training_mock.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: training.go - +// +// Generated by this command: +// +// mockgen -destination mocks/training_mock.go -source training.go -package mocks +// // Package mocks is a generated GoMock package. package mocks @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockTraining is a mock of Training interface. @@ -43,7 +47,7 @@ func (m *MockTraining) Train(arg0 context.Context, arg1, arg2 string) error { } // Train indicates an expected call of Train. -func (mr *MockTrainingMockRecorder) Train(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockTrainingMockRecorder) Train(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Train", reflect.TypeOf((*MockTraining)(nil).Train), arg0, arg1, arg2) }