[#1319] services/object: Remove Write method from local and remote targets

They work with prepared objects only.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-04-28 10:19:26 +03:00 committed by LeL
parent 4ea03c01b5
commit 057d53459b
4 changed files with 7 additions and 14 deletions

View file

@ -19,24 +19,14 @@ type localTarget struct {
storage ObjectStorage
obj *object.Object
payload []byte
}
func (t *localTarget) WriteHeader(obj *object.Object) error {
t.obj = obj
t.payload = make([]byte, 0, obj.PayloadSize())
return nil
}
func (t *localTarget) Write(p []byte) (n int, err error) {
t.payload = append(t.payload, p...)
return len(p), nil
}
func (t *localTarget) Close() (*transformer.AccessIdentifiers, error) {
if err := t.storage.Put(t.obj); err != nil {
return nil, fmt.Errorf("(%T) could not put object to local storage: %w", t, err)