From 62144a97654984072104189807fc517c798948f0 Mon Sep 17 00:00:00 2001 From: tanlang Date: Fri, 5 Aug 2022 09:55:10 +0800 Subject: [PATCH] feat:update PieceStorageInfos --- venus-shared/api/market/api.go | 2 +- venus-shared/api/market/method.md | 6 +++++- venus-shared/api/market/mock/mock_imarket.go | 8 ++++---- venus-shared/api/market/proxy_gen.go | 6 +++--- venus-shared/types/market/piecestorage.go | 2 ++ 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/venus-shared/api/market/api.go b/venus-shared/api/market/api.go index e6c4a745a0..fca3cae5ba 100644 --- a/venus-shared/api/market/api.go +++ b/venus-shared/api/market/api.go @@ -154,7 +154,7 @@ type IMarket interface { AddFsPieceStorage(ctx context.Context, readonly bool, path string, name string) error //perm:admin - AddS3PieceStorage(ctx context.Context, readonly bool, endpoit, name, key, secret, token string) error //perm:admin + AddS3PieceStorage(ctx context.Context, readonly bool, endpoit, bucket, subdir, name, key, secret, token string) error //perm:admin RemovePieceStorage(ctx context.Context, name string) error //perm:admin diff --git a/venus-shared/api/market/method.md b/venus-shared/api/market/method.md index 84a0f3d21d..7345a08f1f 100644 --- a/venus-shared/api/market/method.md +++ b/venus-shared/api/market/method.md @@ -154,6 +154,8 @@ Inputs: "string value", "string value", "string value", + "string value", + "string value", "string value" ] ``` @@ -631,7 +633,9 @@ Response: { "Name": "string value", "ReadOnly": true, - "EndPoint": "string value" + "EndPoint": "string value", + "Bucket": "string value", + "SubDir": "string value" } ] } diff --git a/venus-shared/api/market/mock/mock_imarket.go b/venus-shared/api/market/mock/mock_imarket.go index ac0ad34d6a..cc7bb3910f 100644 --- a/venus-shared/api/market/mock/mock_imarket.go +++ b/venus-shared/api/market/mock/mock_imarket.go @@ -109,17 +109,17 @@ func (mr *MockIMarketMockRecorder) AddFsPieceStorage(arg0, arg1, arg2, arg3 inte } // AddS3PieceStorage mocks base method. -func (m *MockIMarket) AddS3PieceStorage(arg0 context.Context, arg1 bool, arg2, arg3, arg4, arg5, arg6 string) error { +func (m *MockIMarket) AddS3PieceStorage(arg0 context.Context, arg1 bool, arg2, arg3, arg4, arg5, arg6, arg7, arg8 string) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "AddS3PieceStorage", arg0, arg1, arg2, arg3, arg4, arg5, arg6) + ret := m.ctrl.Call(m, "AddS3PieceStorage", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) ret0, _ := ret[0].(error) return ret0 } // AddS3PieceStorage indicates an expected call of AddS3PieceStorage. -func (mr *MockIMarketMockRecorder) AddS3PieceStorage(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call { +func (mr *MockIMarketMockRecorder) AddS3PieceStorage(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddS3PieceStorage", reflect.TypeOf((*MockIMarket)(nil).AddS3PieceStorage), arg0, arg1, arg2, arg3, arg4, arg5, arg6) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddS3PieceStorage", reflect.TypeOf((*MockIMarket)(nil).AddS3PieceStorage), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) } // AssignUnPackedDeals mocks base method. diff --git a/venus-shared/api/market/proxy_gen.go b/venus-shared/api/market/proxy_gen.go index 1adf510ce3..8aa20e2813 100644 --- a/venus-shared/api/market/proxy_gen.go +++ b/venus-shared/api/market/proxy_gen.go @@ -26,7 +26,7 @@ type IMarketStruct struct { ActorList func(context.Context) ([]market.User, error) `perm:"read"` ActorSectorSize func(context.Context, address.Address) (abi.SectorSize, error) `perm:"read"` AddFsPieceStorage func(ctx context.Context, readonly bool, path string, name string) error `perm:"admin"` - AddS3PieceStorage func(ctx context.Context, readonly bool, endpoit, name, key, secret, token string) error `perm:"admin"` + AddS3PieceStorage func(ctx context.Context, readonly bool, endpoit, bucket, subdir, name, key, secret, token string) error `perm:"admin"` AssignUnPackedDeals func(ctx context.Context, sid abi.SectorID, ssize abi.SectorSize, spec *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) `perm:"write"` DagstoreGC func(ctx context.Context) ([]market.DagstoreShardResult, error) `perm:"admin"` DagstoreInitializeAll func(ctx context.Context, params market.DagstoreInitializeAllParams) (<-chan market.DagstoreInitializeAllEvent, error) `perm:"admin"` @@ -113,8 +113,8 @@ func (s *IMarketStruct) ActorSectorSize(p0 context.Context, p1 address.Address) func (s *IMarketStruct) AddFsPieceStorage(p0 context.Context, p1 bool, p2 string, p3 string) error { return s.Internal.AddFsPieceStorage(p0, p1, p2, p3) } -func (s *IMarketStruct) AddS3PieceStorage(p0 context.Context, p1 bool, p2, p3, p4, p5, p6 string) error { - return s.Internal.AddS3PieceStorage(p0, p1, p2, p3, p4, p5, p6) +func (s *IMarketStruct) AddS3PieceStorage(p0 context.Context, p1 bool, p2, p3, p4, p5, p6, p7, p8 string) error { + return s.Internal.AddS3PieceStorage(p0, p1, p2, p3, p4, p5, p6, p7, p8) } func (s *IMarketStruct) AssignUnPackedDeals(p0 context.Context, p1 abi.SectorID, p2 abi.SectorSize, p3 *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) { return s.Internal.AssignUnPackedDeals(p0, p1, p2, p3) diff --git a/venus-shared/types/market/piecestorage.go b/venus-shared/types/market/piecestorage.go index d866c5e95c..c6a5d67dc2 100644 --- a/venus-shared/types/market/piecestorage.go +++ b/venus-shared/types/market/piecestorage.go @@ -15,4 +15,6 @@ type S3Storage struct { Name string ReadOnly bool EndPoint string + Bucket string + SubDir string }