Scheduler

This commit is contained in:
Richard Patel
2018-10-28 02:40:12 +02:00
parent 5ac9fc10a1
commit 79f540bf29
10 changed files with 557 additions and 451 deletions

36
main.go
View File

@@ -1,23 +1,25 @@
package main
import (
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"context"
"net/url"
)
type Config struct {
ServerUrl string
Token string
}
func main2() {
var err error
viper.SetConfigName("config.yml")
viper.SetConfigType("yml")
err = viper.ReadInConfig()
if err != nil {
logrus.Fatal(err)
}
func main() {
prepareConfig()
readConfig()
c := context.Background()
remotes := make(chan *RemoteDir)
go Schedule(c, remotes)
u, _ := url.Parse("http://mine.terorie.com:420/")
remote := NewRemoteDir(*u)
globalWait.Add(1)
remotes <- remote
// Wait for all jobs to finish
globalWait.Wait()
}