gosync/main.go

27 lines
525 B
Go
Raw Normal View History

2023-09-07 15:20:19 +02:00
package main
import (
"os"
"time"
"velvettear/gosync/log"
"velvettear/gosync/settings"
"velvettear/gosync/tools"
)
func main() {
timestamp := time.Now()
settings.Initialize()
log.Info("starting gosync...")
error := tools.TestConnection()
if error != nil {
log.Fatal("encountered an error connecting to the remove target", error.Error())
}
tools.Transfer()
exit(timestamp, 0)
}
func exit(timestamp time.Time, code int) {
log.InfoTimed("gosync finished - exiting...", timestamp.UnixMilli())
os.Exit(code)
}