27 lines
525 B
Go
27 lines
525 B
Go
|
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)
|
||
|
}
|