-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
54 lines (45 loc) · 1.01 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
42
43
44
45
46
47
48
49
50
51
52
53
54
package main
import (
"github.com/bocchi-the-cache/inspector/pkg/client"
"github.com/bocchi-the-cache/inspector/pkg/common/logger"
"github.com/bocchi-the-cache/inspector/pkg/common/result_logger"
"github.com/bocchi-the-cache/inspector/pkg/monitor"
"github.com/bocchi-the-cache/inspector/pkg/server"
"github.com/bocchi-the-cache/inspector/pkg/storage"
"github.com/spf13/viper"
)
func initLog() {
logger.InitLogger("log", "log.txt", "debug")
}
func initResultLog() {
result_logger.InitLogger("log", "result.txt", "debug")
}
func initConfig() {
viper.SetConfigName("config")
viper.SetConfigType("yaml")
viper.AddConfigPath("config/")
err := viper.ReadInConfig()
if err != nil {
logger.Panic("config init failed. exit!")
panic(err)
}
}
func initStorage() {
storage.Init()
}
func initClient() {
client.Init()
}
func initMonitor() {
monitor.Init()
}
func main() {
initLog()
initResultLog()
initConfig()
initStorage()
initClient()
initMonitor()
logger.Info("all init done, start server")
server.Serve()
}