From 2decd3ca8609d8a1aa61dc8cc2db9e1b6e6336f2 Mon Sep 17 00:00:00 2001 From: Chris Li <271678682li@gmail.com> Date: Mon, 27 Nov 2023 16:44:00 +0800 Subject: [PATCH] feat: fix lint error --- base/gfspclient/helper_test.go | 2 +- base/gfspclient/interface_mock.go | 64 ++++++++++++++++--------------- core/module/modular_mock.go | 32 ++++++++-------- 3 files changed, 52 insertions(+), 46 deletions(-) diff --git a/base/gfspclient/helper_test.go b/base/gfspclient/helper_test.go index 18f00e900..52c0a8e7e 100644 --- a/base/gfspclient/helper_test.go +++ b/base/gfspclient/helper_test.go @@ -355,7 +355,7 @@ func (s mockManagerServer) GfSpNotifyPreMigrateBucketAndDeductQuota(ctx context. return &gfspserver.GfSpNotifyPreMigrateBucketResponse{}, nil } -func (s mockManagerServer) GfSpNotifyPostMigrate(ctx context.Context, req *gfspserver.GfSpNotifyPostMigrateBucketRequest) (*gfspserver.GfSpNotifyPostMigrateBucketResponse, error) { +func (s mockManagerServer) GfSpNotifyPostMigrateAndRecoupQuota(ctx context.Context, req *gfspserver.GfSpNotifyPostMigrateBucketRequest) (*gfspserver.GfSpNotifyPostMigrateBucketResponse, error) { if req == nil { return nil, mockRPCErr } diff --git a/base/gfspclient/interface_mock.go b/base/gfspclient/interface_mock.go index ed1fef2f3..ab70bcf3b 100644 --- a/base/gfspclient/interface_mock.go +++ b/base/gfspclient/interface_mock.go @@ -1482,32 +1482,34 @@ func (mr *MockGfSpClientAPIMockRecorder) NotifyMigrateSwapOut(ctx, swapOut inter return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyMigrateSwapOut", reflect.TypeOf((*MockGfSpClientAPI)(nil).NotifyMigrateSwapOut), ctx, swapOut) } -// NotifyPostMigrateBucket mocks base method. -func (m *MockGfSpClientAPI) NotifyPostMigrateBucket(ctx context.Context, bmInfo *gfsptask.GfSpBucketMigrationInfo) error { +// NotifyPostMigrateBucketAndRecoupQuota mocks base method. +func (m *MockGfSpClientAPI) NotifyPostMigrateBucketAndRecoupQuota(ctx context.Context, bmInfo *gfsptask.GfSpBucketMigrationInfo) (*gfsptask.GfSpBucketQuotaInfo, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "NotifyPostMigrateBucketAndRecoupQuota", ctx, bmInfo) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*gfsptask.GfSpBucketQuotaInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// NotifyPostMigrateBucket indicates an expected call of NotifyPostMigrateBucket. -func (mr *MockGfSpClientAPIMockRecorder) NotifyPostMigrateBucket(ctx, bmInfo interface{}) *gomock.Call { +// NotifyPostMigrateBucketAndRecoupQuota indicates an expected call of NotifyPostMigrateBucketAndRecoupQuota. +func (mr *MockGfSpClientAPIMockRecorder) NotifyPostMigrateBucketAndRecoupQuota(ctx, bmInfo interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyPostMigrateBucketAndRecoupQuota", reflect.TypeOf((*MockGfSpClientAPI)(nil).NotifyPostMigrateBucket), ctx, bmInfo) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyPostMigrateBucketAndRecoupQuota", reflect.TypeOf((*MockGfSpClientAPI)(nil).NotifyPostMigrateBucketAndRecoupQuota), ctx, bmInfo) } -// NotifyPreMigrateBucket mocks base method. -func (m *MockGfSpClientAPI) NotifyPreMigrateBucket(ctx context.Context, bucketID uint64) error { +// NotifyPreMigrateBucketAndDeductQuota mocks base method. +func (m *MockGfSpClientAPI) NotifyPreMigrateBucketAndDeductQuota(ctx context.Context, bucketID uint64) (*gfsptask.GfSpBucketQuotaInfo, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NotifyPreMigrateBucket", ctx, bucketID) - ret0, _ := ret[0].(error) - return ret0 + ret := m.ctrl.Call(m, "NotifyPreMigrateBucketAndDeductQuota", ctx, bucketID) + ret0, _ := ret[0].(*gfsptask.GfSpBucketQuotaInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// NotifyPreMigrateBucket indicates an expected call of NotifyPreMigrateBucket. -func (mr *MockGfSpClientAPIMockRecorder) NotifyPreMigrateBucket(ctx, bucketID interface{}) *gomock.Call { +// NotifyPreMigrateBucketAndDeductQuota indicates an expected call of NotifyPreMigrateBucketAndDeductQuota. +func (mr *MockGfSpClientAPIMockRecorder) NotifyPreMigrateBucketAndDeductQuota(ctx, bucketID interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyPreMigrateBucket", reflect.TypeOf((*MockGfSpClientAPI)(nil).NotifyPreMigrateBucket), ctx, bucketID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyPreMigrateBucketAndDeductQuota", reflect.TypeOf((*MockGfSpClientAPI)(nil).NotifyPreMigrateBucketAndDeductQuota), ctx, bucketID) } // P2PConn mocks base method. @@ -2830,32 +2832,34 @@ func (mr *MockManagerAPIMockRecorder) NotifyMigrateSwapOut(ctx, swapOut interfac return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyMigrateSwapOut", reflect.TypeOf((*MockManagerAPI)(nil).NotifyMigrateSwapOut), ctx, swapOut) } -// NotifyPostMigrateBucket mocks base method. -func (m *MockManagerAPI) NotifyPostMigrateBucket(ctx context.Context, bmInfo *gfsptask.GfSpBucketMigrationInfo) error { +// NotifyPostMigrateBucketAndRecoupQuota mocks base method. +func (m *MockManagerAPI) NotifyPostMigrateBucketAndRecoupQuota(ctx context.Context, bmInfo *gfsptask.GfSpBucketMigrationInfo) (*gfsptask.GfSpBucketQuotaInfo, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "NotifyPostMigrateBucketAndRecoupQuota", ctx, bmInfo) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*gfsptask.GfSpBucketQuotaInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// NotifyPostMigrateBucket indicates an expected call of NotifyPostMigrateBucket. -func (mr *MockManagerAPIMockRecorder) NotifyPostMigrateBucket(ctx, bmInfo interface{}) *gomock.Call { +// NotifyPostMigrateBucketAndRecoupQuota indicates an expected call of NotifyPostMigrateBucketAndRecoupQuota. +func (mr *MockManagerAPIMockRecorder) NotifyPostMigrateBucketAndRecoupQuota(ctx, bmInfo interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyPostMigrateBucketAndRecoupQuota", reflect.TypeOf((*MockManagerAPI)(nil).NotifyPostMigrateBucket), ctx, bmInfo) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyPostMigrateBucketAndRecoupQuota", reflect.TypeOf((*MockManagerAPI)(nil).NotifyPostMigrateBucketAndRecoupQuota), ctx, bmInfo) } -// NotifyPreMigrateBucket mocks base method. -func (m *MockManagerAPI) NotifyPreMigrateBucket(ctx context.Context, bucketID uint64) error { +// NotifyPreMigrateBucketAndDeductQuota mocks base method. +func (m *MockManagerAPI) NotifyPreMigrateBucketAndDeductQuota(ctx context.Context, bucketID uint64) (*gfsptask.GfSpBucketQuotaInfo, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NotifyPreMigrateBucket", ctx, bucketID) - ret0, _ := ret[0].(error) - return ret0 + ret := m.ctrl.Call(m, "NotifyPreMigrateBucketAndDeductQuota", ctx, bucketID) + ret0, _ := ret[0].(*gfsptask.GfSpBucketQuotaInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// NotifyPreMigrateBucket indicates an expected call of NotifyPreMigrateBucket. -func (mr *MockManagerAPIMockRecorder) NotifyPreMigrateBucket(ctx, bucketID interface{}) *gomock.Call { +// NotifyPreMigrateBucketAndDeductQuota indicates an expected call of NotifyPreMigrateBucketAndDeductQuota. +func (mr *MockManagerAPIMockRecorder) NotifyPreMigrateBucketAndDeductQuota(ctx, bucketID interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyPreMigrateBucket", reflect.TypeOf((*MockManagerAPI)(nil).NotifyPreMigrateBucket), ctx, bucketID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyPreMigrateBucketAndDeductQuota", reflect.TypeOf((*MockManagerAPI)(nil).NotifyPreMigrateBucketAndDeductQuota), ctx, bucketID) } // PickVirtualGroupFamilyID mocks base method. diff --git a/core/module/modular_mock.go b/core/module/modular_mock.go index 0b7ccb1a2..db03b7229 100644 --- a/core/module/modular_mock.go +++ b/core/module/modular_mock.go @@ -1211,32 +1211,34 @@ func (mr *MockManagerMockRecorder) NotifyMigrateSwapOut(ctx, swapOut interface{} return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyMigrateSwapOut", reflect.TypeOf((*MockManager)(nil).NotifyMigrateSwapOut), ctx, swapOut) } -// NotifyPostMigrateBucket mocks base method. -func (m *MockManager) NotifyPostMigrateBucket(ctx context.Context, bmStatus *gfsptask.GfSpBucketMigrationInfo) error { +// NotifyPostMigrateBucketAndRecoupQuota mocks base method. +func (m *MockManager) NotifyPostMigrateBucketAndRecoupQuota(ctx context.Context, bmStatus *gfsptask.GfSpBucketMigrationInfo) (gfsptask.GfSpBucketQuotaInfo, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "NotifyPostMigrateBucketAndRecoupQuota", ctx, bmStatus) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(gfsptask.GfSpBucketQuotaInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// NotifyPostMigrateBucket indicates an expected call of NotifyPostMigrateBucket. -func (mr *MockManagerMockRecorder) NotifyPostMigrateBucket(ctx, bmStatus interface{}) *gomock.Call { +// NotifyPostMigrateBucketAndRecoupQuota indicates an expected call of NotifyPostMigrateBucketAndRecoupQuota. +func (mr *MockManagerMockRecorder) NotifyPostMigrateBucketAndRecoupQuota(ctx, bmStatus interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyPostMigrateBucketAndRecoupQuota", reflect.TypeOf((*MockManager)(nil).NotifyPostMigrateBucket), ctx, bmStatus) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyPostMigrateBucketAndRecoupQuota", reflect.TypeOf((*MockManager)(nil).NotifyPostMigrateBucketAndRecoupQuota), ctx, bmStatus) } -// NotifyPreMigrateBucket mocks base method. -func (m *MockManager) NotifyPreMigrateBucket(ctx context.Context, bucketID uint64) error { +// NotifyPreMigrateBucketAndDeductQuota mocks base method. +func (m *MockManager) NotifyPreMigrateBucketAndDeductQuota(ctx context.Context, bucketID uint64) (gfsptask.GfSpBucketQuotaInfo, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NotifyPreMigrateBucket", ctx, bucketID) - ret0, _ := ret[0].(error) - return ret0 + ret := m.ctrl.Call(m, "NotifyPreMigrateBucketAndDeductQuota", ctx, bucketID) + ret0, _ := ret[0].(gfsptask.GfSpBucketQuotaInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// NotifyPreMigrateBucket indicates an expected call of NotifyPreMigrateBucket. -func (mr *MockManagerMockRecorder) NotifyPreMigrateBucket(ctx, bucketID interface{}) *gomock.Call { +// NotifyPreMigrateBucketAndDeductQuota indicates an expected call of NotifyPreMigrateBucketAndDeductQuota. +func (mr *MockManagerMockRecorder) NotifyPreMigrateBucketAndDeductQuota(ctx, bucketID interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyPreMigrateBucket", reflect.TypeOf((*MockManager)(nil).NotifyPreMigrateBucket), ctx, bucketID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyPreMigrateBucketAndDeductQuota", reflect.TypeOf((*MockManager)(nil).NotifyPreMigrateBucketAndDeductQuota), ctx, bucketID) } // PickVirtualGroupFamily mocks base method.