Files
data-engine/main.go

38 lines
887 B
Go
Raw Normal View History

2026-04-02 11:51:44 +08:00
package main
import (
2026-06-01 14:08:17 +08:00
"dataengine/controller/debug"
2026-04-30 13:45:41 +08:00
"dataengine/controller/dict"
2026-05-29 18:39:32 +08:00
syncCtrl "dataengine/controller/sync"
syncSvc "dataengine/service/sync"
2026-04-02 11:51:44 +08:00
"gitea.com/red-future/common/http"
"gitea.com/red-future/common/jaeger"
2026-04-16 09:26:00 +08:00
_ "gitea.com/red-future/common/k3sconfig"
2026-04-02 11:51:44 +08:00
_ "github.com/gogf/gf/contrib/drivers/pgsql/v2"
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
2026-06-01 14:08:17 +08:00
"github.com/gogf/gf/v2/frame/g"
2026-04-02 11:51:44 +08:00
"golang.org/x/net/context"
)
func main() {
ctx := context.Background()
defer jaeger.ShutDown(ctx)
2026-05-29 18:39:32 +08:00
// 启动自动同步(后台循环执行,首次全量后续增量)
syncSvc.InitAndStartAutoSync(ctx)
2026-04-02 11:51:44 +08:00
http.RouteRegister([]interface{}{
// 接口管理
dict.ApiInterface,
dict.DatasourcePlatform,
2026-05-29 18:39:32 +08:00
// 平台同步引擎
syncCtrl.PlatformSyncController,
2026-04-02 11:51:44 +08:00
})
2026-06-01 14:08:17 +08:00
// 管理后台页面
g.Server().BindHandler("/admin", debug.DebugController.DebugPage)
2026-04-02 11:51:44 +08:00
select {}
}