This commit is contained in:
mlogclub
2026-04-09 10:01:23 +08:00
commit efe801b8bf
707 changed files with 110595 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
package main
import (
"log/slog"
"cs-agent/internal/bootstrap"
"cs-agent/internal/pkg/config"
"cs-agent/internal/pkg/logx"
)
func main() {
cfg, err := config.Load("config/config.yaml")
if err != nil {
slog.Error("load config failed", "error", err)
return
}
logx.Init(logx.Config{
Level: cfg.Logger.Level,
Format: cfg.Logger.Format,
AddSource: cfg.Logger.AddSource,
})
if _, err = bootstrap.InitDB(cfg.DB); err != nil {
slog.Error("init db failed", "error", err)
return
}
if err = bootstrap.InitMigrations(); err != nil {
slog.Error("run migrations failed", "error", err)
return
}
slog.Info("migrations completed")
}