objsvc: Remove useless stream wrappers
Some checks failed
Tests and linters / Run gofumpt (pull_request) Successful in 1m54s
DCO action / DCO (pull_request) Failing after 2m16s
Vulncheck / Vulncheck (pull_request) Successful in 2m30s
Pre-commit hooks / Pre-commit (pull_request) Successful in 3m11s
Tests and linters / Staticcheck (pull_request) Successful in 3m15s
Tests and linters / gopls check (pull_request) Successful in 3m17s
Build / Build Components (pull_request) Successful in 3m25s
Tests and linters / Lint (pull_request) Successful in 3m54s
Tests and linters / Tests with -race (pull_request) Successful in 4m53s
Tests and linters / Tests (pull_request) Successful in 5m54s

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-11-08 10:10:06 +03:00
parent 360b06e6c9
commit 124d3ec84d
Signed by: fyrchik
SSH key fingerprint: SHA256:m/TTwCzjnRkXgnzEx9X92ccxy1CcVeinOgDb3NPWWmg

View file

@ -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 {