mirror of
https://github.com/MedzikUser/go-pingbot
synced 2024-08-14 23:57:07 +00:00
- Moved type.go to types.go - Added build date - Removed linter from gitpod Dockerfile (now is in gitpod image) - Added mongodb Database and Collection to config file (now isn't used [TODO]) - Added uptime to status
49 lines
865 B
Go
49 lines
865 B
Go
package main
|
|
|
|
import (
|
|
"sync"
|
|
"time"
|
|
|
|
"gitlab.com/gaming0skar123/go/pingbot/backend"
|
|
"gitlab.com/gaming0skar123/go/pingbot/common"
|
|
"gitlab.com/gaming0skar123/go/pingbot/config"
|
|
"gitlab.com/gaming0skar123/go/pingbot/database/mongo"
|
|
"gitlab.com/gaming0skar123/go/pingbot/update"
|
|
"gitlab.com/gaming0skar123/go/pingbot/website"
|
|
)
|
|
|
|
var log = common.Log
|
|
|
|
func main() {
|
|
log.Info("You're using verion: ", config.Version)
|
|
|
|
var wg sync.WaitGroup
|
|
|
|
mongo.Connect()
|
|
|
|
if config.Toml.HTTP.Enabled {
|
|
wg.Add(1)
|
|
go website.Server()
|
|
} else {
|
|
log.Warn("HTTP Server -> Disabled")
|
|
}
|
|
|
|
if config.Toml.Backend.Enabled {
|
|
wg.Add(1)
|
|
go backend.Ticker()
|
|
} else {
|
|
log.Warn("Backend -> Disabled")
|
|
}
|
|
|
|
if config.Toml.AutoUpdate.Enabled {
|
|
wg.Add(1)
|
|
go update.Ticker()
|
|
} else {
|
|
log.Warn("Auto Update -> Disabled")
|
|
}
|
|
|
|
config.StartTime = time.Now()
|
|
|
|
wg.Wait()
|
|
}
|