github.com/TrueCloudLab/frostfs-api-go/v2@v2.0.0-20230228134343-196241c4e79a/refs/grpc/types.go (about) 1 package refs 2 3 // SetValue sets container identifier in a binary format. 4 func (x *ContainerID) SetValue(v []byte) { 5 x.Value = v 6 } 7 8 // SetValue sets object identifier in a binary format. 9 func (x *ObjectID) SetValue(v []byte) { 10 x.Value = v 11 } 12 13 // SetValue sets owner identifier in a binary format. 14 func (x *OwnerID) SetValue(v []byte) { 15 x.Value = v 16 } 17 18 // SetContainerId sets container identifier of the address. 19 func (x *Address) SetContainerId(v *ContainerID) { 20 x.ContainerId = v 21 } 22 23 // SetObjectId sets object identifier of the address. 24 func (x *Address) SetObjectId(v *ObjectID) { 25 x.ObjectId = v 26 } 27 28 // SetChecksumType in generic checksum structure. 29 func (x *Checksum) SetChecksumType(v ChecksumType) { 30 x.Type = v 31 } 32 33 // SetSum in generic checksum structure. 34 func (x *Checksum) SetSum(v []byte) { 35 x.Sum = v 36 } 37 38 // SetMajor sets major version number. 39 func (x *Version) SetMajor(v uint32) { 40 x.Major = v 41 } 42 43 // SetMinor sets minor version number. 44 func (x *Version) SetMinor(v uint32) { 45 x.Minor = v 46 } 47 48 // SetKey sets public key in a binary format. 49 func (x *Signature) SetKey(v []byte) { 50 x.Key = v 51 } 52 53 // SetSign sets signature. 54 func (x *Signature) SetSign(v []byte) { 55 x.Sign = v 56 } 57 58 // SetScheme sets signature scheme. 59 func (x *Signature) SetScheme(s SignatureScheme) { 60 x.Scheme = s 61 } 62 63 // SetKey sets public key in a binary format. 64 func (x *SignatureRFC6979) SetKey(v []byte) { 65 x.Key = v 66 } 67 68 // SetSign sets signature. 69 func (x *SignatureRFC6979) SetSign(v []byte) { 70 x.Sign = v 71 } 72 73 // FromString parses SignatureScheme from a string representation, 74 // It is a reverse action to String(). 75 // 76 // Returns true if s was parsed successfully. 77 func (x *SignatureScheme) FromString(s string) bool { 78 i, ok := SignatureScheme_value[s] 79 if ok { 80 *x = SignatureScheme(i) 81 } 82 83 return ok 84 } 85 86 // FromString parses ChecksumType from a string representation, 87 // It is a reverse action to String(). 88 // 89 // Returns true if s was parsed successfully. 90 func (x *ChecksumType) FromString(s string) bool { 91 i, ok := ChecksumType_value[s] 92 if ok { 93 *x = ChecksumType(i) 94 } 95 96 return ok 97 } 98 99 // SetValue sets subnet identifier in a base-10 integer format. 100 func (x *SubnetID) SetValue(v uint32) { 101 x.Value = v 102 }