2021-01-13 13:46:39 +00:00
|
|
|
package control
|
2021-01-13 12:48:33 +00:00
|
|
|
|
2021-01-15 07:39:03 +00:00
|
|
|
import (
|
2021-01-15 07:40:19 +00:00
|
|
|
"google.golang.org/protobuf/encoding/protojson"
|
2021-01-15 07:39:03 +00:00
|
|
|
)
|
|
|
|
|
2021-01-13 12:48:33 +00:00
|
|
|
// SetKey sets public key used for signing.
|
2021-01-15 07:39:03 +00:00
|
|
|
func (x *Signature) SetKey(v []byte) {
|
|
|
|
if x != nil {
|
|
|
|
x.Key = v
|
2021-01-13 12:48:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetSign sets binary signature.
|
2021-01-15 07:39:03 +00:00
|
|
|
func (x *Signature) SetSign(v []byte) {
|
|
|
|
if x != nil {
|
|
|
|
x.Sign = v
|
2021-01-13 12:48:33 +00:00
|
|
|
}
|
|
|
|
}
|
2021-01-14 15:59:39 +00:00
|
|
|
|
|
|
|
// SetKey sets key of the node attribute.
|
2021-01-15 07:39:03 +00:00
|
|
|
func (x *NodeInfo_Attribute) SetKey(v string) {
|
|
|
|
if x != nil {
|
|
|
|
x.Key = v
|
2021-01-14 15:59:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetValue sets value of the node attribute.
|
2021-01-15 07:39:03 +00:00
|
|
|
func (x *NodeInfo_Attribute) SetValue(v string) {
|
|
|
|
if x != nil {
|
|
|
|
x.Value = v
|
2021-01-14 15:59:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetParents sets parent keys.
|
2021-01-15 07:39:03 +00:00
|
|
|
func (x *NodeInfo_Attribute) SetParents(v []string) {
|
|
|
|
if x != nil {
|
|
|
|
x.Parents = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-14 15:59:39 +00:00
|
|
|
// SetPublicKey sets public key of the NeoFS node in a binary format.
|
2021-01-15 07:39:03 +00:00
|
|
|
func (x *NodeInfo) SetPublicKey(v []byte) {
|
|
|
|
if x != nil {
|
|
|
|
x.PublicKey = v
|
2021-01-14 15:59:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-22 19:48:33 +00:00
|
|
|
// SetAddresses sets ways to connect to a node.
|
|
|
|
func (x *NodeInfo) SetAddresses(v []string) {
|
2021-01-15 07:39:03 +00:00
|
|
|
if x != nil {
|
2021-06-22 19:48:33 +00:00
|
|
|
x.Addresses = v
|
2021-01-14 15:59:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetAttributes sets attributes of the NeoFS Storage Node.
|
2021-01-15 07:39:03 +00:00
|
|
|
func (x *NodeInfo) SetAttributes(v []*NodeInfo_Attribute) {
|
|
|
|
if x != nil {
|
|
|
|
x.Attributes = v
|
2021-01-14 15:59:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetState sets state of the NeoFS node.
|
2021-01-15 09:42:31 +00:00
|
|
|
func (x *NodeInfo) SetState(v NetmapStatus) {
|
2021-01-15 07:39:03 +00:00
|
|
|
if x != nil {
|
|
|
|
x.State = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-14 15:59:39 +00:00
|
|
|
// SetEpoch sets revision number of the network map.
|
2021-01-15 07:39:03 +00:00
|
|
|
func (x *Netmap) SetEpoch(v uint64) {
|
|
|
|
if x != nil {
|
|
|
|
x.Epoch = v
|
2021-01-14 15:59:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetNodes sets nodes presented in network.
|
2021-01-15 07:39:03 +00:00
|
|
|
func (x *Netmap) SetNodes(v []*NodeInfo) {
|
|
|
|
if x != nil {
|
|
|
|
x.Nodes = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-15 07:40:19 +00:00
|
|
|
func (x *Netmap) MarshalJSON() ([]byte, error) {
|
|
|
|
return protojson.MarshalOptions{
|
|
|
|
EmitUnpopulated: true,
|
|
|
|
}.Marshal(x)
|
|
|
|
}
|
2021-12-17 15:23:05 +00:00
|
|
|
|
|
|
|
// SetID sets identificator of the shard.
|
|
|
|
func (x *ShardInfo) SetID(v []byte) {
|
|
|
|
x.Shard_ID = v
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetMetabasePath sets path to shard's metabase.
|
|
|
|
func (x *ShardInfo) SetMetabasePath(v string) {
|
|
|
|
x.MetabasePath = v
|
|
|
|
}
|
|
|
|
|
2021-12-27 12:03:24 +00:00
|
|
|
// SetBlobstorPath sets path to shard's blobstor.
|
|
|
|
func (x *ShardInfo) SetBlobstorPath(v string) {
|
2021-12-20 10:03:29 +00:00
|
|
|
x.BlobstorPath = v
|
2021-12-17 15:23:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetWriteCachePath sets path to shard's write-cache.
|
|
|
|
func (x *ShardInfo) SetWriteCachePath(v string) {
|
|
|
|
x.WritecachePath = v
|
|
|
|
}
|
|
|
|
|
2022-05-16 13:23:09 +00:00
|
|
|
// SetPiloramaPath sets path to shard's pilorama.
|
|
|
|
func (x *ShardInfo) SetPiloramaPath(v string) {
|
|
|
|
x.PiloramaPath = v
|
|
|
|
}
|
|
|
|
|
2021-12-17 15:23:05 +00:00
|
|
|
// SetMode sets path to shard's work mode.
|
|
|
|
func (x *ShardInfo) SetMode(v ShardMode) {
|
|
|
|
x.Mode = v
|
|
|
|
}
|
|
|
|
|
2022-01-31 15:23:19 +00:00
|
|
|
// SetErrorCount sets shard's error counter.
|
|
|
|
func (x *ShardInfo) SetErrorCount(count uint32) {
|
|
|
|
x.ErrorCount = count
|
|
|
|
}
|