-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
46 lines (34 loc) · 827 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
38
39
40
41
42
43
44
45
46
package main
import (
"github.com/MrAndreID/goechoms/applications"
"github.com/MrAndreID/goechoms/applications/routes"
"github.com/MrAndreID/goechoms/configs"
"github.com/sirupsen/logrus"
)
func main() {
var tag string = "Main."
cfg, err := configs.New()
if err != nil {
logrus.WithFields(logrus.Fields{
"tag": tag + "01",
"error": err.Error(),
}).Error("failed to initiate configuration")
return
}
app, err := applications.New(cfg)
if err != nil {
logrus.WithFields(logrus.Fields{
"tag": tag + "02",
"error": err.Error(),
}).Error("failed to initiate application")
return
}
e := routes.New(cfg, app)
if app.Start(cfg, e); err != nil {
logrus.WithFields(logrus.Fields{
"tag": tag + "03",
"error": err.Error(),
}).Error("failed to run application")
return
}
}