summaryrefslogtreecommitdiff
path: root/main.go
blob: b1f39d56367504a1cb916970092f5526f6de73ca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package main

import (
	"context"
	"os"
	"os/signal"

	"git.neonxp.ru/posse/app"
)

func main() {
	ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill)
	defer cancel()

	cfg, err := app.NewConfig()
	if err != nil {
		panic(err)
	}

	a, err := app.New(cfg)
	if err != nil {
		panic(err)
	}

	if err := a.Run(ctx); err != nil {
		panic(err)
	}
}