Create scaffolding of ddl-simulator

Implement global server as control plane

Implement device to get their info from global server and connect each
others
This commit is contained in:
Pengzhan Hao
2024-12-17 07:31:18 +00:00
commit d6e129179c
21 changed files with 1653 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
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)
}