github.com/TrueCloudLab/frostfs-api-go/v2@v2.0.0-20230228134343-196241c4e79a/object/grpc/types.go (about) 1 package object 2 3 import ( 4 refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" 5 session "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" 6 ) 7 8 // SetKey sets key to the object attribute. 9 func (m *Header_Attribute) SetKey(v string) { 10 m.Key = v 11 } 12 13 // SetValue sets value of the object attribute. 14 func (m *Header_Attribute) SetValue(v string) { 15 m.Value = v 16 } 17 18 // SetParent sets identifier of the parent object. 19 func (m *Header_Split) SetParent(v *refs.ObjectID) { 20 m.Parent = v 21 } 22 23 // SetPrevious sets identifier of the previous object in split-chain. 24 func (m *Header_Split) SetPrevious(v *refs.ObjectID) { 25 m.Previous = v 26 } 27 28 // SetParentSignature sets signature of the parent object header. 29 func (m *Header_Split) SetParentSignature(v *refs.Signature) { 30 m.ParentSignature = v 31 } 32 33 // SetParentHeader sets parent header structure. 34 func (m *Header_Split) SetParentHeader(v *Header) { 35 m.ParentHeader = v 36 } 37 38 // SetChildren sets list of the identifiers of the child objects. 39 func (m *Header_Split) SetChildren(v []*refs.ObjectID) { 40 m.Children = v 41 } 42 43 // SetSplitId sets split ID of the object. 44 func (m *Header_Split) SetSplitId(v []byte) { 45 m.SplitId = v 46 } 47 48 // SetContainerId sets identifier of the container. 49 func (m *Header) SetContainerId(v *refs.ContainerID) { 50 m.ContainerId = v 51 } 52 53 // SetOwnerId sets identifier of the object owner. 54 func (m *Header) SetOwnerId(v *refs.OwnerID) { 55 m.OwnerId = v 56 } 57 58 // SetCreationEpoch sets creation epoch number. 59 func (m *Header) SetCreationEpoch(v uint64) { 60 m.CreationEpoch = v 61 } 62 63 // SetVersion sets version of the object format. 64 func (m *Header) SetVersion(v *refs.Version) { 65 m.Version = v 66 } 67 68 // SetPayloadLength sets length of the object payload. 69 func (m *Header) SetPayloadLength(v uint64) { 70 m.PayloadLength = v 71 } 72 73 // SetPayloadHash sets hash of the object payload. 74 func (m *Header) SetPayloadHash(v *refs.Checksum) { 75 m.PayloadHash = v 76 } 77 78 // SetObjectType sets type of the object. 79 func (m *Header) SetObjectType(v ObjectType) { 80 m.ObjectType = v 81 } 82 83 // SetHomomorphicHash sets homomorphic hash of the object payload. 84 func (m *Header) SetHomomorphicHash(v *refs.Checksum) { 85 m.HomomorphicHash = v 86 } 87 88 // SetSessionToken sets session token. 89 func (m *Header) SetSessionToken(v *session.SessionToken) { 90 m.SessionToken = v 91 } 92 93 // SetAttributes sets list of the object attributes. 94 func (m *Header) SetAttributes(v []*Header_Attribute) { 95 m.Attributes = v 96 } 97 98 // SetSplit sets split header. 99 func (m *Header) SetSplit(v *Header_Split) { 100 m.Split = v 101 } 102 103 // SetObjectId sets identifier of the object. 104 func (m *Object) SetObjectId(v *refs.ObjectID) { 105 m.ObjectId = v 106 } 107 108 // SetSignature sets signature of the object identifier. 109 func (m *Object) SetSignature(v *refs.Signature) { 110 m.Signature = v 111 } 112 113 // SetHeader sets header of the object. 114 func (m *Object) SetHeader(v *Header) { 115 m.Header = v 116 } 117 118 // SetPayload sets payload bytes of the object. 119 func (m *Object) SetPayload(v []byte) { 120 m.Payload = v 121 } 122 123 // SetVersion sets version of the object. 124 func (m *ShortHeader) SetVersion(v *refs.Version) { 125 m.Version = v 126 } 127 128 // SetCreationEpoch sets creation epoch number. 129 func (m *ShortHeader) SetCreationEpoch(v uint64) { 130 m.CreationEpoch = v 131 } 132 133 // SetOwnerId sets identifier of the object owner. 134 func (m *ShortHeader) SetOwnerId(v *refs.OwnerID) { 135 m.OwnerId = v 136 } 137 138 // SetObjectType sets type of the object. 139 func (m *ShortHeader) SetObjectType(v ObjectType) { 140 m.ObjectType = v 141 } 142 143 // SetPayloadLength sets length of the object payload. 144 func (m *ShortHeader) SetPayloadLength(v uint64) { 145 m.PayloadLength = v 146 } 147 148 // SetPayloadHash sets hash of the object payload. 149 func (m *ShortHeader) SetPayloadHash(v *refs.Checksum) { 150 m.PayloadHash = v 151 } 152 153 // SetHomomorphicHash sets homomorphic hash of the object payload. 154 func (m *ShortHeader) SetHomomorphicHash(v *refs.Checksum) { 155 m.HomomorphicHash = v 156 } 157 158 // SetSplitId sets id of split hierarchy. 159 func (m *SplitInfo) SetSplitId(v []byte) { 160 m.SplitId = v 161 } 162 163 // SetLastPart sets id of most right child in split hierarchy. 164 func (m *SplitInfo) SetLastPart(v *refs.ObjectID) { 165 m.LastPart = v 166 } 167 168 // SetLink sets id of linking object in split hierarchy. 169 func (m *SplitInfo) SetLink(v *refs.ObjectID) { 170 m.Link = v 171 } 172 173 // FromString parses ObjectType from a string representation, 174 // It is a reverse action to String(). 175 // 176 // Returns true if s was parsed successfully. 177 func (x *ObjectType) FromString(s string) bool { 178 i, ok := ObjectType_value[s] 179 if ok { 180 *x = ObjectType(i) 181 } 182 183 return ok 184 } 185 186 // FromString parses MatchType from a string representation, 187 // It is a reverse action to String(). 188 // 189 // Returns true if s was parsed successfully. 190 func (x *MatchType) FromString(s string) bool { 191 i, ok := MatchType_value[s] 192 if ok { 193 *x = MatchType(i) 194 } 195 196 return ok 197 }