-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathmain.go
39 lines (31 loc) · 1001 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
package main
import (
"fmt"
"github.com/spf13/viper"
"gitlab.com/raspberry.tech/wireguard-manager-and-api/src/api"
"gitlab.com/raspberry.tech/wireguard-manager-and-api/src/autocheck"
"gitlab.com/raspberry.tech/wireguard-manager-and-api/src/config"
"gitlab.com/raspberry.tech/wireguard-manager-and-api/src/db"
"gitlab.com/raspberry.tech/wireguard-manager-and-api/src/logger"
"gitlab.com/raspberry.tech/wireguard-manager-and-api/src/network"
)
func main() {
fmt.Println("WG MANAGER AND API STARTING UP")
fmt.Println("Env file loading - 1/6")
config.LoadConfig()
fmt.Println("Logger starting up - 2/6")
logger.LoggerSetup()
fmt.Println("Starting database - 3/6")
db.DBStart()
fmt.Println("Starting of network - 4/6")
network.SetupWG()
autocheckBool := viper.GetBool("SERVER.AUTOCHECK")
if autocheckBool {
fmt.Println("Starting autochecker - 5/6")
autocheck.AutoStart()
} else {
fmt.Println("Skipped autochecker - 5/6")
}
fmt.Println("Starting API - 6/6")
api.API()
}