-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
37 lines (29 loc) · 892 Bytes
/
main.go
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
29
30
31
32
33
34
35
36
37
package main
import (
"context"
"embed"
"os"
"os/signal"
"github.com/NicklasWallgren/go-template/bootstrap"
"github.com/NicklasWallgren/go-template/config"
)
//go:embed resources/database/migrations/*/*.sql
var embedMigrations embed.FS
// logo is generated via https://patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=Go%20Template
//
//go:embed resources/assets/logo.ascii
var logo string
//go:embed resources/database/sql/*.tsql
var templateSQL embed.FS
// @title GO template API
// @description An template for implementing a hexagonal application.
// @version 1.0
// @host localhost:8080
// @BasePath /api.
func main() {
assets := config.NewAssetsConfig(logo, embedMigrations, templateSQL)
app := bootstrap.NewApp(assets)
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill)
defer cancel()
app.ExecuteContext(ctx) // nolint:errcheck
}