Feat: support multi range
What type of PR is this? feat
What this PR does / why we need it (English/Chinese): en:
- separate
singlePartfromfsSmallFileReaderandbigFileReader - add
bigRangeReaderandsmallRangeReader, supportsinglePartandmultiPart - add tests of
writeTo()function and case ofmuliRange
ch:
- 将
singlePart从fsSmallFileReader和bigFileReader分离 - 添加
bigRangeReader和smallRangeReader, 支持singlePart和multiPart - 补充
writeTo()方法和muliRange场景的测试
Which issue(s) this PR fixes: https://github.com/cloudwego/hertz/issues/93
addtion ch: 文档:https://yn9nycbt37.feishu.cn/docx/doxcnKSdKp9cMtjtF3ClkN705Qc 问题:
-
bigRangeReader和smallRangeReader存在较多重复代码,想了很久,不太好统一起来- - - 如果请求的是目录,标准库针对range场景,是返回全部数据。这点与标准库不一致(原有的singlePart场景也是)
Has this pr finished? Maybe you can fix ci first.
Has this pr finished? Maybe you can fix ci first.
yeah, this has been finished, i will fix it this weekend, by the way, i have also pull it to the fasthttp https://github.com/valyala/fasthttp/pull/1398
finished @Duslia
Codecov Report
Base: 67.25% // Head: 66.28% // Decreases project coverage by -0.96% :warning:
Coverage data is based on head (
3ee0b03) compared to base (d957978). Patch coverage: 50.22% of modified lines in pull request are covered.
:exclamation: Current head 3ee0b03 differs from pull request most recent head d24b018. Consider uploading reports for the commit d24b018 to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## develop #160 +/- ##
===========================================
- Coverage 67.25% 66.28% -0.97%
===========================================
Files 89 89
Lines 8578 8952 +374
===========================================
+ Hits 5769 5934 +165
- Misses 2448 2641 +193
- Partials 361 377 +16
| Impacted Files | Coverage Δ | |
|---|---|---|
| pkg/app/fs.go | 59.81% <49.65%> (-8.85%) |
:arrow_down: |
| pkg/protocol/header.go | 73.76% <69.23%> (-0.09%) |
:arrow_down: |
| pkg/app/server/option.go | 93.49% <0.00%> (-3.26%) |
:arrow_down: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.