项目包名改为 github.com/ouqiang

pull/21/merge
ouqiang 2017-03-23 13:58:42 +08:00
parent e8351141c0
commit 3a3ae7e024
9 changed files with 46 additions and 13 deletions

View File

@ -6,7 +6,9 @@ import (
"github.com/go-macaron/gzip" "github.com/go-macaron/gzip"
"github.com/go-macaron/session" "github.com/go-macaron/session"
"github.com/go-macaron/csrf" "github.com/go-macaron/csrf"
"scheduler/modules/app" "github.com/ouqiang/cron-scheduler/modules/app"
"fmt"
"os"
) )
// web服务器默认端口 // web服务器默认端口
@ -43,6 +45,8 @@ func run(ctx *cli.Context) {
// 定时任务调度 // 定时任务调度
func runScheduler() { func runScheduler() {
fmt.Println("hello world")
os.Exit(1)
} }
// 路由注册 // 路由注册

28
main.go Normal file
View File

@ -0,0 +1,28 @@
package main
/*--------------------------------------------------------
Linux crontab
HTTPSSH
--------------------------------------------------------*/
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)
}

View File

@ -3,7 +3,7 @@ package models
import ( import (
"github.com/go-xorm/xorm" "github.com/go-xorm/xorm"
"fmt" "fmt"
"scheduler/modules/setting" "github.com/ouqiang/cron-scheduler/modules/setting"
"github.com/go-xorm/core" "github.com/go-xorm/core"
_ "github.com/go-sql-driver/mysql" _ "github.com/go-sql-driver/mysql"
"gopkg.in/macaron.v1" "gopkg.in/macaron.v1"

View File

@ -2,7 +2,7 @@ package models
import ( import (
"time" "time"
"scheduler/modules/utils" "github.com/ouqiang/cron-scheduler/modules/utils"
) )
const PasswordSaltLength = 6; const PasswordSaltLength = 6;

View File

@ -4,10 +4,10 @@ package ansible
import ( import (
"os" "os"
"scheduler/modules/utils"
"errors" "errors"
"gopkg.in/yaml.v2" "gopkg.in/yaml.v2"
"io/ioutil" "io/ioutil"
"github.com/ouqiang/cron-scheduler/modules/utils"
) )
type Handler map[string]interface{} type Handler map[string]interface{}

View File

@ -1,7 +1,7 @@
package ansible package ansible
import ( import (
"scheduler/models" "github.com/ouqiang/cron-scheduler/models"
"sync" "sync"
"io/ioutil" "io/ioutil"
"bytes" "bytes"

View File

@ -2,11 +2,12 @@ package app
import ( import (
"os" "os"
"scheduler/modules/crontask"
"scheduler/models"
"runtime" "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 ( var (

View File

@ -1,13 +1,13 @@
package service package service
import ( import (
"scheduler/models" "github.com/ouqiang/cron-scheduler/models"
"scheduler/modules/utils" "github.com/ouqiang/cron-scheduler/modules/utils"
"net/http" "net/http"
"io/ioutil" "io/ioutil"
"strconv" "strconv"
"time" "time"
"scheduler/modules/crontask" "github.com/ouqiang/cron-scheduler/modules/crontask"
) )
type Task struct {} type Task struct {}

2
vendor/vendor.json vendored
View File

@ -107,5 +107,5 @@
"revisionTime": "2017-02-08T14:18:51Z" "revisionTime": "2017-02-08T14:18:51Z"
} }
], ],
"rootPath": "scheduler" "rootPath": "cron-scheduler"
} }