hertz icon indicating copy to clipboard operation
hertz copied to clipboard

Feat: support multi range

Open byene0923 opened this issue 3 years ago • 5 comments

What type of PR is this? feat

What this PR does / why we need it (English/Chinese): en:

  • separate singlePart from fsSmallFileReader and bigFileReader
  • add bigRangeReader and smallRangeReader, support singlePart and multiPart
  • add tests of writeTo() function and case of muliRange

ch:

  • singlePartfsSmallFileReaderbigFileReader 分离
  • 添加bigRangeReadersmallRangeReader, 支持 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 问题

  1. bigRangeReadersmallRangeReader 存在较多重复代码,想了很久,不太好统一起来- -
  2. 如果请求的是目录,标准库针对range场景,是返回全部数据。这点与标准库不一致(原有的singlePart场景也是)

byene0923 avatar Jul 31 '22 16:07 byene0923

Has this pr finished? Maybe you can fix ci first.

Duslia avatar Nov 09 '22 08:11 Duslia

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

byene0923 avatar Nov 09 '22 13:11 byene0923

finished @Duslia

byene0923 avatar Nov 11 '22 17:11 byene0923

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.

codecov[bot] avatar Nov 11 '22 17:11 codecov[bot]

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Nov 22 '22 06:11 CLAassistant