-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
42 lines (35 loc) · 856 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
package main
import (
"github.com/ALiwoto/RestorerRobot/src/core/utils/logging"
"github.com/ALiwoto/RestorerRobot/src/core/wotoAuth"
"github.com/ALiwoto/RestorerRobot/src/core/wotoConfig"
"github.com/ALiwoto/RestorerRobot/src/core/wotoEntry"
"github.com/ALiwoto/RestorerRobot/src/database"
"github.com/go-faster/errors"
)
func main() {
f := logging.LoadLogger(true)
if f != nil {
defer f()
}
err := runApp()
if err != nil {
logging.Fatal("Error running app: ", err.Error())
}
}
func runApp() error {
err := wotoConfig.LoadConfig()
if err != nil {
return errors.Wrap(err, "LoadConfig")
}
err = database.StartDatabase()
if err != nil {
return errors.Wrap(err, "StartDatabase")
}
u := wotoEntry.MainUpdateEntry
err = wotoAuth.AuthorizeClient(u)
if err != nil {
return errors.Wrap(err, "AuthorizeClient")
}
return nil
}