forked from Yuzuki616/AWS-Panel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
41 lines (37 loc) · 1 KB
/
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
package main
import (
"github.com/Yuzuki616/Aws-Panel/data"
"github.com/Yuzuki616/Aws-Panel/router"
"github.com/Yuzuki616/Aws-Panel/utils"
log "github.com/sirupsen/logrus"
easy "github.com/t-tomalak/logrus-easy-formatter"
"time"
)
const version = "0.3.6"
func printVersion() {
log.Info("Aws Panel")
log.Info("Version: ", version)
log.Info("Github: https://github.com/Yuzuki616/AWS-Panel")
}
func main() {
log.SetFormatter(&easy.Formatter{
TimestampFormat: "01-02 15:04:05",
LogFormat: "Aws-Panel | %time% | %lvl% >> %msg% \n",
})
printVersion()
if utils.RunningByDoubleClick() {
log.Warning("不建议直接双击运行本程序,这将导致一些非可预料后果,请通过控制台启动本程序")
log.Warning("将等待10秒后启动")
time.Sleep(time.Second * 10)
}
dbErr := data.DbInit("./data.db")
if dbErr != nil {
log.Error("Database init error: ", dbErr)
}
route := router.New()
route.LoadRoute()
startErr := route.Start()
if startErr != nil {
log.Error(startErr)
}
}