Initial commit (code only without large binaries)

This commit is contained in:
robin
2026-02-15 18:58:44 +08:00
commit 35df75498f
9442 changed files with 1495866 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package main
import (
"fmt"
"github.com/TeaOSLab/EdgeReporter/internal/apps"
teaconst "github.com/TeaOSLab/EdgeReporter/internal/const"
"github.com/TeaOSLab/EdgeReporter/internal/nodes"
)
func main() {
app := apps.NewAppCmd().
Version(teaconst.Version).
Product(teaconst.ProductName).
Usage(teaconst.ProcessName + " [-v|start|stop|restart|service|daemon]")
app.On("daemon", func() {
nodes.NewReportNode().Daemon()
})
app.On("service", func() {
err := nodes.NewReportNode().InstallSystemService()
if err != nil {
fmt.Println("[ERROR]install failed: " + err.Error())
return
}
fmt.Println("done")
})
app.On("run", func() {
reporterNode := nodes.NewReportNode()
reporterNode.Run()
})
app.Run(func() {
reporterNode := nodes.NewReportNode()
reporterNode.Run()
})
}