mirror of
https://github.com/beego/bee.git
synced 2024-11-23 11:50:55 +00:00
commit
3b2304a480
2
Makefile
2
Makefile
@ -24,6 +24,6 @@ clean:
|
|||||||
publish:
|
publish:
|
||||||
mkdir -p bin/$(VERSION)
|
mkdir -p bin/$(VERSION)
|
||||||
cd bin/$(VERSION)
|
cd bin/$(VERSION)
|
||||||
xgo -v -x --targets="windows/*,darwin/*,linux/386,linux/amd64,linux/arm-5,linux/arm64" -out bee_$(VERSION) github.com/beego/bee
|
xgo -v -x --targets="windows/*,darwin/*,linux/386,linux/amd64,linux/arm-5,linux/arm64" -out bee_$(VERSION) github.com/beego/bee/v2
|
||||||
cd ..
|
cd ..
|
||||||
ghr -u beego -r bee $(VERSION) $(VERSION)
|
ghr -u beego -r bee $(VERSION) $(VERSION)
|
||||||
|
@ -16,7 +16,7 @@ Bee is a command-line tool facilitating development of Beego-based application.
|
|||||||
To install `bee` use the `go get` command:
|
To install `bee` use the `go get` command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go get github.com/beego/bee
|
go get github.com/beego/bee/v2
|
||||||
```
|
```
|
||||||
|
|
||||||
Then you can add `bee` binary to PATH environment variable in your `~/.bashrc` or `~/.bash_profile` file:
|
Then you can add `bee` binary to PATH environment variable in your `~/.bashrc` or `~/.bash_profile` file:
|
||||||
@ -28,7 +28,7 @@ export PATH=$PATH:<your_main_gopath>/bin
|
|||||||
> If you already have `bee` installed, updating `bee` is simple:
|
> If you already have `bee` installed, updating `bee` is simple:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go get -u github.com/beego/bee
|
go get -u github.com/beego/bee/v2
|
||||||
```
|
```
|
||||||
|
|
||||||
## Basic commands
|
## Basic commands
|
||||||
|
38
cmd/bee.go
38
cmd/bee.go
@ -16,25 +16,25 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
_ "github.com/beego/bee/cmd/commands/api"
|
_ "github.com/beego/bee/v2/cmd/commands/api"
|
||||||
_ "github.com/beego/bee/cmd/commands/bale"
|
_ "github.com/beego/bee/v2/cmd/commands/bale"
|
||||||
_ "github.com/beego/bee/cmd/commands/beefix"
|
_ "github.com/beego/bee/v2/cmd/commands/beefix"
|
||||||
_ "github.com/beego/bee/cmd/commands/beegopro"
|
_ "github.com/beego/bee/v2/cmd/commands/beegopro"
|
||||||
_ "github.com/beego/bee/cmd/commands/dev"
|
_ "github.com/beego/bee/v2/cmd/commands/dev"
|
||||||
_ "github.com/beego/bee/cmd/commands/dlv"
|
_ "github.com/beego/bee/v2/cmd/commands/dlv"
|
||||||
_ "github.com/beego/bee/cmd/commands/dockerize"
|
_ "github.com/beego/bee/v2/cmd/commands/dockerize"
|
||||||
_ "github.com/beego/bee/cmd/commands/generate"
|
_ "github.com/beego/bee/v2/cmd/commands/generate"
|
||||||
_ "github.com/beego/bee/cmd/commands/hprose"
|
_ "github.com/beego/bee/v2/cmd/commands/hprose"
|
||||||
_ "github.com/beego/bee/cmd/commands/migrate"
|
_ "github.com/beego/bee/v2/cmd/commands/migrate"
|
||||||
_ "github.com/beego/bee/cmd/commands/new"
|
_ "github.com/beego/bee/v2/cmd/commands/new"
|
||||||
_ "github.com/beego/bee/cmd/commands/pack"
|
_ "github.com/beego/bee/v2/cmd/commands/pack"
|
||||||
_ "github.com/beego/bee/cmd/commands/rs"
|
_ "github.com/beego/bee/v2/cmd/commands/rs"
|
||||||
_ "github.com/beego/bee/cmd/commands/run"
|
_ "github.com/beego/bee/v2/cmd/commands/run"
|
||||||
_ "github.com/beego/bee/cmd/commands/server"
|
_ "github.com/beego/bee/v2/cmd/commands/server"
|
||||||
_ "github.com/beego/bee/cmd/commands/update"
|
_ "github.com/beego/bee/v2/cmd/commands/update"
|
||||||
_ "github.com/beego/bee/cmd/commands/version"
|
_ "github.com/beego/bee/v2/cmd/commands/version"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func IfGenerateDocs(name string, args []string) bool {
|
func IfGenerateDocs(name string, args []string) bool {
|
||||||
|
@ -20,13 +20,13 @@ import (
|
|||||||
path "path/filepath"
|
path "path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/beego/bee/logger/colors"
|
"github.com/beego/bee/v2/logger/colors"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
"github.com/beego/bee/cmd/commands/version"
|
"github.com/beego/bee/v2/cmd/commands/version"
|
||||||
"github.com/beego/bee/generate"
|
"github.com/beego/bee/v2/generate"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var CmdApiapp = &commands.Command{
|
var CmdApiapp = &commands.Command{
|
||||||
|
@ -24,11 +24,11 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
"github.com/beego/bee/cmd/commands/version"
|
"github.com/beego/bee/v2/cmd/commands/version"
|
||||||
"github.com/beego/bee/config"
|
"github.com/beego/bee/v2/config"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var CmdBale = &commands.Command{
|
var CmdBale = &commands.Command{
|
||||||
|
@ -3,10 +3,10 @@ package beefix
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
"github.com/beego/bee/cmd/commands/version"
|
"github.com/beego/bee/v2/cmd/commands/version"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var CmdFix = &commands.Command{
|
var CmdFix = &commands.Command{
|
||||||
@ -36,7 +36,7 @@ func init() {
|
|||||||
|
|
||||||
func runFix(cmd *commands.Command, args []string) int {
|
func runFix(cmd *commands.Command, args []string) int {
|
||||||
t := target.String()
|
t := target.String()
|
||||||
if t == "" || t == "1.6"{
|
if t == "" || t == "1.6" {
|
||||||
return fixTo16(cmd, args)
|
return fixTo16(cmd, args)
|
||||||
} else if strings.HasPrefix(t, "2") {
|
} else if strings.HasPrefix(t, "2") {
|
||||||
// upgrade to v2
|
// upgrade to v2
|
||||||
|
@ -18,20 +18,32 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
func fix1To2() int {
|
func fix1To2() int {
|
||||||
beeLogger.Log.Info("Upgrading the application...")
|
beeLogger.Log.Info("Upgrading the application...")
|
||||||
|
|
||||||
cmdStr := `find ./ -name '*.go' -type f -exec sed -i '' -e 's/github.com\/astaxie\/beego/github.com\/beego\/beego\/v2\/adapter/g' {} \;`
|
cmdStr := `go get -u github.com/beego/beego/v2@develop`
|
||||||
err := runShell(cmdStr)
|
err := runShell(cmdStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
beeLogger.Log.Error(err.Error())
|
||||||
|
beeLogger.Log.Error(`fetch v2.0.1 failed. Please try to run: export GO111MODULE=on
|
||||||
|
and if your network is not stable, please try to use proxy, for example: export GOPROXY=https://goproxy.cn;'
|
||||||
|
`)
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
cmdStr = `find ./ -name '*.go' -type f -exec sed -i '' -e 's/github.com\/astaxie\/beego/github.com\/beego\/beego\/v2\/adapter/g' {} \;`
|
||||||
|
err = runShell(cmdStr)
|
||||||
|
if err != nil {
|
||||||
|
beeLogger.Log.Error(err.Error())
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
cmdStr = `find ./ -name '*.go' -type f -exec sed -i '' -e 's/"github.com\/beego\/beego\/v2\/adapter"/beego "github.com\/beego\/beego\/v2\/adapter"/g' {} \;`
|
cmdStr = `find ./ -name '*.go' -type f -exec sed -i '' -e 's/"github.com\/beego\/beego\/v2\/adapter"/beego "github.com\/beego\/beego\/v2\/adapter"/g' {} \;`
|
||||||
err = runShell(cmdStr)
|
err = runShell(cmdStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
beeLogger.Log.Error(err.Error())
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
|
@ -24,9 +24,9 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/logger/colors"
|
"github.com/beego/bee/v2/logger/colors"
|
||||||
)
|
)
|
||||||
|
|
||||||
// fixTo16 upgrade beego to 1.6
|
// fixTo16 upgrade beego to 1.6
|
||||||
@ -228,4 +228,3 @@ func fixFile(file string) error {
|
|||||||
}
|
}
|
||||||
return ioutil.WriteFile(file, []byte(fixed), 0666)
|
return ioutil.WriteFile(file, []byte(fixed), 0666)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,9 +16,9 @@ package beegopro
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
"github.com/beego/bee/internal/app/module/beegopro"
|
"github.com/beego/bee/v2/internal/app/module/beegopro"
|
||||||
"github.com/beego/bee/logger"
|
"github.com/beego/bee/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
var CmdBeegoPro = &commands.Command{
|
var CmdBeegoPro = &commands.Command{
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/beego/bee/logger/colors"
|
"github.com/beego/bee/v2/logger/colors"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Command is the unit of execution
|
// Command is the unit of execution
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
package dev
|
package dev
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
var CmdDev = &commands.Command{
|
var CmdDev = &commands.Command{
|
||||||
|
@ -17,7 +17,7 @@ package dev
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
var preCommit = `
|
var preCommit = `
|
||||||
|
@ -24,16 +24,16 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
"github.com/beego/bee/cmd/commands/version"
|
"github.com/beego/bee/v2/cmd/commands/version"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
|
"github.com/fsnotify/fsnotify"
|
||||||
|
"github.com/go-delve/delve/pkg/terminal"
|
||||||
"github.com/go-delve/delve/service"
|
"github.com/go-delve/delve/service"
|
||||||
"github.com/go-delve/delve/service/debugger"
|
"github.com/go-delve/delve/service/debugger"
|
||||||
"github.com/go-delve/delve/service/rpc2"
|
"github.com/go-delve/delve/service/rpc2"
|
||||||
"github.com/go-delve/delve/service/rpccommon"
|
"github.com/go-delve/delve/service/rpccommon"
|
||||||
"github.com/go-delve/delve/pkg/terminal"
|
|
||||||
"github.com/fsnotify/fsnotify"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var cmdDlv = &commands.Command{
|
var cmdDlv = &commands.Command{
|
||||||
|
@ -22,10 +22,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"text/template"
|
"text/template"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
"github.com/beego/bee/cmd/commands/version"
|
"github.com/beego/bee/v2/cmd/commands/version"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const dockerBuildTemplate = `FROM {{.BaseImage}}
|
const dockerBuildTemplate = `FROM {{.BaseImage}}
|
||||||
|
@ -17,13 +17,13 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
"github.com/beego/bee/cmd/commands/version"
|
"github.com/beego/bee/v2/cmd/commands/version"
|
||||||
"github.com/beego/bee/config"
|
"github.com/beego/bee/v2/config"
|
||||||
"github.com/beego/bee/generate"
|
"github.com/beego/bee/v2/generate"
|
||||||
"github.com/beego/bee/generate/swaggergen"
|
"github.com/beego/bee/v2/generate/swaggergen"
|
||||||
"github.com/beego/bee/logger"
|
"github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var CmdGenerate = &commands.Command{
|
var CmdGenerate = &commands.Command{
|
||||||
|
@ -6,14 +6,14 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/beego/bee/logger/colors"
|
"github.com/beego/bee/v2/logger/colors"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
"github.com/beego/bee/cmd/commands/api"
|
"github.com/beego/bee/v2/cmd/commands/api"
|
||||||
"github.com/beego/bee/cmd/commands/version"
|
"github.com/beego/bee/v2/cmd/commands/version"
|
||||||
"github.com/beego/bee/generate"
|
"github.com/beego/bee/v2/generate"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var CmdHproseapp = &commands.Command{
|
var CmdHproseapp = &commands.Command{
|
||||||
|
@ -23,12 +23,12 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
"github.com/beego/bee/cmd/commands/version"
|
"github.com/beego/bee/v2/cmd/commands/version"
|
||||||
"github.com/beego/bee/config"
|
"github.com/beego/bee/v2/config"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
|
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
var CmdMigrate = &commands.Command{
|
var CmdMigrate = &commands.Command{
|
||||||
|
@ -20,11 +20,11 @@ import (
|
|||||||
path "path/filepath"
|
path "path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
"github.com/beego/bee/cmd/commands/version"
|
"github.com/beego/bee/v2/cmd/commands/version"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/logger/colors"
|
"github.com/beego/bee/v2/logger/colors"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var gopath utils.DocValue
|
var gopath utils.DocValue
|
||||||
|
@ -18,10 +18,10 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
"github.com/beego/bee/cmd/commands/version"
|
"github.com/beego/bee/v2/cmd/commands/version"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var CmdPack = &commands.Command{
|
var CmdPack = &commands.Command{
|
||||||
|
@ -24,12 +24,12 @@ import (
|
|||||||
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
"github.com/beego/bee/cmd/commands/version"
|
"github.com/beego/bee/v2/cmd/commands/version"
|
||||||
"github.com/beego/bee/config"
|
"github.com/beego/bee/v2/config"
|
||||||
"github.com/beego/bee/logger"
|
"github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/logger/colors"
|
"github.com/beego/bee/v2/logger/colors"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var cmdRs = &commands.Command{
|
var cmdRs = &commands.Command{
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -18,7 +18,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -20,11 +20,11 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
"github.com/beego/bee/cmd/commands/version"
|
"github.com/beego/bee/v2/cmd/commands/version"
|
||||||
"github.com/beego/bee/config"
|
"github.com/beego/bee/v2/config"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var CmdRun = &commands.Command{
|
var CmdRun = &commands.Command{
|
||||||
|
@ -24,10 +24,10 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/beego/bee/config"
|
"github.com/beego/bee/v2/config"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/logger/colors"
|
"github.com/beego/bee/v2/logger/colors"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
"github.com/fsnotify/fsnotify"
|
"github.com/fsnotify/fsnotify"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -17,13 +17,13 @@ package apiapp
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
"github.com/beego/bee/cmd/commands/version"
|
"github.com/beego/bee/v2/cmd/commands/version"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var CmdServer = &commands.Command{
|
var CmdServer = &commands.Command{
|
||||||
|
@ -5,16 +5,16 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
"github.com/beego/bee/config"
|
"github.com/beego/bee/v2/config"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
var CmdUpdate = &commands.Command{
|
var CmdUpdate = &commands.Command{
|
||||||
UsageLine: "update",
|
UsageLine: "update",
|
||||||
Short: "Update Bee",
|
Short: "Update Bee",
|
||||||
Long: `
|
Long: `
|
||||||
Automatic run command "go get -u github.com/beego/bee" for selfupdate
|
Automatic run command "go get -u github.com/beego/bee/v2" for selfupdate
|
||||||
`,
|
`,
|
||||||
Run: updateBee,
|
Run: updateBee,
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RuntimeInfo holds information about the current runtime.
|
// RuntimeInfo holds information about the current runtime.
|
||||||
|
@ -16,11 +16,11 @@ import (
|
|||||||
|
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
"github.com/beego/bee/config"
|
"github.com/beego/bee/v2/config"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/logger/colors"
|
"github.com/beego/bee/v2/logger/colors"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const verboseVersionBanner string = `%s%s______
|
const verboseVersionBanner string = `%s%s______
|
||||||
|
@ -21,14 +21,14 @@ import (
|
|||||||
|
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
|
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
const confVer = 0
|
const confVer = 0
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Version = "2.0.1"
|
Version = "2.0.1"
|
||||||
GitRemotePath = "github.com/beego/bee"
|
GitRemotePath = "github.com/beego/bee/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var Conf = struct {
|
var Conf = struct {
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
package generate
|
package generate
|
||||||
|
|
||||||
import "github.com/beego/bee/utils"
|
import "github.com/beego/bee/v2/utils"
|
||||||
|
|
||||||
var SQLDriver utils.DocValue
|
var SQLDriver utils.DocValue
|
||||||
var SQLConn utils.DocValue
|
var SQLConn utils.DocValue
|
||||||
|
@ -25,9 +25,9 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/logger/colors"
|
"github.com/beego/bee/v2/logger/colors"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
_ "github.com/go-sql-driver/mysql"
|
_ "github.com/go-sql-driver/mysql"
|
||||||
_ "github.com/lib/pq"
|
_ "github.com/lib/pq"
|
||||||
)
|
)
|
||||||
|
@ -20,9 +20,9 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/logger/colors"
|
"github.com/beego/bee/v2/logger/colors"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GenerateController(cname, currpath string) {
|
func GenerateController(cname, currpath string) {
|
||||||
|
@ -24,9 +24,9 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/logger/colors"
|
"github.com/beego/bee/v2/logger/colors"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
_ "github.com/go-sql-driver/mysql"
|
_ "github.com/go-sql-driver/mysql"
|
||||||
_ "github.com/lib/pq"
|
_ "github.com/lib/pq"
|
||||||
)
|
)
|
||||||
|
@ -21,9 +21,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/beego/bee/logger"
|
"github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/logger/colors"
|
"github.com/beego/bee/v2/logger/colors"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -21,9 +21,9 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/logger/colors"
|
"github.com/beego/bee/v2/logger/colors"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GenerateModel(mname, fields, currpath string) {
|
func GenerateModel(mname, fields, currpath string) {
|
||||||
|
@ -3,9 +3,9 @@ package generate
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd/commands/migrate"
|
"github.com/beego/bee/v2/cmd/commands/migrate"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GenerateScaffold(sname, fields, currpath, driver, conn string) {
|
func GenerateScaffold(sname, fields, currpath, driver, conn string) {
|
||||||
|
@ -19,9 +19,9 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/logger/colors"
|
"github.com/beego/bee/v2/logger/colors"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
// recipe
|
// recipe
|
||||||
|
@ -35,9 +35,9 @@ import (
|
|||||||
|
|
||||||
yaml "gopkg.in/yaml.v2"
|
yaml "gopkg.in/yaml.v2"
|
||||||
|
|
||||||
"github.com/beego/beego/v2/server/web/swagger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/beego/v2/core/utils"
|
"github.com/beego/beego/v2/core/utils"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
"github.com/beego/beego/v2/server/web/swagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
2
go.mod
2
go.mod
@ -1,4 +1,4 @@
|
|||||||
module github.com/beego/bee
|
module github.com/beego/bee/v2
|
||||||
|
|
||||||
go 1.13
|
go 1.13
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
github.com/beego/bee/cmd/commands/run/*.go:S1024
|
github.com/beego/bee/v2/cmd/commands/run/*.go:S1024
|
||||||
github.com/beego/bee/cmd/commands/dlv/*.go:S1024
|
github.com/beego/bee/v2/cmd/commands/dlv/*.go:S1024
|
||||||
github.com/beego/bee/utils/*.go:S1026
|
github.com/beego/bee/v2/utils/*.go:S1026
|
||||||
|
@ -3,8 +3,8 @@ package beegopro
|
|||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
|
||||||
"github.com/beego/bee/internal/pkg/utils"
|
"github.com/beego/bee/v2/internal/pkg/utils"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
var CompareExcept = []string{"@BeeGenerateTime"}
|
var CompareExcept = []string{"@BeeGenerateTime"}
|
||||||
|
@ -6,10 +6,10 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/beego/bee/internal/pkg/git"
|
"github.com/beego/bee/v2/internal/pkg/git"
|
||||||
"github.com/beego/bee/internal/pkg/system"
|
"github.com/beego/bee/v2/internal/pkg/system"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/davecgh/go-spew/spew"
|
||||||
"github.com/pelletier/go-toml"
|
"github.com/pelletier/go-toml"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var SQL utils.DocValue
|
var SQL utils.DocValue
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"database/sql"
|
"database/sql"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/beego/bee/internal/pkg/utils"
|
"github.com/beego/bee/v2/internal/pkg/utils"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MysqlParser struct {
|
type MysqlParser struct {
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
"github.com/flosch/pongo2"
|
"github.com/flosch/pongo2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@ import (
|
|||||||
"github.com/flosch/pongo2"
|
"github.com/flosch/pongo2"
|
||||||
"github.com/smartwalle/pongo2render"
|
"github.com/smartwalle/pongo2render"
|
||||||
|
|
||||||
"github.com/beego/bee/internal/pkg/system"
|
"github.com/beego/bee/v2/internal/pkg/system"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// render
|
// render
|
||||||
|
@ -6,10 +6,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/beego/bee/internal/pkg/command"
|
"github.com/beego/bee/v2/internal/pkg/command"
|
||||||
"github.com/beego/bee/internal/pkg/system"
|
"github.com/beego/bee/v2/internal/pkg/system"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
"github.com/flosch/pongo2"
|
"github.com/flosch/pongo2"
|
||||||
"github.com/smartwalle/pongo2render"
|
"github.com/smartwalle/pongo2render"
|
||||||
)
|
)
|
||||||
|
@ -3,7 +3,7 @@ package beegopro
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
// parse get the model info
|
// parse get the model info
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"database/sql"
|
"database/sql"
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/beego/bee/logger"
|
"github.com/beego/bee/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TableSchema struct {
|
type TableSchema struct {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package beegopro
|
package beegopro
|
||||||
|
|
||||||
import (
|
import (
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TextModel struct {
|
type TextModel struct {
|
||||||
|
@ -11,8 +11,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/beego/bee/internal/pkg/utils"
|
"github.com/beego/bee/v2/internal/pkg/utils"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// write to file
|
// write to file
|
||||||
|
@ -8,9 +8,9 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/beego/bee/internal/pkg/command"
|
"github.com/beego/bee/v2/internal/pkg/command"
|
||||||
"github.com/beego/bee/internal/pkg/utils"
|
"github.com/beego/bee/v2/internal/pkg/utils"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// git tag
|
// git tag
|
||||||
|
@ -3,7 +3,7 @@ package utils
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Mkdir ...
|
// Mkdir ...
|
||||||
|
@ -24,7 +24,7 @@ import (
|
|||||||
"text/template"
|
"text/template"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/beego/bee/logger/colors"
|
"github.com/beego/bee/v2/logger/colors"
|
||||||
)
|
)
|
||||||
|
|
||||||
var errInvalidLogLevel = errors.New("logger: invalid log level")
|
var errInvalidLogLevel = errors.New("logger: invalid log level")
|
||||||
|
8
main.go
8
main.go
@ -18,10 +18,10 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/beego/bee/cmd"
|
"github.com/beego/bee/v2/cmd"
|
||||||
"github.com/beego/bee/cmd/commands"
|
"github.com/beego/bee/v2/cmd/commands"
|
||||||
"github.com/beego/bee/config"
|
"github.com/beego/bee/v2/config"
|
||||||
"github.com/beego/bee/utils"
|
"github.com/beego/bee/v2/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -1 +1 @@
|
|||||||
github.com/beego/bee/generate/swaggergen/*.go:SA1024
|
github.com/beego/bee/v2/generate/swaggergen/*.go:SA1024
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
|
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/beego/bee/config"
|
"github.com/beego/bee/v2/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
const appName = "Beego"
|
const appName = "Beego"
|
||||||
|
@ -32,10 +32,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
"github.com/beego/bee/config"
|
"github.com/beego/bee/v2/config"
|
||||||
"github.com/beego/bee/internal/pkg/system"
|
"github.com/beego/bee/v2/internal/pkg/system"
|
||||||
beeLogger "github.com/beego/bee/logger"
|
beeLogger "github.com/beego/bee/v2/logger"
|
||||||
"github.com/beego/bee/logger/colors"
|
"github.com/beego/bee/v2/logger/colors"
|
||||||
)
|
)
|
||||||
|
|
||||||
type tagName struct {
|
type tagName struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user