-
Notifications
You must be signed in to change notification settings - Fork 773
feature: define api types for seed pattern #1270
feature: define api types for seed pattern #1270
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The codes in apis/types
will be generated automatically by the robot, it's better not to submit these codes in pr.
ignore this, it's hard to separate them.
basic: | ||
$ref: "#/definitions/PeerInfo" | ||
description: "Basic node info" | ||
extra: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the extra
property is a map struct not a pre-defined object
, thus we can add some customized properties without changing the api
in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
apis/swagger.yml
Outdated
@@ -1362,6 +1394,93 @@ definitions: | |||
format: "int64" | |||
description: "The length of the file dfget requests to download in bytes." | |||
|
|||
NetworkInfoFetchRequest: | |||
type: "object" | |||
description: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add description here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
apis/swagger.yml
Outdated
|
||
Extra: | ||
type: "object" | ||
description: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add description here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
apis/swagger.yml
Outdated
|
||
TaskFetchInfo: | ||
type: "object" | ||
description: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add description here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
apis/swagger.yml
Outdated
|
||
Node: | ||
type: "object" | ||
description: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add description here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
apis/swagger.yml
Outdated
This attribute represents the length of resource, dfdaemon or dfget catches and calculates | ||
this parameter from the headers of request URL. If fileLength is vaild, the supernode need | ||
not get the length of resource by accessing the rawURL. | ||
format: "int64" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the indent here is incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
apis/swagger.yml
Outdated
IP: | ||
type: "string" | ||
description: "IP address which peer client carries" | ||
format: "string" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use ipv4
or ipv6
for the format here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
items: | ||
$ref: "#/definitions/Node" | ||
|
||
HeartBeatRequest: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This struct is newly declared here, while where to use it in the API endpoint?
I think where to use it is missing in the API defining side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
please resolve these spell errors |
a8f34df
to
ffd954f
Compare
Codecov Report
@@ Coverage Diff @@
## master #1270 +/- ##
=======================================
Coverage 48.51% 48.51%
=======================================
Files 121 121
Lines 7788 7788
=======================================
Hits 3778 3778
Misses 3698 3698
Partials 312 312
Continue to review full report at Codecov.
|
apis/types/extra.go
Outdated
|
||
// Extra extra | ||
// swagger:model Extra | ||
type Extra struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is not generated by go-swagger with the current api definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Signed-off-by: allen.wq <[email protected]>
ffd954f
to
1d160be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -648,6 +648,47 @@ paths: | |||
500: | |||
$ref: "#/responses/500ErrorResponse" | |||
|
|||
/peer/heartbeat: | |||
get: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this is a "GET" request. Maybe POST
is better. @wangforthinker
Signed-off-by: Gaius <[email protected]>
Signed-off-by: allen.wq [email protected]
Ⅰ. Describe what this PR did
define some api types for seed mode.
Ⅱ. Does this pull request fix one issue?
NONE.
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
none.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews