forked from TrueCloudLab/frostfs-node
[#235] object/getrangehash: Implement new service processing
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
0fc5ea674c
commit
7e56427534
7 changed files with 151 additions and 31 deletions
|
@ -3,6 +3,7 @@ package getsvc
|
|||
import (
|
||||
"context"
|
||||
"crypto/ecdsa"
|
||||
"hash"
|
||||
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/client"
|
||||
objectSDK "github.com/nspcc-dev/neofs-api-go/pkg/object"
|
||||
|
@ -42,6 +43,10 @@ type rangeWriter struct {
|
|||
chunkWriter ChunkWriter
|
||||
}
|
||||
|
||||
type hasherWrapper struct {
|
||||
hash hash.Hash
|
||||
}
|
||||
|
||||
func newSimpleObjectWriter() *simpleObjectWriter {
|
||||
return &simpleObjectWriter{
|
||||
obj: object.NewRaw(),
|
||||
|
@ -156,3 +161,8 @@ func payloadOnlyObject(payload []byte) *objectSDK.Object {
|
|||
|
||||
return rawObj.Object().SDK()
|
||||
}
|
||||
|
||||
func (h *hasherWrapper) WriteChunk(p []byte) error {
|
||||
_, err := h.hash.Write(p)
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue