Documentation ¶
Index ¶
- Variables
- func AddressOf(obj *object.Object) oid.Address
- func EncodeReplicationMetaInfo(cID cid.ID, oID oid.ID, pSize uint64, deleted, locked []oid.ID, ...) []byte
- func Expiration(obj object.Object) (uint64, error)
- type AddressWithType
- type ContentMeta
- type DeleteHandler
- type FormatValidator
- type FormatValidatorOption
- type LockSource
- type Locker
- type SplitVerifier
- type TombVerifier
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidSearchQuery = errors.New("invalid search query")
ErrInvalidSearchQuery is returned when some object search query is invalid.
var ErrNoExpiration = errors.New("missing expiration epoch attribute")
ErrNoExpiration means no expiration was set.
Functions ¶
func EncodeReplicationMetaInfo ¶ added in v0.44.0
func EncodeReplicationMetaInfo(cID cid.ID, oID oid.ID, pSize uint64, deleted, locked []oid.ID, createdAt uint64, magicNumber uint32) []byte
EncodeReplicationMetaInfo uses NEO's map (strict order) serialized format as a raw representation of object's meta information.
This (ordered) format is used (keys are strings):
"network": network magic "cid": _raw_ container ID (32 bytes) "oid": _raw_ object ID (32 bytes) "size": payload size "deleted": array of _raw_ object IDs "locked": array of _raw_ object IDs "validuntil": last valid epoch number for meta information
Last valid epoch is object's creation epoch + 10.
Types ¶
type AddressWithType ¶ added in v0.36.0
AddressWithType groups object address with its NeoFS object type.
type ContentMeta ¶ added in v0.36.0
type ContentMeta struct {
// contains filtered or unexported fields
}
ContentMeta describes NeoFS meta information that brings object's payload if the object is one of:
- object.TypeTombstone;
- object.TypeStorageGroup;
- object.TypeLink;
- object.TypeLock.
func (ContentMeta) Objects ¶ added in v0.36.0
func (i ContentMeta) Objects() []oid.ID
Objects returns objects that the original object's payload affects:
- inhumed objects, if the original object is a Tombstone;
- locked objects, if the original object is a Lock;
- members of a storage group, if the original object is a Storage group;
- nil, if the original object is a Regular object.
func (ContentMeta) Type ¶ added in v0.36.0
func (i ContentMeta) Type() object.Type
Type returns object's type.
type DeleteHandler ¶ added in v0.12.0
type DeleteHandler interface { // DeleteObjects places objects to a removal queue. // // Returns apistatus.LockNonRegularObject if at least one object // is locked. DeleteObjects(oid.Address, ...oid.Address) error }
DeleteHandler is an interface of delete queue processor.
type FormatValidator ¶ added in v0.12.0
type FormatValidator struct {
// contains filtered or unexported fields
}
FormatValidator represents an object format validator.
func NewFormatValidator ¶ added in v0.12.0
func NewFormatValidator(opts ...FormatValidatorOption) *FormatValidator
NewFormatValidator creates, initializes and returns FormatValidator instance.
func (*FormatValidator) Validate ¶ added in v0.12.0
func (v *FormatValidator) Validate(obj *object.Object, unprepared bool) error
Validate validates object format.
Does not validate payload checksum and content. If unprepared is true, only fields set by user are validated.
Returns nil error if the object has valid structure.
func (*FormatValidator) ValidateContent ¶ added in v0.12.0
func (v *FormatValidator) ValidateContent(o *object.Object) (ContentMeta, error)
ValidateContent validates payload content according to the object type.
type FormatValidatorOption ¶ added in v0.12.0
type FormatValidatorOption func(*cfg)
FormatValidatorOption represents a FormatValidator constructor option.
func WithLockSource ¶ added in v0.38.0
func WithLockSource(e LockSource) FormatValidatorOption
WithLockSource return option to set a Locked objects source.
func WithNetState ¶ added in v0.16.0
func WithNetState(netState netmap.State) FormatValidatorOption
WithNetState returns options to set the network state interface.
func WithSplitVerifier ¶ added in v0.41.0
func WithSplitVerifier(sv SplitVerifier) FormatValidatorOption
WithSplitVerifier returns option to set a SplitVerifier.
func WithTombVerifier ¶ added in v0.41.0
func WithTombVerifier(tv TombVerifier) FormatValidatorOption
WithTombVerifier returns option to set a TombVerifier.
type LockSource ¶ added in v0.38.0
type LockSource interface { // IsLocked must clarify object's lock status. IsLocked(address oid.Address) (bool, error) }
LockSource is a source of lock relations between the objects.
type Locker ¶ added in v0.28.0
type Locker interface { // Lock list of objects as locked by locker in the specified container. // // Returns apistatus.LockNonRegularObject if at least object in locked // list is irregular (not type of REGULAR). Lock(idCnr cid.ID, locker oid.ID, locked []oid.ID) error }
Locker is an object lock storage interface.
type SplitVerifier ¶ added in v0.41.0
type SplitVerifier interface { // VerifySplit must verify split hierarchy and return any error that did // not allow processing the chain. Must break (if possible) any internal // computations if context is done. The second and the third args are the // first part's address used as a chain unique identifier that also must // be checked. The fourth arg is guaranteed to be the full list from the // link's payload without item order change. VerifySplit(context.Context, cid.ID, oid.ID, []object.MeasuredObject) error }
SplitVerifier represent split validation unit. It verifies V2 split chains based on the link object's payload (list of ID+ObjectSize pairs).
type TombVerifier ¶ added in v0.41.0
type TombVerifier interface { // VerifyTomb must verify tombstone payload. Must break (if possible) any internal // computations if context is done. VerifyTomb(ctx context.Context, cnr cid.ID, t object.Tombstone) error }
TombVerifier represents tombstone validation unit. It verifies tombstone object received by the node.