2021-10-25 13:27:59 +01:00
|
|
|
// Copyright (C) 2020 Storj Labs, Inc.
|
2020-05-15 15:32:28 +01:00
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
2021-05-04 13:29:26 +01:00
|
|
|
package uploadselection
|
2020-05-15 15:32:28 +01:00
|
|
|
|
|
|
|
import (
|
|
|
|
"storj.io/common/storj"
|
2021-10-29 13:29:14 +01:00
|
|
|
"storj.io/common/storj/location"
|
2020-05-15 15:32:28 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
// Node defines necessary information for node-selection.
|
|
|
|
type Node struct {
|
2020-05-26 14:50:28 +01:00
|
|
|
storj.NodeURL
|
2021-10-29 13:29:14 +01:00
|
|
|
LastNet string
|
|
|
|
LastIPPort string
|
|
|
|
CountryCode location.CountryCode
|
2020-05-15 15:32:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Clone returns a deep clone of the selected node.
|
|
|
|
func (node *Node) Clone() *Node {
|
|
|
|
return &Node{
|
2021-10-29 13:29:14 +01:00
|
|
|
NodeURL: node.NodeURL,
|
|
|
|
LastNet: node.LastNet,
|
|
|
|
LastIPPort: node.LastIPPort,
|
|
|
|
CountryCode: node.CountryCode,
|
2020-05-15 15:32:28 +01:00
|
|
|
}
|
|
|
|
}
|