forked from TrueCloudLab/frostfs-sdk-go
[#344] netmap: Add method Clone
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
f70c0c9081
commit
749b4e9ab5
6 changed files with 141 additions and 0 deletions
|
@ -563,6 +563,17 @@ func (x *NodeInfo) SetStatus(state NodeState) {
|
|||
x.m.SetState(netmap.NodeState(state))
|
||||
}
|
||||
|
||||
// Clone returns a copy of NodeInfo.
|
||||
func (x *NodeInfo) Clone() *NodeInfo {
|
||||
if x == nil {
|
||||
return nil
|
||||
}
|
||||
return &NodeInfo{
|
||||
hash: x.hash,
|
||||
m: *x.m.Clone(),
|
||||
}
|
||||
}
|
||||
|
||||
// String implements fmt.Stringer.
|
||||
//
|
||||
// String is designed to be human-readable, and its format MAY differ between
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue