From e5d6f4c02b757c83244ba5e04fead08623a27299 Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Sat, 14 Mar 2026 00:44:19 +0300 Subject: =?UTF-8?q?=D0=BD=D0=B0=D1=87=D0=B0=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9?= =?UTF-8?q?=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B8=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/pose/main.go | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 cmd/pose/main.go (limited to 'cmd') diff --git a/cmd/pose/main.go b/cmd/pose/main.go new file mode 100644 index 0000000..4f206ba --- /dev/null +++ b/cmd/pose/main.go @@ -0,0 +1,37 @@ +package main + +import ( + "context" + "flag" + "log/slog" + "os" + "os/signal" + + "go.neonxp.ru/conf" + "go.neonxp.ru/pose/internal/application" +) + +var cfgFile = flag.String("config", "config.conf", "Path to config file") + +func main() { + ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill) + defer cancel() + + flag.Parse() + cfg, err := conf.LoadFile(*cfgFile) + if err != nil { + panic(err) + } + app, err := application.New(cfg, slog.Default()) + if err != nil { + panic(err) + } + defer func() { + if err := app.Close(); err != nil { + panic(err) + } + }() + if err := app.Run(ctx); err != nil { + panic(err) + } +} -- cgit v1.2.3