rename to v2
This commit is contained in:
@@ -20,7 +20,7 @@ import (
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/core/logs"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
)
|
||||
|
||||
// BeeAdminApp is the default adminApp used by admin module.
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
|
||||
"github.com/beego/beego/core/admin"
|
||||
"github.com/beego/beego/v2/core/admin"
|
||||
)
|
||||
|
||||
type adminController struct {
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/core/admin"
|
||||
"github.com/beego/beego/v2/core/admin"
|
||||
)
|
||||
|
||||
type SampleDatabaseCheck struct {
|
||||
|
||||
@@ -6,9 +6,9 @@ an example for use captcha
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/beego/beego"
|
||||
"github.com/beego/beego/cache"
|
||||
"github.com/beego/beego/utils/captcha"
|
||||
"github.com/beego/beego/v2"
|
||||
"github.com/beego/beego/v2/cache"
|
||||
"github.com/beego/beego/v2/utils/captcha"
|
||||
)
|
||||
|
||||
var cpt *captcha.Captcha
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
// package controllers
|
||||
//
|
||||
// import (
|
||||
// "github.com/beego/beego"
|
||||
// "github.com/beego/beego/cache"
|
||||
// "github.com/beego/beego/utils/captcha"
|
||||
// "github.com/beego/beego/v2"
|
||||
// "github.com/beego/beego/v2/cache"
|
||||
// "github.com/beego/beego/v2/utils/captcha"
|
||||
// )
|
||||
//
|
||||
// var cpt *captcha.Captcha
|
||||
@@ -67,11 +67,11 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/core/logs"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
|
||||
"github.com/beego/beego/core/utils"
|
||||
"github.com/beego/beego/server/web"
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -17,7 +17,7 @@ package captcha
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/beego/beego/core/utils"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
)
|
||||
|
||||
type byteCounter struct {
|
||||
|
||||
@@ -23,13 +23,13 @@ import (
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/beego/beego"
|
||||
"github.com/beego/beego/core/config"
|
||||
"github.com/beego/beego/core/logs"
|
||||
"github.com/beego/beego/server/web/session"
|
||||
"github.com/beego/beego/v2"
|
||||
"github.com/beego/beego/v2/core/config"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
|
||||
"github.com/beego/beego/core/utils"
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
// Config is the main struct for BConfig
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
beeJson "github.com/beego/beego/core/config/json"
|
||||
beeJson "github.com/beego/beego/v2/core/config/json"
|
||||
)
|
||||
|
||||
func TestDefaults(t *testing.T) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// Package context provide the context utils
|
||||
// Usage:
|
||||
//
|
||||
// import "github.com/beego/beego/context"
|
||||
// import "github.com/beego/beego/v2/context"
|
||||
//
|
||||
// ctx := context.Context{Request:req,ResponseWriter:rw}
|
||||
//
|
||||
@@ -35,7 +35,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/core/utils"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
)
|
||||
|
||||
// Commonly used mime-types
|
||||
|
||||
@@ -29,7 +29,7 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/beego/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
// Regexes for checking the accept headers
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"github.com/beego/beego/core/logs"
|
||||
beecontext "github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
beecontext "github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
// ConvertParams converts http method params to values that will be passed to the method controller as arguments
|
||||
|
||||
@@ -29,10 +29,10 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/beego/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/server/web/context/param"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context/param"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
func TestGetInt(t *testing.T) {
|
||||
|
||||
@@ -6,7 +6,7 @@ It is used for rapid development of RESTful APIs, web apps and backend services
|
||||
beego is inspired by Tornado, Sinatra and Flask with the added benefit of some Go-specific features such as interfaces and struct embedding.
|
||||
|
||||
package main
|
||||
import "github.com/beego/beego"
|
||||
import "github.com/beego/beego/v2"
|
||||
|
||||
func main() {
|
||||
beego.Run()
|
||||
|
||||
@@ -23,10 +23,10 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/beego/beego"
|
||||
"github.com/beego/beego/core/utils"
|
||||
"github.com/beego/beego/v2"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -17,7 +17,7 @@ package web
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
// FilterChain is different from pure FilterFunc
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
//
|
||||
// Simple Usage:
|
||||
// import(
|
||||
// "github.com/beego/beego"
|
||||
// "github.com/beego/beego/plugins/apiauth"
|
||||
// "github.com/beego/beego/v2"
|
||||
// "github.com/beego/beego/v2/plugins/apiauth"
|
||||
// )
|
||||
//
|
||||
// func main(){
|
||||
@@ -65,8 +65,8 @@ import (
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/server/web"
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
// AppIDToAppSecret gets appsecret through appid
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
// Package auth provides handlers to enable basic auth support.
|
||||
// Simple Usage:
|
||||
// import(
|
||||
// "github.com/beego/beego"
|
||||
// "github.com/beego/beego/plugins/auth"
|
||||
// "github.com/beego/beego/v2"
|
||||
// "github.com/beego/beego/v2/plugins/auth"
|
||||
// )
|
||||
//
|
||||
// func main(){
|
||||
@@ -40,8 +40,8 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/beego/beego/server/web"
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
var defaultRealm = "Authorization Required"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
// Package authz provides handlers to enable ACL, RBAC, ABAC authorization support.
|
||||
// Simple Usage:
|
||||
// import(
|
||||
// "github.com/beego/beego"
|
||||
// "github.com/beego/beego/plugins/authz"
|
||||
// "github.com/beego/beego/v2"
|
||||
// "github.com/beego/beego/v2/plugins/authz"
|
||||
// "github.com/casbin/casbin"
|
||||
// )
|
||||
//
|
||||
@@ -44,8 +44,8 @@ import (
|
||||
|
||||
"github.com/casbin/casbin"
|
||||
|
||||
"github.com/beego/beego/server/web"
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
// NewAuthorizer returns the authorizer.
|
||||
|
||||
@@ -21,9 +21,9 @@ import (
|
||||
|
||||
"github.com/casbin/casbin"
|
||||
|
||||
"github.com/beego/beego/server/web"
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/server/web/filter/auth"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/filter/auth"
|
||||
)
|
||||
|
||||
func testRequest(t *testing.T, handler *web.ControllerRegister, user string, path string, method string, code int) {
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
// Package cors provides handlers to enable CORS support.
|
||||
// Usage
|
||||
// import (
|
||||
// "github.com/beego/beego"
|
||||
// "github.com/beego/beego/plugins/cors"
|
||||
// "github.com/beego/beego/v2"
|
||||
// "github.com/beego/beego/v2/plugins/cors"
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
@@ -42,8 +42,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/server/web"
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -21,8 +21,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/server/web"
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
// HTTPHeaderGuardRecorder is httptest.ResponseRecorder with own http.Header
|
||||
|
||||
@@ -17,8 +17,8 @@ package opentracing
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/beego/beego/server/web"
|
||||
beegoCtx "github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
beegoCtx "github.com/beego/beego/v2/server/web/context"
|
||||
logKit "github.com/go-kit/kit/log"
|
||||
opentracingKit "github.com/go-kit/kit/tracing/opentracing"
|
||||
"github.com/opentracing/opentracing-go"
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"github.com/opentracing/opentracing-go"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
func TestFilterChainBuilder_FilterChain(t *testing.T) {
|
||||
|
||||
@@ -21,9 +21,9 @@ import (
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
|
||||
"github.com/beego/beego"
|
||||
"github.com/beego/beego/server/web"
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
// FilterChainBuilder is an extension point,
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
func TestFilterChain(t *testing.T) {
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
func TestControllerRegister_InsertFilterChain(t *testing.T) {
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
var FilterUser = func(ctx *context.Context) {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
// "net/http"
|
||||
// "os"
|
||||
//
|
||||
// "github.com/beego/beego/grace"
|
||||
// "github.com/beego/beego/v2/grace"
|
||||
// )
|
||||
//
|
||||
// func handler(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
@@ -6,9 +6,9 @@ import (
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/beego/beego/core/logs"
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
// register MIME type with content type
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
beecontext "github.com/beego/beego/server/web/context"
|
||||
beecontext "github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
type namespaceCond func(*beecontext.Context) bool
|
||||
@@ -97,91 +97,91 @@ func (n *Namespace) Filter(action string, filter ...FilterFunc) *Namespace {
|
||||
}
|
||||
|
||||
// Router same as beego.Rourer
|
||||
// refer: https://godoc.org/github.com/beego/beego#Router
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Router
|
||||
func (n *Namespace) Router(rootpath string, c ControllerInterface, mappingMethods ...string) *Namespace {
|
||||
n.handlers.Add(rootpath, c, mappingMethods...)
|
||||
return n
|
||||
}
|
||||
|
||||
// AutoRouter same as beego.AutoRouter
|
||||
// refer: https://godoc.org/github.com/beego/beego#AutoRouter
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#AutoRouter
|
||||
func (n *Namespace) AutoRouter(c ControllerInterface) *Namespace {
|
||||
n.handlers.AddAuto(c)
|
||||
return n
|
||||
}
|
||||
|
||||
// AutoPrefix same as beego.AutoPrefix
|
||||
// refer: https://godoc.org/github.com/beego/beego#AutoPrefix
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#AutoPrefix
|
||||
func (n *Namespace) AutoPrefix(prefix string, c ControllerInterface) *Namespace {
|
||||
n.handlers.AddAutoPrefix(prefix, c)
|
||||
return n
|
||||
}
|
||||
|
||||
// Get same as beego.Get
|
||||
// refer: https://godoc.org/github.com/beego/beego#Get
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Get
|
||||
func (n *Namespace) Get(rootpath string, f FilterFunc) *Namespace {
|
||||
n.handlers.Get(rootpath, f)
|
||||
return n
|
||||
}
|
||||
|
||||
// Post same as beego.Post
|
||||
// refer: https://godoc.org/github.com/beego/beego#Post
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Post
|
||||
func (n *Namespace) Post(rootpath string, f FilterFunc) *Namespace {
|
||||
n.handlers.Post(rootpath, f)
|
||||
return n
|
||||
}
|
||||
|
||||
// Delete same as beego.Delete
|
||||
// refer: https://godoc.org/github.com/beego/beego#Delete
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Delete
|
||||
func (n *Namespace) Delete(rootpath string, f FilterFunc) *Namespace {
|
||||
n.handlers.Delete(rootpath, f)
|
||||
return n
|
||||
}
|
||||
|
||||
// Put same as beego.Put
|
||||
// refer: https://godoc.org/github.com/beego/beego#Put
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Put
|
||||
func (n *Namespace) Put(rootpath string, f FilterFunc) *Namespace {
|
||||
n.handlers.Put(rootpath, f)
|
||||
return n
|
||||
}
|
||||
|
||||
// Head same as beego.Head
|
||||
// refer: https://godoc.org/github.com/beego/beego#Head
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Head
|
||||
func (n *Namespace) Head(rootpath string, f FilterFunc) *Namespace {
|
||||
n.handlers.Head(rootpath, f)
|
||||
return n
|
||||
}
|
||||
|
||||
// Options same as beego.Options
|
||||
// refer: https://godoc.org/github.com/beego/beego#Options
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Options
|
||||
func (n *Namespace) Options(rootpath string, f FilterFunc) *Namespace {
|
||||
n.handlers.Options(rootpath, f)
|
||||
return n
|
||||
}
|
||||
|
||||
// Patch same as beego.Patch
|
||||
// refer: https://godoc.org/github.com/beego/beego#Patch
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Patch
|
||||
func (n *Namespace) Patch(rootpath string, f FilterFunc) *Namespace {
|
||||
n.handlers.Patch(rootpath, f)
|
||||
return n
|
||||
}
|
||||
|
||||
// Any same as beego.Any
|
||||
// refer: https://godoc.org/github.com/beego/beego#Any
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Any
|
||||
func (n *Namespace) Any(rootpath string, f FilterFunc) *Namespace {
|
||||
n.handlers.Any(rootpath, f)
|
||||
return n
|
||||
}
|
||||
|
||||
// Handler same as beego.Handler
|
||||
// refer: https://godoc.org/github.com/beego/beego#Handler
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Handler
|
||||
func (n *Namespace) Handler(rootpath string, h http.Handler) *Namespace {
|
||||
n.handlers.Handler(rootpath, h)
|
||||
return n
|
||||
}
|
||||
|
||||
// Include add include class
|
||||
// refer: https://godoc.org/github.com/beego/beego#Include
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Include
|
||||
func (n *Namespace) Include(cList ...ControllerInterface) *Namespace {
|
||||
n.handlers.Include(cList...)
|
||||
return n
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"strconv"
|
||||
"testing"
|
||||
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
func TestNamespaceGet(t *testing.T) {
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package pagination
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/core/utils/pagination"
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/core/utils/pagination"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
// SetPaginator Instantiates a Paginator and assigns it to context.Input.Data("paginator").
|
||||
|
||||
@@ -30,17 +30,17 @@ import (
|
||||
|
||||
"golang.org/x/tools/go/packages"
|
||||
|
||||
"github.com/beego/beego/core/logs"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
|
||||
"github.com/beego/beego/core/utils"
|
||||
"github.com/beego/beego/server/web/context/param"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
"github.com/beego/beego/v2/server/web/context/param"
|
||||
)
|
||||
|
||||
var globalRouterTemplate = `package {{.routersDir}}
|
||||
|
||||
import (
|
||||
beego "github.com/beego/beego/server/web"
|
||||
"github.com/beego/beego/server/web/context/param"{{.globalimport}}
|
||||
beego "github.com/beego/beego/v2/server/web"
|
||||
"github.com/beego/beego/v2/server/web/context/param"{{.globalimport}}
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -17,7 +17,7 @@ package web
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
// PolicyFunc defines a policy function which is invoked before the controller handler is executed.
|
||||
|
||||
@@ -25,11 +25,11 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/core/logs"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
|
||||
"github.com/beego/beego/core/utils"
|
||||
beecontext "github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/server/web/context/param"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
beecontext "github.com/beego/beego/v2/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context/param"
|
||||
)
|
||||
|
||||
// default filter execution points
|
||||
|
||||
@@ -21,9 +21,9 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/beego/beego/core/logs"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
type TestController struct {
|
||||
|
||||
@@ -31,11 +31,11 @@ import (
|
||||
|
||||
"golang.org/x/crypto/acme/autocert"
|
||||
|
||||
"github.com/beego/beego/core/logs"
|
||||
beecontext "github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
beecontext "github.com/beego/beego/v2/server/web/context"
|
||||
|
||||
"github.com/beego/beego/core/utils"
|
||||
"github.com/beego/beego/server/web/grace"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
"github.com/beego/beego/v2/server/web/grace"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -5,7 +5,7 @@ session is a Go session manager. It can use many session providers. Just like th
|
||||
|
||||
## How to install?
|
||||
|
||||
go get github.com/beego/beego/session
|
||||
go get github.com/beego/beego/v2/session
|
||||
|
||||
|
||||
## What providers are supported?
|
||||
@@ -18,7 +18,7 @@ As of now this session manager support memory, file, Redis and MySQL.
|
||||
First you must import it
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/session"
|
||||
"github.com/beego/beego/v2/session"
|
||||
)
|
||||
|
||||
Then in you web app init the global session manager
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/beego/beego/session/couchbase"
|
||||
// "github.com/beego/beego/session"
|
||||
// _ "github.com/beego/beego/v2/session/couchbase"
|
||||
// "github.com/beego/beego/v2/session"
|
||||
// )
|
||||
//
|
||||
// func init() {
|
||||
@@ -41,7 +41,7 @@ import (
|
||||
|
||||
couchbase "github.com/couchbase/go-couchbase"
|
||||
|
||||
"github.com/beego/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
var couchbpder = &Provider{}
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"github.com/ledisdb/ledisdb/config"
|
||||
"github.com/ledisdb/ledisdb/ledis"
|
||||
|
||||
"github.com/beego/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/beego/beego/session/memcache"
|
||||
// "github.com/beego/beego/session"
|
||||
// _ "github.com/beego/beego/v2/session/memcache"
|
||||
// "github.com/beego/beego/v2/session"
|
||||
// )
|
||||
//
|
||||
// func init() {
|
||||
@@ -38,7 +38,7 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/beego/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
|
||||
"github.com/bradfitz/gomemcache/memcache"
|
||||
)
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/beego/beego/session/mysql"
|
||||
// "github.com/beego/beego/session"
|
||||
// _ "github.com/beego/beego/v2/session/mysql"
|
||||
// "github.com/beego/beego/v2/session"
|
||||
// )
|
||||
//
|
||||
// func init() {
|
||||
@@ -47,7 +47,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
// import mysql driver
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
)
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/beego/beego/session/postgresql"
|
||||
// "github.com/beego/beego/session"
|
||||
// _ "github.com/beego/beego/v2/session/postgresql"
|
||||
// "github.com/beego/beego/v2/session"
|
||||
// )
|
||||
//
|
||||
// func init() {
|
||||
@@ -57,7 +57,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
// import postgresql Driver
|
||||
_ "github.com/lib/pq"
|
||||
)
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/beego/beego/session/redis"
|
||||
// "github.com/beego/beego/session"
|
||||
// _ "github.com/beego/beego/v2/session/redis"
|
||||
// "github.com/beego/beego/v2/session"
|
||||
// )
|
||||
//
|
||||
// func init() {
|
||||
@@ -43,7 +43,7 @@ import (
|
||||
|
||||
"github.com/go-redis/redis/v7"
|
||||
|
||||
"github.com/beego/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
var redispder = &Provider{}
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
func TestRedis(t *testing.T) {
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/beego/beego/session/redis_cluster"
|
||||
// "github.com/beego/beego/session"
|
||||
// _ "github.com/beego/beego/v2/session/redis_cluster"
|
||||
// "github.com/beego/beego/v2/session"
|
||||
// )
|
||||
//
|
||||
// func init() {
|
||||
@@ -43,7 +43,7 @@ import (
|
||||
|
||||
rediss "github.com/go-redis/redis/v7"
|
||||
|
||||
"github.com/beego/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
var redispder = &Provider{}
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/beego/beego/session/redis_sentinel"
|
||||
// "github.com/beego/beego/session"
|
||||
// _ "github.com/beego/beego/v2/session/redis_sentinel"
|
||||
// "github.com/beego/beego/v2/session"
|
||||
// )
|
||||
//
|
||||
// func init() {
|
||||
@@ -43,7 +43,7 @@ import (
|
||||
|
||||
"github.com/go-redis/redis/v7"
|
||||
|
||||
"github.com/beego/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
var redispder = &Provider{}
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
func TestRedisSentinel(t *testing.T) {
|
||||
|
||||
@@ -29,7 +29,7 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/core/utils"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// "github.com/beego/beego/session"
|
||||
// "github.com/beego/beego/v2/session"
|
||||
// )
|
||||
//
|
||||
// func init() {
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
"github.com/ssdb/gossdb/ssdb"
|
||||
|
||||
"github.com/beego/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
var ssdbProvider = &Provider{}
|
||||
|
||||
@@ -26,10 +26,10 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/core/logs"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
lru "github.com/hashicorp/golang-lru"
|
||||
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
var errNotStaticRequest = errors.New("request not a static file request")
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/core/utils"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
)
|
||||
|
||||
// Statistics struct
|
||||
|
||||
@@ -27,8 +27,8 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/beego/beego/core/logs"
|
||||
"github.com/beego/beego/core/utils"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
assetfs "github.com/elazarl/go-bindata-assetfs"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/test"
|
||||
"github.com/beego/beego/v2/test"
|
||||
)
|
||||
|
||||
var header = `{{define "header"}}
|
||||
|
||||
@@ -19,9 +19,9 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/beego/beego/core/utils"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/beego/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
type testInfo struct {
|
||||
@@ -93,7 +93,7 @@ func init() {
|
||||
|
||||
//not match example
|
||||
|
||||
// https://github.com/beego/beego/issues/3865
|
||||
// https://github.com/beego/beego/v2/issues/3865
|
||||
routers = append(routers, notMatchTestInfo("/read_:id:int\\.htm", "/read_222htm"))
|
||||
routers = append(routers, notMatchTestInfo("/read_:id:int\\.htm", "/read_222_htm"))
|
||||
routers = append(routers, notMatchTestInfo("/read_:id:int\\.htm", " /read_262shtm"))
|
||||
|
||||
Reference in New Issue
Block a user