frostfs-node/pkg/local_object_storage/blobstor/util.go
Evgenii Stratonikov 95893927aa *: replace neofs-api-go with neofs-sdk-go
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-11-12 17:29:09 +03:00

79 lines
1.5 KiB
Go

package blobstor
import (
"github.com/nspcc-dev/neofs-node/pkg/core/object"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobovnicza"
objectSDK "github.com/nspcc-dev/neofs-sdk-go/object"
)
type address struct {
addr *objectSDK.Address
}
// SetAddress sets the address of the requested object.
func (a *address) SetAddress(addr *objectSDK.Address) {
a.addr = addr
}
type roObject struct {
obj *object.Object
}
// Object returns the object.
func (o roObject) Object() *object.Object {
return o.obj
}
type rwObject struct {
roObject
}
// SetObject sets the object.
func (o *rwObject) SetObject(obj *object.Object) {
o.obj = obj
}
type roBlobovniczaID struct {
blobovniczaID *blobovnicza.ID
}
// BlobovniczaID returns blobovnicza ID.
func (v roBlobovniczaID) BlobovniczaID() *blobovnicza.ID {
return v.blobovniczaID
}
type rwBlobovniczaID struct {
roBlobovniczaID
}
// SetBlobovniczaID sets blobovnicza ID.
func (v *rwBlobovniczaID) SetBlobovniczaID(id *blobovnicza.ID) {
v.blobovniczaID = id
}
type roRange struct {
rng *objectSDK.Range
}
// Range returns range of the object payload.
func (r roRange) Range() *objectSDK.Range {
return r.rng
}
type rwRange struct {
roRange
}
// SetRange sets range of the object payload.
func (r *rwRange) SetRange(rng *objectSDK.Range) {
r.rng = rng
}
type rangeData struct {
data []byte
}
// RangeData returns data of the requested payload range.
func (d rangeData) RangeData() []byte {
return d.data
}