mirror of https://github.com/ouqiang/gocron
项目包名改为 github.com/ouqiang
parent
e8351141c0
commit
3a3ae7e024
|
@ -6,7 +6,9 @@ import (
|
|||
"github.com/go-macaron/gzip"
|
||||
"github.com/go-macaron/session"
|
||||
"github.com/go-macaron/csrf"
|
||||
"scheduler/modules/app"
|
||||
"github.com/ouqiang/cron-scheduler/modules/app"
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
// web服务器默认端口
|
||||
|
@ -43,6 +45,8 @@ func run(ctx *cli.Context) {
|
|||
|
||||
// 定时任务调度
|
||||
func runScheduler() {
|
||||
fmt.Println("hello world")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// 路由注册
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
package main
|
||||
|
||||
/*--------------------------------------------------------
|
||||
定时任务调度
|
||||
兼容Linux crontab时间格式语法,最小粒度可精确到每秒
|
||||
支持通过HTTP、SSH协议触发任务执行
|
||||
--------------------------------------------------------*/
|
||||
|
||||
import (
|
||||
"github.com/urfave/cli"
|
||||
"os"
|
||||
|
||||
"github.com/ouqiang/cron-scheduler/cmd"
|
||||
)
|
||||
|
||||
const AppVersion = "0.0.1"
|
||||
|
||||
func main() {
|
||||
app := cli.NewApp()
|
||||
app.Name = "scheduler"
|
||||
app.Usage = "schedule cron service"
|
||||
app.Version = AppVersion
|
||||
app.Commands = []cli.Command{
|
||||
cmd.CmdWeb,
|
||||
}
|
||||
app.Flags = append(app.Flags, []cli.Flag{}...)
|
||||
app.Run(os.Args)
|
||||
}
|
|
@ -3,7 +3,7 @@ package models
|
|||
import (
|
||||
"github.com/go-xorm/xorm"
|
||||
"fmt"
|
||||
"scheduler/modules/setting"
|
||||
"github.com/ouqiang/cron-scheduler/modules/setting"
|
||||
"github.com/go-xorm/core"
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
"gopkg.in/macaron.v1"
|
||||
|
|
|
@ -2,7 +2,7 @@ package models
|
|||
|
||||
import (
|
||||
"time"
|
||||
"scheduler/modules/utils"
|
||||
"github.com/ouqiang/cron-scheduler/modules/utils"
|
||||
)
|
||||
|
||||
const PasswordSaltLength = 6;
|
||||
|
|
|
@ -4,10 +4,10 @@ package ansible
|
|||
|
||||
import (
|
||||
"os"
|
||||
"scheduler/modules/utils"
|
||||
"errors"
|
||||
"gopkg.in/yaml.v2"
|
||||
"io/ioutil"
|
||||
"github.com/ouqiang/cron-scheduler/modules/utils"
|
||||
)
|
||||
|
||||
type Handler map[string]interface{}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package ansible
|
||||
|
||||
import (
|
||||
"scheduler/models"
|
||||
"github.com/ouqiang/cron-scheduler/models"
|
||||
"sync"
|
||||
"io/ioutil"
|
||||
"bytes"
|
||||
|
|
|
@ -2,11 +2,12 @@ package app
|
|||
|
||||
import (
|
||||
"os"
|
||||
"scheduler/modules/crontask"
|
||||
"scheduler/models"
|
||||
"runtime"
|
||||
"scheduler/modules/utils"
|
||||
"scheduler/modules/ansible"
|
||||
|
||||
"github.com/ouqiang/cron-scheduler/modules/utils"
|
||||
"github.com/ouqiang/cron-scheduler/modules/ansible"
|
||||
"github.com/ouqiang/cron-scheduler/modules/crontask"
|
||||
"github.com/ouqiang/cron-scheduler/models"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package service
|
||||
|
||||
import (
|
||||
"scheduler/models"
|
||||
"scheduler/modules/utils"
|
||||
"github.com/ouqiang/cron-scheduler/models"
|
||||
"github.com/ouqiang/cron-scheduler/modules/utils"
|
||||
"net/http"
|
||||
"io/ioutil"
|
||||
"strconv"
|
||||
"time"
|
||||
"scheduler/modules/crontask"
|
||||
"github.com/ouqiang/cron-scheduler/modules/crontask"
|
||||
)
|
||||
|
||||
type Task struct {}
|
||||
|
|
|
@ -107,5 +107,5 @@
|
|||
"revisionTime": "2017-02-08T14:18:51Z"
|
||||
}
|
||||
],
|
||||
"rootPath": "scheduler"
|
||||
"rootPath": "cron-scheduler"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue