-
Notifications
You must be signed in to change notification settings - Fork 773
Feat/reconstruct dfget interface #1343
Feat/reconstruct dfget interface #1343
Conversation
18ee22a
to
c9332ef
Compare
Codecov Report
@@ Coverage Diff @@
## master #1343 +/- ##
==========================================
+ Coverage 51.35% 51.36% +0.01%
==========================================
Files 130 130
Lines 8576 8576
==========================================
+ Hits 4404 4405 +1
Misses 3804 3804
+ Partials 368 367 -1
Continue to review full report at Codecov.
|
"github.com/dragonflyoss/Dragonfly/pkg/protocol/distributiondata" | ||
) | ||
|
||
// ClientStream defines how to organize distribution data and get read stream for range request. |
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.
It's better to use downloading task
instead of range request
, and the downloading task
defined here supports file
downloading and range
downloading.
e5191eb
to
7edba40
Compare
pkg/protocol/url/protocol.go
Outdated
Get(key string) (interface{}, error) | ||
Set(key string, value interface{}) | ||
Del(key string) | ||
Extra() interface{} |
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'm not very clear what the Extra()
is for? Maybe, use All()
which returns all the meta info?
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.
pkg/protocol/url/protocol.go
Outdated
* limitations under the License. | ||
*/ | ||
|
||
package url |
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.
IMOP, it's unnecessary to move this file into a sub-package of pkg/protocol
.
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
pkg/protocol/url/protocol.go
Outdated
Expire(ctx context.Context) (bool, interface{}, error) | ||
|
||
// Close the resource. | ||
io.Closer |
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.
move it to the bottom of this interface
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
Content(ctx context.Context) (io.Reader, error) | ||
} | ||
|
||
type EOFDataType 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.
The EOF type should be private and provides public instances of EOFDataType
and EOFDistributionData
. WDYT?
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.
FIx it。
648f16c
to
4968d1d
Compare
…gister, uploader, data_protocol and url protocol. Signed-off-by: allen.wq <[email protected]>
4968d1d
to
d04b08c
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
Ⅰ. Describe what this PR did
Define some interface of dfget to reconstruct the dfget.
Ⅱ. Does this pull request fix one issue?
NONE.
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
No need.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews