object

package
v0.42.0-rc.9 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressOf

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

AddressOf returns the address of the object.

func IsECSupported added in v0.39.0

func IsECSupported(obj *objectSDK.Object) bool

IsECSupported returns True if EC supported for object.

EC supported only for regular, not linking objects.

func LookupKeyInContainer added in v0.39.0

func LookupKeyInContainer(
	nm *netmap.NetMap,
	pkey, idCnr []byte,
	cnr container.Container,
) (bool, error)

Types

type ClassifyResult added in v0.37.0

type ClassifyResult struct {
	Role acl.Role
	Key  []byte
}

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.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;
  • nil, if the original object is a Regular object.

func (ContentMeta) Type

func (i ContentMeta) Type() objectSDK.Type

Type returns object's type.

type ECInfo added in v0.40.0

type ECInfo struct {
	ParentID oid.ID
	Index    uint32
	Total    uint32
}

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(ctx context.Context, obj *objectSDK.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 *objectSDK.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 WithContainersSource added in v0.37.0

func WithContainersSource(cs container.Source) FormatValidatorOption

WithContainersSource return option to set Containers source.

func WithInnerRing added in v0.37.0

func WithInnerRing(ir InnerRing) FormatValidatorOption

WithInnerRing return option to set Inner Ring source.

func WithLockSource

func WithLockSource(e LockSource) FormatValidatorOption

WithLockSource return option to set the Storage Engine.

func WithLogger added in v0.37.0

func WithLogger(l *logger.Logger) FormatValidatorOption

WithLogger return option to set logger.

func WithNetState

func WithNetState(netState netmap.State) FormatValidatorOption

WithNetState returns options to set the network state interface.

func WithNetmapSource added in v0.37.0

func WithNetmapSource(ns netmap.Source) FormatValidatorOption

WithNetmapSource return option to set Netmap source.

func WithVerifySessionTokenIssuer added in v0.37.0

func WithVerifySessionTokenIssuer(verifySessionTokenIssuer bool) FormatValidatorOption

WithVerifySessionTokenIssuer return option to set verify session token issuer value.

type Info added in v0.40.0

type Info struct {
	Address         oid.Address
	Type            objectSDK.Type
	IsLinkingObject bool
	ECInfo          *ECInfo
}

Info groups object address with its FrostFS object info.

func (Info) String added in v0.40.0

func (v Info) String() string

type InnerRing added in v0.37.0

type InnerRing interface {
	InnerRingKeys() ([][]byte, error)
}

type LockSource

type LockSource interface {
	// IsLocked must clarify object's lock status.
	IsLocked(ctx context.Context, address oid.Address) (bool, error)
}

LockSource is a source of lock relations between the objects.

type SenderClassifier added in v0.37.0

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

func NewSenderClassifier added in v0.37.0

func NewSenderClassifier(innerRing InnerRing, netmap core.Source, log *logger.Logger) SenderClassifier

func (SenderClassifier) Classify added in v0.37.0

func (c SenderClassifier) Classify(
	ownerID *user.ID,
	ownerKey *keys.PublicKey,
	idCnr cid.ID,
	cnr container.Container,
) (res *ClassifyResult, err error)

func (SenderClassifier) IsInnerRingOrContainerNode added in v0.37.0

func (c SenderClassifier) IsInnerRingOrContainerNode(ownerKeyInBytes []byte, idCnr cid.ID, cnr container.Container) (*ClassifyResult, error)

Jump to

Keyboard shortcuts

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