2020-11-24 13:40:50 +00:00
|
|
|
package blobstor
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/core/object"
|
2020-11-24 14:02:41 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobovnicza"
|
2021-11-10 07:08:33 +00:00
|
|
|
objectSDK "github.com/nspcc-dev/neofs-sdk-go/object"
|
2022-01-26 12:11:13 +00:00
|
|
|
addressSDK "github.com/nspcc-dev/neofs-sdk-go/object/address"
|
2020-11-24 13:40:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type address struct {
|
2022-01-26 12:11:13 +00:00
|
|
|
addr *addressSDK.Address
|
2020-11-24 13:40:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetAddress sets the address of the requested object.
|
2022-01-26 12:11:13 +00:00
|
|
|
func (a *address) SetAddress(addr *addressSDK.Address) {
|
2020-11-24 13:40:50 +00:00
|
|
|
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
|
|
|
|
}
|
2020-11-24 14:02:41 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
2020-11-24 14:15:58 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|