Files
EdgeNode/cmd/edge-node/main.go

37 lines
752 B
Go
Raw Normal View History

2020-07-21 11:18:47 +08:00
package main
import (
2020-09-09 18:53:53 +08:00
"fmt"
"github.com/TeaOSLab/EdgeNode/internal/apps"
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
2020-07-21 11:18:47 +08:00
"github.com/TeaOSLab/EdgeNode/internal/nodes"
_ "github.com/iwind/TeaGo/bootstrap"
"os"
2020-07-21 11:18:47 +08:00
)
func main() {
2020-09-09 18:53:53 +08:00
app := apps.NewAppCmd().
Version(teaconst.Version).
Product(teaconst.ProductName).
Usage(teaconst.ProcessName + " [-v|start|stop|restart|sync|update|test]")
2020-09-09 18:53:53 +08:00
app.On("test", func() {
err := nodes.NewNode().Test()
if err != nil {
_, _ = os.Stderr.WriteString(err.Error())
}
})
2020-09-09 18:53:53 +08:00
app.On("sync", func() {
// TODO
fmt.Println("not implemented yet")
})
app.On("update", func() {
// TODO
fmt.Println("not implemented yet")
})
app.Run(func() {
node := nodes.NewNode()
node.Start()
})
2020-07-21 11:18:47 +08:00
}