object

package
v0.0.0-...-79ba347 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressOf

func AddressOf(obj *object.Object) oid.Address

AddressOf returns the address of the object.

Types

type AddressWithType

type AddressWithType struct {
	Address oid.Address
	Type    object.Type
}

AddressWithType groups object address with its FrostFS object type.

type ContentMeta

type ContentMeta struct {
	// contains filtered or unexported fields
}

ContentMeta describes FrostFS meta information that brings object's payload if the object is one of:

  • object.TypeTombstone;
  • object.TypeStorageGroup;
  • object.TypeLock.

func (ContentMeta) Objects

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

func (i ContentMeta) Type() object.Type

Type returns object's type.

type DeleteHandler

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

type FormatValidator struct {
	// contains filtered or unexported fields
}

FormatValidator represents an object format validator.

func NewFormatValidator

func NewFormatValidator(opts ...FormatValidatorOption) *FormatValidator

NewFormatValidator creates, initializes and returns FormatValidator instance.

func (*FormatValidator) Validate

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

func (v *FormatValidator) ValidateContent(o *object.Object) (ContentMeta, error)

ValidateContent validates payload content according to the object type.

type FormatValidatorOption

type FormatValidatorOption func(*cfg)

FormatValidatorOption represents a FormatValidator constructor option.

func WithNetState

func WithNetState(netState netmap.State) FormatValidatorOption

WithNetState returns options to set the network state interface.

type Locker

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL