-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package gateway | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/filecoin-project/venus/venus-shared/types/gateway" | ||
) | ||
|
||
type IProofEventAPI interface { | ||
ResponseProofEvent(ctx context.Context, resp *gateway.ResponseEvent) error //perm:write | ||
ListenProofEvent(ctx context.Context, policy *gateway.ProofRegisterPolicy) (<-chan *gateway.RequestEvent, error) //perm:write | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Groups | ||
|
||
* [ProofEvent](#ProofEvent) | ||
* [ListenProofEvent](#ListenProofEvent) | ||
* [ResponseProofEvent](#ResponseProofEvent) | ||
|
||
## ProofEvent | ||
|
||
### ListenProofEvent | ||
|
||
|
||
Perms: write | ||
|
||
Inputs: | ||
```json | ||
[ | ||
{ | ||
"MinerAddress": "f01234" | ||
} | ||
] | ||
``` | ||
|
||
Response: | ||
```json | ||
{ | ||
"Id": "07070707-0707-0707-0707-070707070707", | ||
"Method": "string value", | ||
"Payload": "Ynl0ZSBhcnJheQ==" | ||
} | ||
``` | ||
|
||
### ResponseProofEvent | ||
|
||
|
||
Perms: write | ||
|
||
Inputs: | ||
```json | ||
[ | ||
{ | ||
"Id": "07070707-0707-0707-0707-070707070707", | ||
"Payload": "Ynl0ZSBhcnJheQ==", | ||
"Error": "string value" | ||
} | ||
] | ||
``` | ||
|
||
Response: `{}` | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package gateway | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/google/uuid" | ||
|
||
"github.com/filecoin-project/go-address" | ||
) | ||
|
||
type ProofRegisterPolicy struct { | ||
MinerAddress address.Address | ||
} | ||
|
||
type RequestEvent struct { | ||
Id uuid.UUID | ||
Method string | ||
Payload []byte | ||
CreateTime time.Time `json:"-"` | ||
Result chan *ResponseEvent `json:"-"` | ||
} | ||
|
||
type ResponseEvent struct { | ||
Id uuid.UUID | ||
Payload []byte | ||
Error string | ||
} |