包重命名为gocron

pull/21/merge
ouqiang 2017-04-07 09:22:00 +08:00
parent 91f33515f6
commit b115e5a370
10 changed files with 30 additions and 30 deletions

View File

@ -4,8 +4,8 @@ import (
"github.com/go-macaron/csrf"
"github.com/go-macaron/gzip"
"github.com/go-macaron/session"
"github.com/ouqiang/cron-scheduler/modules/app"
"github.com/ouqiang/cron-scheduler/routers"
"github.com/ouqiang/gocron/modules/app"
"github.com/ouqiang/gocron/routers"
"github.com/urfave/cli"
"gopkg.in/macaron.v1"
"os"
@ -13,7 +13,7 @@ import (
"path/filepath"
"os/exec"
"syscall"
"github.com/ouqiang/cron-scheduler/modules/logger"
"github.com/ouqiang/gocron/modules/logger"
)
// 1号进程id

View File

@ -10,15 +10,15 @@ import (
"github.com/urfave/cli"
"os"
"github.com/ouqiang/cron-scheduler/cmd"
"github.com/ouqiang/gocron/cmd"
)
const AppVersion = "0.0.1"
func main() {
app := cli.NewApp()
app.Name = "cron-scheduler"
app.Usage = "cron-scheduler service"
app.Name = "gocron"
app.Usage = "gocron service"
app.Version = AppVersion
app.Commands = []cli.Command{
cmd.CmdWeb,

View File

@ -1,7 +1,7 @@
package models
import (
"github.com/ouqiang/cron-scheduler/modules/utils"
"github.com/ouqiang/gocron/modules/utils"
"time"
)

View File

@ -4,7 +4,7 @@ package ansible
import (
"errors"
"github.com/ouqiang/cron-scheduler/modules/utils"
"github.com/ouqiang/gocron/modules/utils"
)
// ansible是否有安装

View File

@ -2,11 +2,11 @@ package ansible
import (
"bytes"
"github.com/ouqiang/cron-scheduler/models"
"github.com/ouqiang/gocron/models"
"io/ioutil"
"strconv"
"sync"
"github.com/ouqiang/cron-scheduler/modules/logger"
"github.com/ouqiang/gocron/modules/logger"
)
// 主机名

View File

@ -3,12 +3,12 @@ package app
import (
"os"
"github.com/ouqiang/cron-scheduler/models"
"github.com/ouqiang/cron-scheduler/modules/ansible"
"github.com/ouqiang/cron-scheduler/modules/crontask"
"github.com/ouqiang/cron-scheduler/service"
"github.com/ouqiang/cron-scheduler/modules/setting"
"github.com/ouqiang/cron-scheduler/modules/logger"
"github.com/ouqiang/gocron/models"
"github.com/ouqiang/gocron/modules/ansible"
"github.com/ouqiang/gocron/modules/crontask"
"github.com/ouqiang/gocron/service"
"github.com/ouqiang/gocron/modules/setting"
"github.com/ouqiang/gocron/modules/logger"
"runtime"
)

View File

@ -2,7 +2,7 @@ package utils
import (
"encoding/json"
"github.com/ouqiang/cron-scheduler/modules/logger"
"github.com/ouqiang/gocron/modules/logger"
)
// json 格式输出

View File

@ -1,13 +1,13 @@
package install
import (
"github.com/ouqiang/cron-scheduler/models"
"github.com/ouqiang/cron-scheduler/modules/app"
"github.com/ouqiang/cron-scheduler/modules/setting"
"github.com/ouqiang/cron-scheduler/modules/utils"
"github.com/ouqiang/gocron/models"
"github.com/ouqiang/gocron/modules/app"
"github.com/ouqiang/gocron/modules/setting"
"github.com/ouqiang/gocron/modules/utils"
"gopkg.in/macaron.v1"
"strconv"
"github.com/ouqiang/cron-scheduler/modules/logger"
"github.com/ouqiang/gocron/modules/logger"
"github.com/go-macaron/binding"
)

View File

@ -2,10 +2,10 @@ package routers
import (
"github.com/go-macaron/binding"
"github.com/ouqiang/cron-scheduler/routers/install"
"github.com/ouqiang/gocron/routers/install"
"gopkg.in/macaron.v1"
"github.com/ouqiang/cron-scheduler/routers/task"
"github.com/ouqiang/cron-scheduler/routers/host"
"github.com/ouqiang/gocron/routers/task"
"github.com/ouqiang/gocron/routers/host"
)
// 路由注册

View File

@ -1,15 +1,15 @@
package service
import (
"github.com/ouqiang/cron-scheduler/models"
"github.com/ouqiang/cron-scheduler/modules/ansible"
"github.com/ouqiang/cron-scheduler/modules/crontask"
"github.com/ouqiang/gocron/models"
"github.com/ouqiang/gocron/modules/ansible"
"github.com/ouqiang/gocron/modules/crontask"
"github.com/robfig/cron"
"io/ioutil"
"net/http"
"strconv"
"time"
"github.com/ouqiang/cron-scheduler/modules/logger"
"github.com/ouqiang/gocron/modules/logger"
)
type Task struct{}
@ -69,7 +69,7 @@ func (h *HTTPHandler) Run(taskModel models.Task) (result string, err error) {
return
}
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)
defer func() {