Skip to content

Commit

Permalink
feat: #4910 venus : add market api (#4965)
Browse files Browse the repository at this point in the history
* feat: add share market piecestorage type
* feat: add market api
  • Loading branch information
LinZexiao authored Jul 4, 2022
1 parent e9a63f3 commit ca52e7c
Show file tree
Hide file tree
Showing 5 changed files with 178 additions and 0 deletions.
8 changes: 8 additions & 0 deletions venus-shared/api/market/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,12 @@ type IMarket interface {
GetWriteUrl(ctx context.Context, resource string) (string, error) //perm:read

ImportV1Data(ctx context.Context, src string) error //perm:write

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

RemovePieceStorage(ctx context.Context, name string) error //perm:admin

GetPieceStorages(ctx context.Context) market.PieceStorageList //perm:read
}
80 changes: 80 additions & 0 deletions venus-shared/api/market/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* [ActorExist](#ActorExist)
* [ActorList](#ActorList)
* [ActorSectorSize](#ActorSectorSize)
* [AddFsPieceStorage](#AddFsPieceStorage)
* [AddS3PieceStorage](#AddS3PieceStorage)
* [AssignUnPackedDeals](#AssignUnPackedDeals)
* [DagstoreGC](#DagstoreGC)
* [DagstoreInitializeAll](#DagstoreInitializeAll)
Expand All @@ -26,6 +28,7 @@
* [DealsSetConsiderVerifiedStorageDeals](#DealsSetConsiderVerifiedStorageDeals)
* [DealsSetPieceCidBlocklist](#DealsSetPieceCidBlocklist)
* [GetDeals](#GetDeals)
* [GetPieceStorages](#GetPieceStorages)
* [GetReadUrl](#GetReadUrl)
* [GetUnPackedDeals](#GetUnPackedDeals)
* [GetWriteUrl](#GetWriteUrl)
Expand Down Expand Up @@ -65,6 +68,7 @@
* [PiecesGetPieceInfo](#PiecesGetPieceInfo)
* [PiecesListCidInfos](#PiecesListCidInfos)
* [PiecesListPieces](#PiecesListPieces)
* [RemovePieceStorage](#RemovePieceStorage)
* [ResponseMarketEvent](#ResponseMarketEvent)
* [SectorGetSealDelay](#SectorGetSealDelay)
* [SectorSetExpectedSealDuration](#SectorSetExpectedSealDuration)
Expand Down Expand Up @@ -119,6 +123,41 @@ Inputs:

Response: `34359738368`

### AddFsPieceStorage


Perms: admin

Inputs:
```json
[
true,
"string value",
"string value"
]
```

Response: `{}`

### AddS3PieceStorage


Perms: admin

Inputs:
```json
[
true,
"string value",
"string value",
"string value",
"string value",
"string value"
]
```

Response: `{}`

### AssignUnPackedDeals


Expand Down Expand Up @@ -538,6 +577,33 @@ Response:
]
```

### GetPieceStorages


Perms: read

Inputs: `[]`

Response:
```json
{
"FsStorage": [
{
"Path": "string value",
"Name": "string value",
"ReadOnly": true
}
],
"S3Storage": [
{
"Name": "string value",
"ReadOnly": true,
"EndPoint": "string value"
}
]
}
```

### GetReadUrl
piece storage

Expand Down Expand Up @@ -1663,6 +1729,20 @@ Response:
]
```

### RemovePieceStorage


Perms: admin

Inputs:
```json
[
"string value"
]
```

Response: `{}`

### ResponseMarketEvent
market event

Expand Down
56 changes: 56 additions & 0 deletions venus-shared/api/market/mock/mock_imarket.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions venus-shared/api/market/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions venus-shared/types/market/piecestorage.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package market

type PieceStorageList struct {
FsStorage []FsStorage
S3Storage []S3Storage
}

type FsStorage struct {
Path string
Name string
ReadOnly bool
}

type S3Storage struct {
Name string
ReadOnly bool
EndPoint string
}

0 comments on commit ca52e7c

Please sign in to comment.