mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
22 lines
377 B
Go
22 lines
377 B
Go
|
package topology
|
||
|
|
||
|
import (
|
||
|
)
|
||
|
|
||
|
type DataNodeLocationList struct {
|
||
|
list []*DataNode
|
||
|
}
|
||
|
|
||
|
func NewDataNodeLocationList() *DataNodeLocationList {
|
||
|
return &DataNodeLocationList{}
|
||
|
}
|
||
|
|
||
|
func (dnll *DataNodeLocationList) Add(loc *DataNode){
|
||
|
for _, dnl := range dnll.list {
|
||
|
if loc.ip == dnl.ip && loc.port == dnl.port {
|
||
|
break
|
||
|
}
|
||
|
}
|
||
|
dnll.list = append(dnll.list, loc)
|
||
|
}
|