d6e129179c
Implement global server as control plane Implement device to get their info from global server and connect each others
18 lines
338 B
Go
18 lines
338 B
Go
package leader
|
|
|
|
type TreeNode struct {
|
|
Id string `yaml:"id"`
|
|
Children []TreeNode `yaml:"children,omitempty"`
|
|
}
|
|
|
|
func NewTreeNode(id string, children []TreeNode) *TreeNode {
|
|
return &TreeNode{
|
|
Id: id,
|
|
Children: children,
|
|
}
|
|
}
|
|
|
|
func (t *TreeNode) AddChild(child *TreeNode) {
|
|
t.Children = append(t.Children, *child)
|
|
}
|