init nodes values
This commit is contained in:
parent
e9a9b2cf54
commit
d275ecf48d
|
@ -2,12 +2,13 @@ package models
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/ffdo/node-informant/gluon-collector/data"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/ffdo/node-informant/gluon-collector/data"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Node struct
|
// Node struct
|
||||||
|
@ -50,7 +51,10 @@ func (nodes *Nodes) Get(nodeID string) *Node {
|
||||||
|
|
||||||
if node == nil {
|
if node == nil {
|
||||||
node = &Node{
|
node = &Node{
|
||||||
Firstseen: now,
|
Firstseen: now,
|
||||||
|
Nodeinfo: &data.NodeInfo{},
|
||||||
|
Statistics: &data.StatisticsStruct{},
|
||||||
|
Neighbours: &data.NeighbourStruct{},
|
||||||
}
|
}
|
||||||
nodes.List[nodeID] = node
|
nodes.List[nodeID] = node
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue