chore: import lab4 baseline

This commit is contained in:
2026-10-22 16:20:54 +03:00
parent 276dbdad8a
commit 709346783e
68 changed files with 8356 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
package main
import (
"errors"
"log/slog"
"os"
"gitea.privcloud.tech/dizi/mtusi2026lab5/internal/bootstrap"
"gitea.privcloud.tech/dizi/mtusi2026lab5/internal/logger"
)
func main() {
appLogger := logger.New()
if err := run(appLogger, os.Args[1:]); err != nil {
appLogger.Error("application stopped", "error", err)
os.Exit(1)
}
}
func run(logger *slog.Logger, arguments []string) error {
if len(arguments) == 0 {
return bootstrap.RunServer(logger)
}
if len(arguments) == 1 && arguments[0] == "migrate" {
return bootstrap.RunMigrations()
}
if arguments[0] == "reconcile-attachments" {
return bootstrap.RunReconciliation(arguments[1:], os.Stdout)
}
return errors.New("usage: messenger [migrate|reconcile-attachments]")
}