satellite/nodeselection: remove CountryCodeExclude
We don't need it any more, as CountryCode uses location.Set, which supports exclusion (`Without`). Change-Id: Ie311ae19fefa0bc9a0161496af1233ef4a6607df
This commit is contained in:
parent
f7b39aaed4
commit
63c8cfe4c3
@ -59,24 +59,6 @@ func (n NodeFilters) WithExcludedIDs(ds []storj.NodeID) NodeFilters {
|
|||||||
|
|
||||||
var _ NodeFilter = NodeFilters{}
|
var _ NodeFilter = NodeFilters{}
|
||||||
|
|
||||||
// CountryCodeExclude is a specific CountryFilter which excludes all nodes with the given country code.
|
|
||||||
type CountryCodeExclude []location.CountryCode
|
|
||||||
|
|
||||||
// MatchInclude implements NodeFilter interface.
|
|
||||||
func (c CountryCodeExclude) MatchInclude(node *SelectedNode) bool {
|
|
||||||
for _, code := range c {
|
|
||||||
if code == location.None {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if node.CountryCode == code {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ NodeFilter = CountryCodeExclude{}
|
|
||||||
|
|
||||||
// CountryFilter can select nodes based on the condition of the country code.
|
// CountryFilter can select nodes based on the condition of the country code.
|
||||||
type CountryFilter struct {
|
type CountryFilter struct {
|
||||||
permit location.Set
|
permit location.Set
|
||||||
|
Loading…
Reference in New Issue
Block a user