skeleton added

This commit is contained in:
2026-02-08 19:56:16 +03:00
committed by KentoNion
commit f0b04b229a
19 changed files with 2021 additions and 0 deletions

34
cmd.go Normal file
View File

@@ -0,0 +1,34 @@
package main
import (
"context"
"log/slog"
"os"
"os/signal"
"syscall"
"tgVideoCall/app"
"tgVideoCall/pkg/config"
"tgVideoCall/pkg/logger"
)
func main() {
cfg := config.MustLoad()
log := logger.MustInitLogger(cfg)
ctx, cancel := context.WithCancel(context.Background())
app.Run(ctx, log, cfg)
go shutdown(cancel, log)
}
func shutdown(cancel context.CancelFunc, log slog.Logger) {
const op = "shutdown"
sigterm := make(chan os.Signal, 1)
signal.Notify(sigterm, syscall.SIGINT, syscall.SIGTERM)
// Ожидание сигнала
receivedSignal := <-sigterm
log.Info(op, "recieved signal", receivedSignal)
cancel()
}