github.com/TrueCloudLab/frostfs-api-go/v2@v2.0.0-20230228134343-196241c4e79a/netmap/grpc/types.go (about) 1 package netmap 2 3 import refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" 4 5 // SetReplicas of placement policy. 6 func (m *PlacementPolicy) SetReplicas(v []*Replica) { 7 m.Replicas = v 8 } 9 10 // SetContainerBackupFactor of placement policy. 11 func (m *PlacementPolicy) SetContainerBackupFactor(v uint32) { 12 m.ContainerBackupFactor = v 13 } 14 15 // SetSelectors of placement policy. 16 func (m *PlacementPolicy) SetSelectors(v []*Selector) { 17 m.Selectors = v 18 } 19 20 // SetFilters of placement policy. 21 func (m *PlacementPolicy) SetFilters(v []*Filter) { 22 m.Filters = v 23 } 24 25 // SetSubnetID sets ID of subnet. 26 func (m *PlacementPolicy) SetSubnetID(v *refs.SubnetID) { 27 m.SubnetId = v 28 } 29 30 // SetName of placement filter. 31 func (m *Filter) SetName(v string) { 32 m.Name = v 33 } 34 35 // SetKey of placement filter. 36 func (m *Filter) SetKey(v string) { 37 m.Key = v 38 } 39 40 // SetOperation of placement filter. 41 func (m *Filter) SetOp(v Operation) { 42 m.Op = v 43 } 44 45 // SetValue of placement filter. 46 func (m *Filter) SetValue(v string) { 47 m.Value = v 48 } 49 50 // SetFilters sets sub-filters of placement filter. 51 func (m *Filter) SetFilters(v []*Filter) { 52 m.Filters = v 53 } 54 55 // SetName of placement selector. 56 func (m *Selector) SetName(v string) { 57 m.Name = v 58 } 59 60 // SetCount of nodes of placement selector. 61 func (m *Selector) SetCount(v uint32) { 62 m.Count = v 63 } 64 65 // SetAttribute of nodes of placement selector. 66 func (m *Selector) SetAttribute(v string) { 67 m.Attribute = v 68 } 69 70 // SetFilter of placement selector. 71 func (m *Selector) SetFilter(v string) { 72 m.Filter = v 73 } 74 75 // SetClause of placement selector. 76 func (m *Selector) SetClause(v Clause) { 77 m.Clause = v 78 } 79 80 // SetCount of object replica. 81 func (m *Replica) SetCount(v uint32) { 82 m.Count = v 83 } 84 85 // SetSelector of object replica. 86 func (m *Replica) SetSelector(v string) { 87 m.Selector = v 88 } 89 90 // SetKey sets key to the node attribute. 91 func (m *NodeInfo_Attribute) SetKey(v string) { 92 m.Key = v 93 } 94 95 // SetValue sets value of the node attribute. 96 func (m *NodeInfo_Attribute) SetValue(v string) { 97 m.Value = v 98 } 99 100 // SetParent sets value of the node parents. 101 func (m *NodeInfo_Attribute) SetParents(v []string) { 102 m.Parents = v 103 } 104 105 // SetAddress sets node network address. 106 // 107 // Deprecated: use SetAddresses. 108 func (m *NodeInfo) SetAddress(v string) { 109 m.SetAddresses([]string{v}) 110 } 111 112 // SetAddresses sets list of network addresses of the node. 113 func (m *NodeInfo) SetAddresses(v []string) { 114 m.Addresses = v 115 } 116 117 // SetPublicKey sets node public key in a binary format. 118 func (m *NodeInfo) SetPublicKey(v []byte) { 119 m.PublicKey = v 120 } 121 122 // SetAttributes sets list of the node attributes. 123 func (m *NodeInfo) SetAttributes(v []*NodeInfo_Attribute) { 124 m.Attributes = v 125 } 126 127 // SetState sets node state. 128 func (m *NodeInfo) SetState(v NodeInfo_State) { 129 m.State = v 130 } 131 132 // SetCurrentEpoch sets number of the current epoch. 133 func (x *NetworkInfo) SetCurrentEpoch(v uint64) { 134 x.CurrentEpoch = v 135 } 136 137 // SetMagicNumber sets magic number of the sidechain. 138 func (x *NetworkInfo) SetMagicNumber(v uint64) { 139 x.MagicNumber = v 140 } 141 142 // SetMsPerBlock sets MillisecondsPerBlock network parameter. 143 func (x *NetworkInfo) SetMsPerBlock(v int64) { 144 x.MsPerBlock = v 145 } 146 147 // SetNetworkConfig sets NeoFS network configuration. 148 func (x *NetworkInfo) SetNetworkConfig(v *NetworkConfig) { 149 x.NetworkConfig = v 150 } 151 152 // FromString parses Clause from a string representation, 153 // It is a reverse action to String(). 154 // 155 // Returns true if s was parsed successfully. 156 func (x *Clause) FromString(s string) bool { 157 i, ok := Clause_value[s] 158 if ok { 159 *x = Clause(i) 160 } 161 162 return ok 163 } 164 165 // FromString parses Operation from a string representation, 166 // It is a reverse action to String(). 167 // 168 // Returns true if s was parsed successfully. 169 func (x *Operation) FromString(s string) bool { 170 i, ok := Operation_value[s] 171 if ok { 172 *x = Operation(i) 173 } 174 175 return ok 176 } 177 178 // FromString parses NodeInfo_State from a string representation, 179 // It is a reverse action to String(). 180 // 181 // Returns true if s was parsed successfully. 182 func (x *NodeInfo_State) FromString(s string) bool { 183 i, ok := NodeInfo_State_value[s] 184 if ok { 185 *x = NodeInfo_State(i) 186 } 187 188 return ok 189 } 190 191 // SetKey sets parameter key. 192 func (x *NetworkConfig_Parameter) SetKey(v []byte) { 193 x.Key = v 194 } 195 196 // SetValue sets parameter value. 197 func (x *NetworkConfig_Parameter) SetValue(v []byte) { 198 x.Value = v 199 } 200 201 // SetParameters sets NeoFS network parameters. 202 func (x *NetworkConfig) SetParameters(v []*NetworkConfig_Parameter) { 203 x.Parameters = v 204 } 205 206 // SetEpoch sets revision number of the Netmap. 207 func (x *Netmap) SetEpoch(v uint64) { 208 x.Epoch = v 209 } 210 211 // SetNodes sets nodes presented in the Netmap. 212 func (x *Netmap) SetNodes(v []*NodeInfo) { 213 x.Nodes = v 214 }