2020-08-13 12:43:47 +00:00
|
|
|
package netmap
|
2020-08-12 19:06:10 +00:00
|
|
|
|
2023-03-07 10:38:56 +00:00
|
|
|
import refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
2021-12-01 13:42:31 +00:00
|
|
|
|
2020-09-04 08:47:15 +00:00
|
|
|
// SetReplicas of placement policy.
|
|
|
|
func (m *PlacementPolicy) SetReplicas(v []*Replica) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Replicas = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2020-09-04 08:47:15 +00:00
|
|
|
// SetContainerBackupFactor of placement policy.
|
|
|
|
func (m *PlacementPolicy) SetContainerBackupFactor(v uint32) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.ContainerBackupFactor = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2020-09-04 08:47:15 +00:00
|
|
|
// SetSelectors of placement policy.
|
|
|
|
func (m *PlacementPolicy) SetSelectors(v []*Selector) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Selectors = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2020-09-04 08:47:15 +00:00
|
|
|
// SetFilters of placement policy.
|
|
|
|
func (m *PlacementPolicy) SetFilters(v []*Filter) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Filters = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2021-12-01 13:42:31 +00:00
|
|
|
// SetSubnetID sets ID of subnet.
|
|
|
|
func (m *PlacementPolicy) SetSubnetID(v *refs.SubnetID) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.SubnetId = v
|
2021-12-01 13:42:31 +00:00
|
|
|
}
|
|
|
|
|
2020-09-04 08:47:15 +00:00
|
|
|
// SetName of placement filter.
|
|
|
|
func (m *Filter) SetName(v string) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Name = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2020-09-04 08:47:15 +00:00
|
|
|
// SetKey of placement filter.
|
|
|
|
func (m *Filter) SetKey(v string) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Key = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2020-09-04 08:47:15 +00:00
|
|
|
// SetOperation of placement filter.
|
|
|
|
func (m *Filter) SetOp(v Operation) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Op = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2020-09-04 08:47:15 +00:00
|
|
|
// SetValue of placement filter.
|
|
|
|
func (m *Filter) SetValue(v string) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Value = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2020-09-04 08:47:15 +00:00
|
|
|
// SetFilters sets sub-filters of placement filter.
|
|
|
|
func (m *Filter) SetFilters(v []*Filter) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Filters = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2020-09-04 08:47:15 +00:00
|
|
|
// SetName of placement selector.
|
|
|
|
func (m *Selector) SetName(v string) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Name = v
|
2020-09-04 08:47:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetCount of nodes of placement selector.
|
|
|
|
func (m *Selector) SetCount(v uint32) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Count = v
|
2020-09-04 08:47:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetAttribute of nodes of placement selector.
|
|
|
|
func (m *Selector) SetAttribute(v string) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Attribute = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2020-09-04 08:47:15 +00:00
|
|
|
// SetFilter of placement selector.
|
|
|
|
func (m *Selector) SetFilter(v string) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Filter = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2020-09-08 10:19:22 +00:00
|
|
|
// SetClause of placement selector.
|
|
|
|
func (m *Selector) SetClause(v Clause) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Clause = v
|
2020-09-08 10:19:22 +00:00
|
|
|
}
|
|
|
|
|
2020-09-04 08:47:15 +00:00
|
|
|
// SetCount of object replica.
|
|
|
|
func (m *Replica) SetCount(v uint32) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Count = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2020-09-04 08:47:15 +00:00
|
|
|
// SetSelector of object replica.
|
|
|
|
func (m *Replica) SetSelector(v string) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Selector = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetKey sets key to the node attribute.
|
|
|
|
func (m *NodeInfo_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 node attribute.
|
|
|
|
func (m *NodeInfo_Attribute) SetValue(v string) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Value = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2020-09-04 08:47:15 +00:00
|
|
|
// SetParent sets value of the node parents.
|
|
|
|
func (m *NodeInfo_Attribute) SetParents(v []string) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Parents = v
|
2020-09-04 08:47:15 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 19:06:10 +00:00
|
|
|
// SetAddress sets node network address.
|
2021-06-18 16:08:55 +00:00
|
|
|
//
|
|
|
|
// Deprecated: use SetAddresses.
|
2020-08-12 19:06:10 +00:00
|
|
|
func (m *NodeInfo) SetAddress(v string) {
|
2021-06-18 16:08:55 +00:00
|
|
|
m.SetAddresses([]string{v})
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetAddresses sets list of network addresses of the node.
|
|
|
|
func (m *NodeInfo) SetAddresses(v []string) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Addresses = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetPublicKey sets node public key in a binary format.
|
|
|
|
func (m *NodeInfo) SetPublicKey(v []byte) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.PublicKey = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetAttributes sets list of the node attributes.
|
|
|
|
func (m *NodeInfo) SetAttributes(v []*NodeInfo_Attribute) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Attributes = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetState sets node state.
|
|
|
|
func (m *NodeInfo) SetState(v NodeInfo_State) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.State = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
2021-02-17 17:02:02 +00:00
|
|
|
|
|
|
|
// SetCurrentEpoch sets number of the current epoch.
|
|
|
|
func (x *NetworkInfo) SetCurrentEpoch(v uint64) {
|
2022-03-23 11:42:57 +00:00
|
|
|
x.CurrentEpoch = v
|
2021-02-17 17:02:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetMagicNumber sets magic number of the sidechain.
|
|
|
|
func (x *NetworkInfo) SetMagicNumber(v uint64) {
|
2022-03-23 11:42:57 +00:00
|
|
|
x.MagicNumber = v
|
2021-02-17 17:02:02 +00:00
|
|
|
}
|
2021-06-18 12:27:01 +00:00
|
|
|
|
2021-09-28 08:10:20 +00:00
|
|
|
// SetMsPerBlock sets MillisecondsPerBlock network parameter.
|
|
|
|
func (x *NetworkInfo) SetMsPerBlock(v int64) {
|
2022-03-23 11:42:57 +00:00
|
|
|
x.MsPerBlock = v
|
2021-09-28 08:10:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetNetworkConfig sets NeoFS network configuration.
|
|
|
|
func (x *NetworkInfo) SetNetworkConfig(v *NetworkConfig) {
|
2022-03-23 11:42:57 +00:00
|
|
|
x.NetworkConfig = v
|
2021-09-28 08:10:20 +00:00
|
|
|
}
|
|
|
|
|
2021-06-18 12:27:01 +00:00
|
|
|
// FromString parses Clause from a string representation,
|
|
|
|
// It is a reverse action to String().
|
|
|
|
//
|
|
|
|
// Returns true if s was parsed successfully.
|
|
|
|
func (x *Clause) FromString(s string) bool {
|
|
|
|
i, ok := Clause_value[s]
|
|
|
|
if ok {
|
|
|
|
*x = Clause(i)
|
|
|
|
}
|
|
|
|
|
|
|
|
return ok
|
|
|
|
}
|
|
|
|
|
|
|
|
// FromString parses Operation from a string representation,
|
|
|
|
// It is a reverse action to String().
|
|
|
|
//
|
|
|
|
// Returns true if s was parsed successfully.
|
|
|
|
func (x *Operation) FromString(s string) bool {
|
|
|
|
i, ok := Operation_value[s]
|
|
|
|
if ok {
|
|
|
|
*x = Operation(i)
|
|
|
|
}
|
|
|
|
|
|
|
|
return ok
|
|
|
|
}
|
|
|
|
|
|
|
|
// FromString parses NodeInfo_State from a string representation,
|
|
|
|
// It is a reverse action to String().
|
|
|
|
//
|
|
|
|
// Returns true if s was parsed successfully.
|
|
|
|
func (x *NodeInfo_State) FromString(s string) bool {
|
|
|
|
i, ok := NodeInfo_State_value[s]
|
|
|
|
if ok {
|
|
|
|
*x = NodeInfo_State(i)
|
|
|
|
}
|
|
|
|
|
|
|
|
return ok
|
|
|
|
}
|
2021-09-28 08:10:20 +00:00
|
|
|
|
|
|
|
// SetKey sets parameter key.
|
|
|
|
func (x *NetworkConfig_Parameter) SetKey(v []byte) {
|
2022-03-23 11:42:57 +00:00
|
|
|
x.Key = v
|
2021-09-28 08:10:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetValue sets parameter value.
|
|
|
|
func (x *NetworkConfig_Parameter) SetValue(v []byte) {
|
2022-03-23 11:42:57 +00:00
|
|
|
x.Value = v
|
2021-09-28 08:10:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetParameters sets NeoFS network parameters.
|
|
|
|
func (x *NetworkConfig) SetParameters(v []*NetworkConfig_Parameter) {
|
2022-03-23 11:42:57 +00:00
|
|
|
x.Parameters = v
|
2021-09-28 08:10:20 +00:00
|
|
|
}
|
2022-09-17 09:59:54 +00:00
|
|
|
|
|
|
|
// SetEpoch sets revision number of the Netmap.
|
|
|
|
func (x *Netmap) SetEpoch(v uint64) {
|
|
|
|
x.Epoch = v
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetNodes sets nodes presented in the Netmap.
|
|
|
|
func (x *Netmap) SetNodes(v []*NodeInfo) {
|
|
|
|
x.Nodes = v
|
|
|
|
}
|