包重命名为gocron
parent
91f33515f6
commit
b115e5a370
|
@ -4,8 +4,8 @@ import (
|
||||||
"github.com/go-macaron/csrf"
|
"github.com/go-macaron/csrf"
|
||||||
"github.com/go-macaron/gzip"
|
"github.com/go-macaron/gzip"
|
||||||
"github.com/go-macaron/session"
|
"github.com/go-macaron/session"
|
||||||
"github.com/ouqiang/cron-scheduler/modules/app"
|
"github.com/ouqiang/gocron/modules/app"
|
||||||
"github.com/ouqiang/cron-scheduler/routers"
|
"github.com/ouqiang/gocron/routers"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
"gopkg.in/macaron.v1"
|
"gopkg.in/macaron.v1"
|
||||||
"os"
|
"os"
|
||||||
|
@ -13,7 +13,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"syscall"
|
"syscall"
|
||||||
"github.com/ouqiang/cron-scheduler/modules/logger"
|
"github.com/ouqiang/gocron/modules/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 1号进程id
|
// 1号进程id
|
||||||
|
|
|
@ -10,15 +10,15 @@ import (
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/ouqiang/cron-scheduler/cmd"
|
"github.com/ouqiang/gocron/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
const AppVersion = "0.0.1"
|
const AppVersion = "0.0.1"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := cli.NewApp()
|
app := cli.NewApp()
|
||||||
app.Name = "cron-scheduler"
|
app.Name = "gocron"
|
||||||
app.Usage = "cron-scheduler service"
|
app.Usage = "gocron service"
|
||||||
app.Version = AppVersion
|
app.Version = AppVersion
|
||||||
app.Commands = []cli.Command{
|
app.Commands = []cli.Command{
|
||||||
cmd.CmdWeb,
|
cmd.CmdWeb,
|
|
@ -1,7 +1,7 @@
|
||||||
package models
|
package models
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ouqiang/cron-scheduler/modules/utils"
|
"github.com/ouqiang/gocron/modules/utils"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ package ansible
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/ouqiang/cron-scheduler/modules/utils"
|
"github.com/ouqiang/gocron/modules/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ansible是否有安装
|
// ansible是否有安装
|
||||||
|
|
|
@ -2,11 +2,11 @@ package ansible
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"github.com/ouqiang/cron-scheduler/models"
|
"github.com/ouqiang/gocron/models"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
"github.com/ouqiang/cron-scheduler/modules/logger"
|
"github.com/ouqiang/gocron/modules/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 主机名
|
// 主机名
|
||||||
|
|
|
@ -3,12 +3,12 @@ package app
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/ouqiang/cron-scheduler/models"
|
"github.com/ouqiang/gocron/models"
|
||||||
"github.com/ouqiang/cron-scheduler/modules/ansible"
|
"github.com/ouqiang/gocron/modules/ansible"
|
||||||
"github.com/ouqiang/cron-scheduler/modules/crontask"
|
"github.com/ouqiang/gocron/modules/crontask"
|
||||||
"github.com/ouqiang/cron-scheduler/service"
|
"github.com/ouqiang/gocron/service"
|
||||||
"github.com/ouqiang/cron-scheduler/modules/setting"
|
"github.com/ouqiang/gocron/modules/setting"
|
||||||
"github.com/ouqiang/cron-scheduler/modules/logger"
|
"github.com/ouqiang/gocron/modules/logger"
|
||||||
"runtime"
|
"runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/ouqiang/cron-scheduler/modules/logger"
|
"github.com/ouqiang/gocron/modules/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// json 格式输出
|
// json 格式输出
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package install
|
package install
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ouqiang/cron-scheduler/models"
|
"github.com/ouqiang/gocron/models"
|
||||||
"github.com/ouqiang/cron-scheduler/modules/app"
|
"github.com/ouqiang/gocron/modules/app"
|
||||||
"github.com/ouqiang/cron-scheduler/modules/setting"
|
"github.com/ouqiang/gocron/modules/setting"
|
||||||
"github.com/ouqiang/cron-scheduler/modules/utils"
|
"github.com/ouqiang/gocron/modules/utils"
|
||||||
"gopkg.in/macaron.v1"
|
"gopkg.in/macaron.v1"
|
||||||
"strconv"
|
"strconv"
|
||||||
"github.com/ouqiang/cron-scheduler/modules/logger"
|
"github.com/ouqiang/gocron/modules/logger"
|
||||||
"github.com/go-macaron/binding"
|
"github.com/go-macaron/binding"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@ package routers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/go-macaron/binding"
|
"github.com/go-macaron/binding"
|
||||||
"github.com/ouqiang/cron-scheduler/routers/install"
|
"github.com/ouqiang/gocron/routers/install"
|
||||||
"gopkg.in/macaron.v1"
|
"gopkg.in/macaron.v1"
|
||||||
"github.com/ouqiang/cron-scheduler/routers/task"
|
"github.com/ouqiang/gocron/routers/task"
|
||||||
"github.com/ouqiang/cron-scheduler/routers/host"
|
"github.com/ouqiang/gocron/routers/host"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 路由注册
|
// 路由注册
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
package service
|
package service
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ouqiang/cron-scheduler/models"
|
"github.com/ouqiang/gocron/models"
|
||||||
"github.com/ouqiang/cron-scheduler/modules/ansible"
|
"github.com/ouqiang/gocron/modules/ansible"
|
||||||
"github.com/ouqiang/cron-scheduler/modules/crontask"
|
"github.com/ouqiang/gocron/modules/crontask"
|
||||||
"github.com/robfig/cron"
|
"github.com/robfig/cron"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
"github.com/ouqiang/cron-scheduler/modules/logger"
|
"github.com/ouqiang/gocron/modules/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Task struct{}
|
type Task struct{}
|
||||||
|
@ -69,7 +69,7 @@ func (h *HTTPHandler) Run(taskModel models.Task) (result string, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
req.Header.Set("Content-type", "application/x-www-form-urlencoded")
|
req.Header.Set("Content-type", "application/x-www-form-urlencoded")
|
||||||
req.Header.Set("User-Agent", "golang/cron-scheduler")
|
req.Header.Set("User-Agent", "golang/gocron")
|
||||||
|
|
||||||
resp, err := client.Do(req)
|
resp, err := client.Do(req)
|
||||||
defer func() {
|
defer func() {
|
||||||
|
|
Loading…
Reference in New Issue