2020-08-13 12:43:47 +00:00
|
|
|
package object
|
2020-08-12 19:06:10 +00:00
|
|
|
|
|
|
|
import (
|
2023-03-07 10:38:56 +00:00
|
|
|
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
|
|
|
session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
2020-08-12 19:06:10 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// SetKey sets key to the object attribute.
|
|
|
|
func (m *Header_Attribute) SetKey(v string) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Key = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetValue sets value of the object attribute.
|
|
|
|
func (m *Header_Attribute) SetValue(v string) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Value = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetParent sets identifier of the parent object.
|
|
|
|
func (m *Header_Split) SetParent(v *refs.ObjectID) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Parent = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetPrevious sets identifier of the previous object in split-chain.
|
|
|
|
func (m *Header_Split) SetPrevious(v *refs.ObjectID) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Previous = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetParentSignature sets signature of the parent object header.
|
2020-08-20 09:43:47 +00:00
|
|
|
func (m *Header_Split) SetParentSignature(v *refs.Signature) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.ParentSignature = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetParentHeader sets parent header structure.
|
|
|
|
func (m *Header_Split) SetParentHeader(v *Header) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.ParentHeader = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetChildren sets list of the identifiers of the child objects.
|
|
|
|
func (m *Header_Split) SetChildren(v []*refs.ObjectID) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Children = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2021-08-16 11:42:16 +00:00
|
|
|
// SetSplitId sets split ID of the object.
|
2020-11-24 17:12:45 +00:00
|
|
|
func (m *Header_Split) SetSplitId(v []byte) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.SplitId = v
|
2020-11-24 17:12:45 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 19:06:10 +00:00
|
|
|
// SetContainerId sets identifier of the container.
|
|
|
|
func (m *Header) SetContainerId(v *refs.ContainerID) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.ContainerId = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetOwnerId sets identifier of the object owner.
|
|
|
|
func (m *Header) SetOwnerId(v *refs.OwnerID) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.OwnerId = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetCreationEpoch sets creation epoch number.
|
|
|
|
func (m *Header) SetCreationEpoch(v uint64) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.CreationEpoch = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetVersion sets version of the object format.
|
2020-08-20 09:43:47 +00:00
|
|
|
func (m *Header) SetVersion(v *refs.Version) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Version = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetPayloadLength sets length of the object payload.
|
|
|
|
func (m *Header) SetPayloadLength(v uint64) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.PayloadLength = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetPayloadHash sets hash of the object payload.
|
2020-08-20 08:48:35 +00:00
|
|
|
func (m *Header) SetPayloadHash(v *refs.Checksum) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.PayloadHash = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetObjectType sets type of the object.
|
|
|
|
func (m *Header) SetObjectType(v ObjectType) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.ObjectType = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetHomomorphicHash sets homomorphic hash of the object payload.
|
2020-08-20 08:48:35 +00:00
|
|
|
func (m *Header) SetHomomorphicHash(v *refs.Checksum) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.HomomorphicHash = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetSessionToken sets session token.
|
2020-08-20 10:41:55 +00:00
|
|
|
func (m *Header) SetSessionToken(v *session.SessionToken) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.SessionToken = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetAttributes sets list of the object attributes.
|
|
|
|
func (m *Header) SetAttributes(v []*Header_Attribute) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Attributes = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetSplit sets split header.
|
|
|
|
func (m *Header) SetSplit(v *Header_Split) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Split = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetObjectId sets identifier of the object.
|
|
|
|
func (m *Object) SetObjectId(v *refs.ObjectID) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.ObjectId = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetSignature sets signature of the object identifier.
|
2020-08-20 09:43:47 +00:00
|
|
|
func (m *Object) SetSignature(v *refs.Signature) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Signature = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetHeader sets header of the object.
|
|
|
|
func (m *Object) SetHeader(v *Header) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Header = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetPayload sets payload bytes of the object.
|
|
|
|
func (m *Object) SetPayload(v []byte) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Payload = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
2020-08-17 17:26:25 +00:00
|
|
|
|
|
|
|
// SetVersion sets version of the object.
|
2020-08-20 09:43:47 +00:00
|
|
|
func (m *ShortHeader) SetVersion(v *refs.Version) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Version = v
|
2020-08-17 17:26:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetCreationEpoch sets creation epoch number.
|
|
|
|
func (m *ShortHeader) SetCreationEpoch(v uint64) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.CreationEpoch = v
|
2020-08-17 17:26:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetOwnerId sets identifier of the object owner.
|
|
|
|
func (m *ShortHeader) SetOwnerId(v *refs.OwnerID) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.OwnerId = v
|
2020-08-17 17:26:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetObjectType sets type of the object.
|
|
|
|
func (m *ShortHeader) SetObjectType(v ObjectType) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.ObjectType = v
|
2020-08-17 17:26:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetPayloadLength sets length of the object payload.
|
|
|
|
func (m *ShortHeader) SetPayloadLength(v uint64) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.PayloadLength = v
|
2020-08-17 17:26:25 +00:00
|
|
|
}
|
2020-12-02 10:10:43 +00:00
|
|
|
|
2020-12-17 10:18:07 +00:00
|
|
|
// SetPayloadHash sets hash of the object payload.
|
|
|
|
func (m *ShortHeader) SetPayloadHash(v *refs.Checksum) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.PayloadHash = v
|
2020-12-17 10:18:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetHomomorphicHash sets homomorphic hash of the object payload.
|
|
|
|
func (m *ShortHeader) SetHomomorphicHash(v *refs.Checksum) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.HomomorphicHash = v
|
2020-12-17 10:18:07 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 10:10:43 +00:00
|
|
|
// SetSplitId sets id of split hierarchy.
|
|
|
|
func (m *SplitInfo) SetSplitId(v []byte) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.SplitId = v
|
2020-12-02 10:10:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetLastPart sets id of most right child in split hierarchy.
|
|
|
|
func (m *SplitInfo) SetLastPart(v *refs.ObjectID) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.LastPart = v
|
2020-12-02 10:10:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetLink sets id of linking object in split hierarchy.
|
|
|
|
func (m *SplitInfo) SetLink(v *refs.ObjectID) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Link = v
|
2020-12-02 10:10:43 +00:00
|
|
|
}
|
2021-06-18 12:27:01 +00:00
|
|
|
|
|
|
|
// FromString parses ObjectType from a string representation,
|
|
|
|
// It is a reverse action to String().
|
|
|
|
//
|
|
|
|
// Returns true if s was parsed successfully.
|
|
|
|
func (x *ObjectType) FromString(s string) bool {
|
|
|
|
i, ok := ObjectType_value[s]
|
|
|
|
if ok {
|
|
|
|
*x = ObjectType(i)
|
|
|
|
}
|
|
|
|
|
|
|
|
return ok
|
|
|
|
}
|
|
|
|
|
|
|
|
// FromString parses MatchType from a string representation,
|
|
|
|
// It is a reverse action to String().
|
|
|
|
//
|
|
|
|
// Returns true if s was parsed successfully.
|
|
|
|
func (x *MatchType) FromString(s string) bool {
|
|
|
|
i, ok := MatchType_value[s]
|
|
|
|
if ok {
|
|
|
|
*x = MatchType(i)
|
|
|
|
}
|
|
|
|
|
|
|
|
return ok
|
|
|
|
}
|