Skip to content

Commit

Permalink
feat: add market api
Browse files Browse the repository at this point in the history
AddFsPieceStorage
RemovePieceStorage
GetPieceStorages
  • Loading branch information
LinZexiao committed Jul 4, 2022
1 parent b3e4848 commit 0f80d85
Show file tree
Hide file tree
Showing 4 changed files with 160 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.

0 comments on commit 0f80d85

Please sign in to comment.