go-pingbot/main.go

46 lines
825 B
Go
Raw Normal View History

2021-07-11 21:19:37 +00:00
package main
import (
"sync"
2021-07-29 18:51:15 +00:00
2021-07-11 21:19:37 +00:00
"gitlab.com/gaming0skar123/go/pingbot/backend"
"gitlab.com/gaming0skar123/go/pingbot/common"
"gitlab.com/gaming0skar123/go/pingbot/config"
2021-07-29 18:51:15 +00:00
"gitlab.com/gaming0skar123/go/pingbot/database/mongo"
"gitlab.com/gaming0skar123/go/pingbot/update"
2021-07-11 21:19:37 +00:00
"gitlab.com/gaming0skar123/go/pingbot/website"
)
var log = common.Log
func main() {
log.Info("You're using verion: ", config.Version)
var wg sync.WaitGroup
2021-07-29 18:51:15 +00:00
mongo.Connect()
if config.Toml.HTTP.Enabled {
wg.Add(1)
2021-07-29 18:51:15 +00:00
go website.Server()
} else {
log.Warn("HTTP Server -> Disabled")
}
if config.Toml.Backend.Enabled {
wg.Add(1)
2021-07-29 18:51:15 +00:00
go backend.Ticker()
} else {
log.Warn("Backend -> Disabled")
}
if config.Toml.AutoUpdate.Enabled {
wg.Add(1)
2021-07-29 18:51:15 +00:00
go update.Ticker()
} else {
log.Warn("Auto Update -> Disabled")
}
2021-07-11 21:19:37 +00:00
wg.Wait()
2021-07-11 21:19:37 +00:00
}