object

package
v1.25.1-0...-2fdc35d Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AttributeName is an attribute key that is commonly used to denote
	// human-friendly name.
	AttributeName = "Name"

	// AttributeFileName is an attribute key that is commonly used to denote
	// file name to be associated with the object on saving.
	AttributeFileName = "FileName"

	// AttributeTimestamp is an attribute key that is commonly used to denote
	// user-defined local time of object creation in Unix Timestamp format.
	AttributeTimestamp = "Timestamp"

	// AttributeTimestamp is an attribute key that is commonly used to denote
	// MIME Content Type of object's payload.
	AttributeContentType = "Content-Type"
)

Variables

This section is empty.

Functions

func CalculateAndSetECDSASignature

func CalculateAndSetECDSASignature(key ecdsa.PrivateKey, obj *RawObject) error

CalculateAndSetECDSASignature calculates ECDSA signature of object ID and writes it to RawObject.

Key must not be nil.

func CalculateAndSetID

func CalculateAndSetID(obj *RawObject) error

CalculateAndSetID calculates identifier for the object and writes the result to it.

func CalculateAndSetPayloadChecksum

func CalculateAndSetPayloadChecksum(obj *RawObject)

CalculateAndSetPayloadChecksum calculates checksum of current object payload and writes it to the object.

func CalculateIDSignatureECDSA

func CalculateIDSignatureECDSA(key ecdsa.PrivateKey, id *ID) (*pkg.Signature, error)

CalculateIDSignatureECDSA calculates and returns ECDSA signature of ID.

Key must not be nil.

func CalculatePayloadChecksum

func CalculatePayloadChecksum(payload []byte) *pkg.Checksum

CalculatePayloadChecksum calculates and returns checksum of object payload bytes.

func CheckHeaderVerificationFields

func CheckHeaderVerificationFields(obj *Object) error

CheckHeaderVerificationFields checks all verification fields except payload.

func CheckVerificationFields

func CheckVerificationFields(obj *Object) error

CheckVerificationFields checks all verification fields of the object.

func SetIDWithSignatureECDSA

func SetIDWithSignatureECDSA(key ecdsa.PrivateKey, obj *RawObject) error

SetIDWithSignatureECDSA sets object identifier and ECDSA signature.

Key must not be nil.

func SetVerificationFieldsECDSA

func SetVerificationFieldsECDSA(key ecdsa.PrivateKey, obj *RawObject) error

SetVerificationFields calculates and sets all verification fields of the object.

Key must not be nil.

func VerifyID

func VerifyID(obj *Object) error

VerifyID checks if identifier in the object corresponds to its structure.

func VerifyIDSignature

func VerifyIDSignature(obj *Object) error

func VerifyPayloadChecksum

func VerifyPayloadChecksum(obj *Object) error

VerifyPayloadChecksum checks if payload checksum in the object corresponds to its payload.

Types

type Address

type Address refs.Address

Address represents v2-compatible object address.

func NewAddress

func NewAddress() *Address

NewAddress creates and initializes blank Address.

Works similar as NewAddressFromV2(new(Address)).

Defaults:

  • cid: nil;
  • oid: nil.

func NewAddressFromV2

func NewAddressFromV2(aV2 *refs.Address) *Address

NewAddressFromV2 converts v2 Address message to Address.

Nil refs.Address converts to nil.

func (*Address) ContainerID

func (a *Address) ContainerID() *cid.ID

ContainerID returns container identifier.

func (*Address) Marshal

func (a *Address) Marshal(b ...[]byte) ([]byte, error)

Marshal marshals Address into a protobuf binary form.

Buffer is allocated when the argument is empty. Otherwise, the first buffer is used.

func (*Address) MarshalJSON

func (a *Address) MarshalJSON() ([]byte, error)

MarshalJSON encodes Address to protobuf JSON format.

func (*Address) ObjectID

func (a *Address) ObjectID() *ID

ObjectID returns object identifier.

func (*Address) Parse

func (a *Address) Parse(s string) error

Parse converts base58 string representation into Address.

func (*Address) SetContainerID

func (a *Address) SetContainerID(id *cid.ID)

SetContainerID sets container identifier.

func (*Address) SetObjectID

func (a *Address) SetObjectID(id *ID)

SetObjectID sets object identifier.

func (*Address) String

func (a *Address) String() string

String returns string representation of Object.Address.

func (*Address) ToV2

func (a *Address) ToV2() *refs.Address

ToV2 converts Address to v2 Address message.

Nil Address converts to nil.

func (*Address) Unmarshal

func (a *Address) Unmarshal(data []byte) error

Unmarshal unmarshals protobuf binary representation of Address.

func (*Address) UnmarshalJSON

func (a *Address) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes Address from protobuf JSON format.

type Attribute

type Attribute object.Attribute

Attribute represents v2-compatible object attribute.

func NewAttribute

func NewAttribute() *Attribute

NewAttribute creates and initializes blank Attribute.

Works similar as NewAttributeFromV2(new(Attribute)).

Defaults:

  • key: "";
  • value: "".

func NewAttributeFromV2

func NewAttributeFromV2(aV2 *object.Attribute) *Attribute

NewAttributeFromV2 wraps v2 Attribute message to Attribute.

Nil object.Attribute converts to nil.

func (*Attribute) Key

func (a *Attribute) Key() string

Key returns key to the object attribute.

func (*Attribute) Marshal

func (a *Attribute) Marshal(b ...[]byte) ([]byte, error)

Marshal marshals Attribute into a protobuf binary form.

Buffer is allocated when the argument is empty. Otherwise, the first buffer is used.

func (*Attribute) MarshalJSON

func (a *Attribute) MarshalJSON() ([]byte, error)

MarshalJSON encodes Attribute to protobuf JSON format.

func (*Attribute) SetKey

func (a *Attribute) SetKey(v string)

SetKey sets key to the object attribute.

func (*Attribute) SetValue

func (a *Attribute) SetValue(v string)

SetValue sets value of the object attribute.

func (*Attribute) ToV2

func (a *Attribute) ToV2() *object.Attribute

ToV2 converts Attribute to v2 Attribute message.

Nil Attribute converts to nil.

func (*Attribute) Unmarshal

func (a *Attribute) Unmarshal(data []byte) error

Unmarshal unmarshals protobuf binary representation of Attribute.

func (*Attribute) UnmarshalJSON

func (a *Attribute) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes Attribute from protobuf JSON format.

func (*Attribute) Value

func (a *Attribute) Value() string

Value return value of the object attribute.

type ID

type ID refs.ObjectID

ID represents v2-compatible object identifier.

func CalculateID

func CalculateID(obj *Object) (*ID, error)

CalculateID calculates identifier for the object.

func NewID

func NewID() *ID

NewID creates and initializes blank ID.

Works similar as NewIDFromV2(new(ObjectID)).

Defaults:

  • value: nil.

func NewIDFromV2

func NewIDFromV2(idV2 *refs.ObjectID) *ID

NewIDFromV2 wraps v2 ObjectID message to ID.

Nil refs.ObjectID converts to nil.

func (*ID) Equal

func (id *ID) Equal(id2 *ID) bool

Equal returns true if identifiers are identical.

func (*ID) Marshal

func (id *ID) Marshal(b ...[]byte) ([]byte, error)

Marshal marshals ID into a protobuf binary form.

Buffer is allocated when the argument is empty. Otherwise, the first buffer is used.

func (*ID) MarshalJSON

func (id *ID) MarshalJSON() ([]byte, error)

MarshalJSON encodes ID to protobuf JSON format.

func (*ID) Parse

func (id *ID) Parse(s string) error

Parse converts base58 string representation into ID.

func (*ID) SetSHA256

func (id *ID) SetSHA256(v [sha256.Size]byte)

SetSHA256 sets object identifier value to SHA256 checksum.

func (*ID) String

func (id *ID) String() string

String returns base58 string representation of ID.

func (*ID) ToV2

func (id *ID) ToV2() *refs.ObjectID

ToV2 converts ID to v2 ObjectID message.

Nil ID converts to nil.

func (*ID) Unmarshal

func (id *ID) Unmarshal(data []byte) error

Unmarshal unmarshals protobuf binary representation of ID.

func (*ID) UnmarshalJSON

func (id *ID) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ID from protobuf JSON format.

type Object

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

Object represents v2-compatible NeoFS object that provides a convenient interface for working in isolation from the internal structure of an object.

Object allows to work with the object in read-only mode as a reflection of the immutability of objects in the system.

func New

func New() *Object

New creates and initializes blank Object.

Works similar as NewFromV2(new(Object)).

func NewFromV2

func NewFromV2(oV2 *object.Object) *Object

NewFromV2 wraps v2 Object message to Object.

func (Object) Attributes

func (o Object) Attributes() []*Attribute

Attributes returns object attributes.

func (Object) Children

func (o Object) Children() []*ID

Children return list of the identifiers of the child objects.

func (Object) ContainerID

func (o Object) ContainerID() *cid.ID

ContainerID returns identifier of the related container.

func (Object) CreationEpoch

func (o Object) CreationEpoch() uint64

CreationEpoch returns epoch number in which object was created.

func (Object) HasParent

func (o Object) HasParent() bool

func (Object) ID

func (o Object) ID() *ID

ID returns object identifier.

func (Object) Marshal

func (o Object) Marshal(b ...[]byte) ([]byte, error)

Marshal marshals object into a protobuf binary form.

Buffer is allocated when the argument is empty. Otherwise, the first buffer is used.

func (*Object) MarshalHeaderJSON

func (o *Object) MarshalHeaderJSON() ([]byte, error)

MarshalHeaderJSON marshals object's header into JSON format.

func (Object) MarshalJSON

func (o Object) MarshalJSON() ([]byte, error)

MarshalJSON encodes object to protobuf JSON format.

func (Object) OwnerID

func (o Object) OwnerID() *owner.ID

OwnerID returns identifier of the object owner.

func (Object) Parent

func (o Object) Parent() *Object

Parent returns parent object w/o payload.

func (Object) ParentID

func (o Object) ParentID() *ID

ParentID returns identifier of the parent object.

func (Object) Payload

func (o Object) Payload() []byte

Payload returns payload bytes.

func (Object) PayloadChecksum

func (o Object) PayloadChecksum() *pkg.Checksum

PayloadChecksum returns checksum of the object payload.

func (Object) PayloadHomomorphicHash

func (o Object) PayloadHomomorphicHash() *pkg.Checksum

PayloadHomomorphicHash returns homomorphic hash of the object payload.

func (Object) PayloadSize

func (o Object) PayloadSize() uint64

PayloadSize returns payload length of the object.

func (Object) PreviousID

func (o Object) PreviousID() *ID

PreviousID returns identifier of the previous sibling object.

func (Object) SessionToken

func (o Object) SessionToken() *session.Token

SessionToken returns token of the session within which object was created.

func (Object) Signature

func (o Object) Signature() *pkg.Signature

Signature returns signature of the object identifier.

func (Object) SplitID

func (o Object) SplitID() *SplitID

SplitID return split identity of split object. If object is not split returns nil.

func (*Object) ToV2

func (o *Object) ToV2() *object.Object

ToV2 converts Object to v2 Object message.

func (Object) Type

func (o Object) Type() Type

Type returns type of the object.

func (Object) Unmarshal

func (o Object) Unmarshal(data []byte) error

Unmarshal unmarshals protobuf binary representation of object.

func (Object) UnmarshalJSON

func (o Object) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes object from protobuf JSON format.

func (Object) Version

func (o Object) Version() *pkg.Version

Version returns version of the object.

type Range

type Range object.Range

Range represents v2-compatible object payload range.

func NewRange

func NewRange() *Range

NewRange creates and initializes blank Range.

Defaults:

  • offset: 0;
  • length: 0.

func NewRangeFromV2

func NewRangeFromV2(rV2 *object.Range) *Range

NewRangeFromV2 wraps v2 Range message to Range.

Nil object.Range converts to nil.

func (*Range) GetLength

func (r *Range) GetLength() uint64

GetLength returns payload range size.

func (*Range) GetOffset

func (r *Range) GetOffset() uint64

GetOffset sets payload range offset from start.

func (*Range) SetLength

func (r *Range) SetLength(v uint64)

SetLength sets payload range size.

func (*Range) SetOffset

func (r *Range) SetOffset(v uint64)

SetOffset gets payload range offset from start.

func (*Range) ToV2

func (r *Range) ToV2() *object.Range

ToV2 converts Range to v2 Range message.

Nil Range converts to nil.

type RawObject

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

RawObject represents v2-compatible NeoFS object that provides a convenient interface to fill in the fields of an object in isolation from its internal structure.

func NewRaw

func NewRaw() *RawObject

NewRaw creates and initializes blank RawObject.

Works similar as NewRawFromV2(new(Object)).

func NewRawFrom

func NewRawFrom(obj *Object) *RawObject

NewRawFrom wraps Object instance to RawObject.

func NewRawFromV2

func NewRawFromV2(oV2 *object.Object) *RawObject

NewRawFromV2 wraps v2 Object message to RawObject.

func (RawObject) Attributes

func (o RawObject) Attributes() []*Attribute

Attributes returns object attributes.

func (RawObject) Children

func (o RawObject) Children() []*ID

Children return list of the identifiers of the child objects.

func (RawObject) ContainerID

func (o RawObject) ContainerID() *cid.ID

ContainerID returns identifier of the related container.

func (RawObject) CreationEpoch

func (o RawObject) CreationEpoch() uint64

CreationEpoch returns epoch number in which object was created.

func (*RawObject) CutPayload

func (o *RawObject) CutPayload() *RawObject

CutPayload returns RawObject w/ empty payload.

Changes of non-payload fields affect source object.

func (RawObject) HasParent

func (o RawObject) HasParent() bool

func (RawObject) ID

func (o RawObject) ID() *ID

ID returns object identifier.

func (*RawObject) InitRelations

func (o *RawObject) InitRelations()

InitRelations initializes relation field.

func (RawObject) Marshal

func (o RawObject) Marshal(b ...[]byte) ([]byte, error)

Marshal marshals object into a protobuf binary form.

Buffer is allocated when the argument is empty. Otherwise, the first buffer is used.

func (RawObject) MarshalJSON

func (o RawObject) MarshalJSON() ([]byte, error)

MarshalJSON encodes object to protobuf JSON format.

func (*RawObject) Object

func (o *RawObject) Object() *Object

Object returns read-only object instance.

func (RawObject) OwnerID

func (o RawObject) OwnerID() *owner.ID

OwnerID returns identifier of the object owner.

func (RawObject) Parent

func (o RawObject) Parent() *Object

Parent returns parent object w/o payload.

func (RawObject) ParentID

func (o RawObject) ParentID() *ID

ParentID returns identifier of the parent object.

func (RawObject) Payload

func (o RawObject) Payload() []byte

Payload returns payload bytes.

func (RawObject) PayloadChecksum

func (o RawObject) PayloadChecksum() *pkg.Checksum

PayloadChecksum returns checksum of the object payload.

func (RawObject) PayloadHomomorphicHash

func (o RawObject) PayloadHomomorphicHash() *pkg.Checksum

PayloadHomomorphicHash returns homomorphic hash of the object payload.

func (RawObject) PayloadSize

func (o RawObject) PayloadSize() uint64

PayloadSize returns payload length of the object.

func (RawObject) PreviousID

func (o RawObject) PreviousID() *ID

PreviousID returns identifier of the previous sibling object.

func (*RawObject) ResetRelations

func (o *RawObject) ResetRelations()

ResetRelations removes all fields of links with other objects.

func (RawObject) SessionToken

func (o RawObject) SessionToken() *session.Token

SessionToken returns token of the session within which object was created.

func (*RawObject) SetAttributes

func (o *RawObject) SetAttributes(v ...*Attribute)

SetAttributes sets object attributes.

func (*RawObject) SetChildren

func (o *RawObject) SetChildren(v ...*ID)

SetChildren sets list of the identifiers of the child objects.

func (*RawObject) SetContainerID

func (o *RawObject) SetContainerID(v *cid.ID)

SetContainerID sets identifier of the related container.

func (*RawObject) SetCreationEpoch

func (o *RawObject) SetCreationEpoch(v uint64)

SetCreationEpoch sets epoch number in which object was created.

func (*RawObject) SetID

func (o *RawObject) SetID(v *ID)

SetID sets object identifier.

func (*RawObject) SetOwnerID

func (o *RawObject) SetOwnerID(v *owner.ID)

SetOwnerID sets identifier of the object owner.

func (*RawObject) SetParent

func (o *RawObject) SetParent(v *Object)

SetParent sets parent object w/o payload.

func (*RawObject) SetParentID

func (o *RawObject) SetParentID(v *ID)

SetParentID sets identifier of the parent object.

func (*RawObject) SetPayload

func (o *RawObject) SetPayload(v []byte)

SetPayload sets payload bytes.

func (*RawObject) SetPayloadChecksum

func (o *RawObject) SetPayloadChecksum(v *pkg.Checksum)

SetPayloadChecksum sets checksum of the object payload.

func (*RawObject) SetPayloadHomomorphicHash

func (o *RawObject) SetPayloadHomomorphicHash(v *pkg.Checksum)

SetPayloadHomomorphicHash sets homomorphic hash of the object payload.

func (*RawObject) SetPayloadSize

func (o *RawObject) SetPayloadSize(v uint64)

SetPayloadSize sets payload length of the object.

func (*RawObject) SetPreviousID

func (o *RawObject) SetPreviousID(v *ID)

SetPreviousID sets identifier of the previous sibling object.

func (*RawObject) SetSessionToken

func (o *RawObject) SetSessionToken(v *session.Token)

SetSessionToken sets token of the session within which object was created.

func (*RawObject) SetSignature

func (o *RawObject) SetSignature(v *pkg.Signature)

SetSignature sets signature of the object identifier.

func (*RawObject) SetSplitID

func (o *RawObject) SetSplitID(id *SplitID)

SetSplitID sets split identifier for the split object.

func (*RawObject) SetType

func (o *RawObject) SetType(v Type)

SetType sets type of the object.

func (*RawObject) SetVersion

func (o *RawObject) SetVersion(v *pkg.Version)

SetVersion sets version of the object.

func (RawObject) Signature

func (o RawObject) Signature() *pkg.Signature

Signature returns signature of the object identifier.

func (RawObject) SplitID

func (o RawObject) SplitID() *SplitID

SplitID return split identity of split object. If object is not split returns nil.

func (RawObject) ToV2

func (o RawObject) ToV2() *object.Object

ToV2 converts Object to v2 Object message.

func (RawObject) Type

func (o RawObject) Type() Type

Type returns type of the object.

func (RawObject) Unmarshal

func (o RawObject) Unmarshal(data []byte) error

Unmarshal unmarshals protobuf binary representation of object.

func (RawObject) UnmarshalJSON

func (o RawObject) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes object from protobuf JSON format.

func (RawObject) Version

func (o RawObject) Version() *pkg.Version

Version returns version of the object.

type SearchFilter

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

func (*SearchFilter) Header

func (f *SearchFilter) Header() string

func (*SearchFilter) Operation

func (f *SearchFilter) Operation() SearchMatchType

func (*SearchFilter) Value

func (f *SearchFilter) Value() string

type SearchFilters

type SearchFilters []SearchFilter

func NewSearchFilters

func NewSearchFilters() SearchFilters

func NewSearchFiltersFromV2

func NewSearchFiltersFromV2(v2 []*v2object.SearchFilter) SearchFilters

func (*SearchFilters) AddFilter

func (f *SearchFilters) AddFilter(header, value string, op SearchMatchType)

func (*SearchFilters) AddObjectContainerIDFilter

func (f *SearchFilters) AddObjectContainerIDFilter(m SearchMatchType, id *cid.ID)

func (*SearchFilters) AddObjectIDFilter

func (f *SearchFilters) AddObjectIDFilter(m SearchMatchType, id *ID)

AddObjectIDFilter adds filter by object identifier.

func (*SearchFilters) AddObjectOwnerIDFilter

func (f *SearchFilters) AddObjectOwnerIDFilter(m SearchMatchType, id *owner.ID)

func (*SearchFilters) AddObjectVersionFilter

func (f *SearchFilters) AddObjectVersionFilter(op SearchMatchType, v *pkg.Version)

func (*SearchFilters) AddParentIDFilter

func (f *SearchFilters) AddParentIDFilter(m SearchMatchType, id *ID)

AddParentIDFilter adds filter by parent identifier.

func (*SearchFilters) AddPhyFilter

func (f *SearchFilters) AddPhyFilter()

func (*SearchFilters) AddRootFilter

func (f *SearchFilters) AddRootFilter()

func (*SearchFilters) AddSplitIDFilter

func (f *SearchFilters) AddSplitIDFilter(m SearchMatchType, id *SplitID)

func (*SearchFilters) AddTypeFilter

func (f *SearchFilters) AddTypeFilter(m SearchMatchType, typ Type)

AddTypeFilter adds filter by object type.

func (*SearchFilters) MarshalJSON

func (f *SearchFilters) MarshalJSON() ([]byte, error)

MarshalJSON encodes SearchFilters to protobuf JSON format.

func (SearchFilters) ToV2

func (f SearchFilters) ToV2() []*v2object.SearchFilter

func (*SearchFilters) UnmarshalJSON

func (f *SearchFilters) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes SearchFilters from protobuf JSON format.

type SearchMatchType

type SearchMatchType uint32

SearchMatchType indicates match operation on specified header.

const (
	MatchUnknown SearchMatchType = iota
	MatchStringEqual
	MatchStringNotEqual
	MatchNotPresent
)

func SearchMatchFromV2

func SearchMatchFromV2(t v2object.MatchType) (m SearchMatchType)

func (*SearchMatchType) FromString

func (m *SearchMatchType) FromString(s string) bool

FromString parses SearchMatchType from a string representation. It is a reverse action to String().

Returns true if s was parsed successfully.

func (SearchMatchType) String

func (m SearchMatchType) String() string

String returns string representation of SearchMatchType.

String mapping:

  • MatchStringEqual: STRING_EQUAL;
  • MatchStringNotEqual: STRING_NOT_EQUAL;
  • MatchNotPresent: NOT_PRESENT;
  • MatchUnknown, default: MATCH_TYPE_UNSPECIFIED.

func (SearchMatchType) ToV2

type SplitID

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

SplitID is a UUIDv4 used as attribute in split objects.

func NewSplitID

func NewSplitID() *SplitID

NewSplitID returns UUID representation of splitID attribute.

Defaults:

  • id: random UUID.

func NewSplitIDFromV2

func NewSplitIDFromV2(v []byte) *SplitID

NewSplitIDFromV2 returns parsed UUID from bytes. If v is invalid UUIDv4 byte sequence, then function returns nil.

Nil converts to nil.

func (*SplitID) Parse

func (id *SplitID) Parse(s string) (err error)

Parse converts UUIDv4 string representation into SplitID.

func (*SplitID) SetUUID

func (id *SplitID) SetUUID(v uuid.UUID)

SetUUID sets pre created UUID structure as SplitID.

func (*SplitID) String

func (id *SplitID) String() string

String returns UUIDv4 string representation of SplitID.

func (*SplitID) ToV2

func (id *SplitID) ToV2() []byte

ToV2 converts SplitID to a representation of SplitID in neofs-api v2.

Nil SplitID converts to nil.

type SplitInfo

type SplitInfo object.SplitInfo

func NewSplitInfo

func NewSplitInfo() *SplitInfo

NewSplitInfo creates and initializes blank SplitInfo.

Defaults:

  • splitID: nil;
  • lastPart nil;
  • link: nil.

func NewSplitInfoFromV2

func NewSplitInfoFromV2(v2 *object.SplitInfo) *SplitInfo

NewSplitInfoFromV2 wraps v2 SplitInfo message to SplitInfo.

Nil object.SplitInfo converts to nil.

func (*SplitInfo) LastPart

func (s *SplitInfo) LastPart() *ID
func (s *SplitInfo) Link() *ID

func (*SplitInfo) Marshal

func (s *SplitInfo) Marshal(b ...[]byte) ([]byte, error)

func (*SplitInfo) SetLastPart

func (s *SplitInfo) SetLastPart(v *ID)
func (s *SplitInfo) SetLink(v *ID)

func (*SplitInfo) SetSplitID

func (s *SplitInfo) SetSplitID(v *SplitID)

func (*SplitInfo) SplitID

func (s *SplitInfo) SplitID() *SplitID

func (*SplitInfo) ToV2

func (s *SplitInfo) ToV2() *object.SplitInfo

ToV2 converts SplitInfo to v2 SplitInfo message.

Nil SplitInfo converts to nil.

func (*SplitInfo) Unmarshal

func (s *SplitInfo) Unmarshal(data []byte) error

type SplitInfoError

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

func NewSplitInfoError

func NewSplitInfoError(v *SplitInfo) *SplitInfoError

func (*SplitInfoError) Error

func (s *SplitInfoError) Error() string

func (*SplitInfoError) SplitInfo

func (s *SplitInfoError) SplitInfo() *SplitInfo

type Tombstone

type Tombstone tombstone.Tombstone

Tombstone represents v2-compatible tombstone structure.

func NewTombstone

func NewTombstone() *Tombstone

NewTombstone creates and initializes blank Tombstone.

Defaults:

  • exp: 0;
  • splitID: nil;
  • members: nil.

func NewTombstoneFromV2

func NewTombstoneFromV2(tV2 *tombstone.Tombstone) *Tombstone

NewTombstoneFromV2 wraps v2 Tombstone message to Tombstone.

Nil tombstone.Tombstone converts to nil.

func (*Tombstone) ExpirationEpoch

func (t *Tombstone) ExpirationEpoch() uint64

ExpirationEpoch return number of tombstone expiration epoch.

func (*Tombstone) Marshal

func (t *Tombstone) Marshal(b ...[]byte) ([]byte, error)

Marshal marshals Tombstone into a protobuf binary form.

Buffer is allocated when the argument is empty. Otherwise, the first buffer is used.

func (*Tombstone) MarshalJSON

func (t *Tombstone) MarshalJSON() ([]byte, error)

MarshalJSON encodes Tombstone to protobuf JSON format.

func (*Tombstone) Members

func (t *Tombstone) Members() []*ID

Members returns list of objects to be deleted.

func (*Tombstone) SetExpirationEpoch

func (t *Tombstone) SetExpirationEpoch(v uint64)

SetExpirationEpoch sets number of tombstone expiration epoch.

func (*Tombstone) SetMembers

func (t *Tombstone) SetMembers(v []*ID)

SetMembers sets list of objects to be deleted.

func (*Tombstone) SetSplitID

func (t *Tombstone) SetSplitID(v *SplitID)

SetSplitID sets identifier of object split hierarchy.

func (*Tombstone) SplitID

func (t *Tombstone) SplitID() *SplitID

SplitID returns identifier of object split hierarchy.

func (*Tombstone) ToV2

func (ts *Tombstone) ToV2() *tombstone.Tombstone

ToV2 converts Tombstone to v2 Tombstone message.

Nil Tombstone converts to nil.

func (*Tombstone) Unmarshal

func (t *Tombstone) Unmarshal(data []byte) error

Unmarshal unmarshals protobuf binary representation of Tombstone.

func (*Tombstone) UnmarshalJSON

func (t *Tombstone) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes Tombstone from protobuf JSON format.

type Type

type Type uint8
const (
	TypeRegular Type = iota
	TypeTombstone
	TypeStorageGroup
)

func TypeFromString deprecated

func TypeFromString(s string) (t Type)

TypeFromString parses Type from its string representation.

Deprecated: use FromString method.

func TypeFromV2

func TypeFromV2(t object.Type) Type

func (*Type) FromString

func (t *Type) FromString(s string) bool

FromString parses Type from a string representation. It is a reverse action to String().

Returns true if s was parsed successfully.

func (Type) String

func (t Type) String() string

String returns string representation of Type.

String mapping:

  • TypeTombstone: TOMBSTONE;
  • TypeStorageGroup: STORAGE_GROUP;
  • TypeRegular, default: REGULAR.

func (Type) ToV2

func (t Type) ToV2() object.Type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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