[#1480] objsvc: Remove useless stream wrappers
All checks were successful
DCO action / DCO (pull_request) Successful in 1m54s
Vulncheck / Vulncheck (pull_request) Successful in 2m39s
Tests and linters / Run gofumpt (pull_request) Successful in 2m55s
Tests and linters / Staticcheck (pull_request) Successful in 3m32s
Tests and linters / Lint (pull_request) Successful in 4m8s
Pre-commit hooks / Pre-commit (pull_request) Successful in 4m28s
Tests and linters / gopls check (pull_request) Successful in 4m26s
Build / Build Components (pull_request) Successful in 4m42s
Tests and linters / Tests (pull_request) Successful in 6m25s
Tests and linters / Tests with -race (pull_request) Successful in 7m45s
All checks were successful
DCO action / DCO (pull_request) Successful in 1m54s
Vulncheck / Vulncheck (pull_request) Successful in 2m39s
Tests and linters / Run gofumpt (pull_request) Successful in 2m55s
Tests and linters / Staticcheck (pull_request) Successful in 3m32s
Tests and linters / Lint (pull_request) Successful in 4m8s
Pre-commit hooks / Pre-commit (pull_request) Successful in 4m28s
Tests and linters / gopls check (pull_request) Successful in 4m26s
Build / Build Components (pull_request) Successful in 4m42s
Tests and linters / Tests (pull_request) Successful in 6m25s
Tests and linters / Tests with -race (pull_request) Successful in 7m45s
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
05c392b050
commit
1cdded6910
1 changed files with 3 additions and 33 deletions
|
@ -41,18 +41,6 @@ type patchStreamBasicChecker struct {
|
|||
nonFirstSend bool
|
||||
}
|
||||
|
||||
type getStreamBasicChecker struct {
|
||||
object.GetObjectStream
|
||||
}
|
||||
|
||||
type rangeStreamBasicChecker struct {
|
||||
object.GetObjectRangeStream
|
||||
}
|
||||
|
||||
type searchStreamBasicChecker struct {
|
||||
object.SearchStream
|
||||
}
|
||||
|
||||
// Option represents Service constructor option.
|
||||
type Option func(*cfg)
|
||||
|
||||
|
@ -212,9 +200,7 @@ func (b Service) Get(request *objectV2.GetRequest, stream object.GetObjectStream
|
|||
|
||||
reqInfo.obj = obj
|
||||
|
||||
return b.next.Get(request, &getStreamBasicChecker{
|
||||
GetObjectStream: newWrappedGetObjectStreamStream(stream, reqInfo),
|
||||
})
|
||||
return b.next.Get(request, newWrappedGetObjectStreamStream(stream, reqInfo))
|
||||
}
|
||||
|
||||
func (b Service) Put() (object.PutObjectStream, error) {
|
||||
|
@ -318,9 +304,7 @@ func (b Service) Search(request *objectV2.SearchRequest, stream object.SearchStr
|
|||
return err
|
||||
}
|
||||
|
||||
return b.next.Search(request, &searchStreamBasicChecker{
|
||||
SearchStream: newWrappedSearchStream(stream, reqInfo),
|
||||
})
|
||||
return b.next.Search(request, newWrappedSearchStream(stream, reqInfo))
|
||||
}
|
||||
|
||||
func (b Service) Delete(
|
||||
|
@ -413,9 +397,7 @@ func (b Service) GetRange(request *objectV2.GetRangeRequest, stream object.GetOb
|
|||
|
||||
reqInfo.obj = obj
|
||||
|
||||
return b.next.GetRange(request, &rangeStreamBasicChecker{
|
||||
GetObjectRangeStream: newWrappedRangeStream(stream, reqInfo),
|
||||
})
|
||||
return b.next.GetRange(request, newWrappedRangeStream(stream, reqInfo))
|
||||
}
|
||||
|
||||
func requestContext(ctx context.Context, reqInfo RequestInfo) context.Context {
|
||||
|
@ -627,18 +609,6 @@ func (p putStreamBasicChecker) CloseAndRecv(ctx context.Context) (*objectV2.PutR
|
|||
return p.next.CloseAndRecv(ctx)
|
||||
}
|
||||
|
||||
func (g *getStreamBasicChecker) Send(resp *objectV2.GetResponse) error {
|
||||
return g.GetObjectStream.Send(resp)
|
||||
}
|
||||
|
||||
func (g *rangeStreamBasicChecker) Send(resp *objectV2.GetRangeResponse) error {
|
||||
return g.GetObjectRangeStream.Send(resp)
|
||||
}
|
||||
|
||||
func (g *searchStreamBasicChecker) Send(resp *objectV2.SearchResponse) error {
|
||||
return g.SearchStream.Send(resp)
|
||||
}
|
||||
|
||||
func (p *patchStreamBasicChecker) Send(ctx context.Context, request *objectV2.PatchRequest) error {
|
||||
body := request.GetBody()
|
||||
if body == nil {
|
||||
|
|
Loading…
Reference in a new issue