包重命名为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/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

View File

@ -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,

View File

@ -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"
) )

View File

@ -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是否有安装

View File

@ -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"
) )
// 主机名 // 主机名

View File

@ -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"
) )

View File

@ -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 格式输出

View File

@ -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"
) )

View File

@ -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"
) )
// 路由注册 // 路由注册

View File

@ -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() {