diff options
| author | 2026-03-14 00:44:19 +0300 | |
|---|---|---|
| committer | 2026-03-14 00:44:19 +0300 | |
| commit | e5d6f4c02b757c83244ba5e04fead08623a27299 (patch) | |
| tree | 5b5babb9887cafa3dbc165928dc2b0fd65265bda /cmd | |
| download | pose-master.tar.gz pose-master.tar.bz2 pose-master.tar.xz pose-master.zip | |
Diffstat (limited to '')
| -rw-r--r-- | cmd/pose/main.go | 37 |
1 files changed, 37 insertions, 0 deletions
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) + } +} |
