Merge branch 'develop' of https://github.com/beego/beego into fix-issue-4176
This commit is contained in:
@@ -17,8 +17,8 @@ package adapter
|
||||
import (
|
||||
"time"
|
||||
|
||||
_ "github.com/astaxie/beego/core/admin"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
_ "github.com/beego/beego/v2/core/admin"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
)
|
||||
|
||||
// FilterMonitorFunc is default monitor filter when admin module is enable.
|
||||
|
||||
@@ -17,9 +17,9 @@ package adapter
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
context2 "github.com/astaxie/beego/adapter/context"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
"github.com/astaxie/beego/server/web/context"
|
||||
context2 "github.com/beego/beego/v2/adapter/context"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package adapter
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
"github.com/beego/beego/v2"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
2
adapter/cache/cache.go
vendored
2
adapter/cache/cache.go
vendored
@@ -16,7 +16,7 @@
|
||||
// Usage:
|
||||
//
|
||||
// import(
|
||||
// "github.com/astaxie/beego/cache"
|
||||
// "github.com/beego/beego/v2/cache"
|
||||
// )
|
||||
//
|
||||
// bm, err := cache.NewCache("memory", `{"interval":60}`)
|
||||
|
||||
2
adapter/cache/cache_adapter.go
vendored
2
adapter/cache/cache_adapter.go
vendored
@@ -18,7 +18,7 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego/client/cache"
|
||||
"github.com/beego/beego/v2/client/cache"
|
||||
)
|
||||
|
||||
type newToOldCacheAdapter struct {
|
||||
|
||||
8
adapter/cache/cache_test.go
vendored
8
adapter/cache/cache_test.go
vendored
@@ -26,7 +26,7 @@ func TestCacheIncr(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error("init err")
|
||||
}
|
||||
//timeoutDuration := 10 * time.Second
|
||||
// timeoutDuration := 10 * time.Second
|
||||
|
||||
bm.Put("edwardhey", 0, time.Second*20)
|
||||
wg := sync.WaitGroup{}
|
||||
@@ -90,7 +90,7 @@ func TestCache(t *testing.T) {
|
||||
t.Error("delete err")
|
||||
}
|
||||
|
||||
//test GetMulti
|
||||
// test GetMulti
|
||||
if err = bm.Put("astaxie", "author", timeoutDuration); err != nil {
|
||||
t.Error("set Error", err)
|
||||
}
|
||||
@@ -157,7 +157,7 @@ func TestFileCache(t *testing.T) {
|
||||
t.Error("delete err")
|
||||
}
|
||||
|
||||
//test string
|
||||
// test string
|
||||
if err = bm.Put("astaxie", "author", timeoutDuration); err != nil {
|
||||
t.Error("set Error", err)
|
||||
}
|
||||
@@ -168,7 +168,7 @@ func TestFileCache(t *testing.T) {
|
||||
t.Error("get err")
|
||||
}
|
||||
|
||||
//test GetMulti
|
||||
// test GetMulti
|
||||
if err = bm.Put("astaxie1", "author1", timeoutDuration); err != nil {
|
||||
t.Error("set Error", err)
|
||||
}
|
||||
|
||||
2
adapter/cache/conv.go
vendored
2
adapter/cache/conv.go
vendored
@@ -15,7 +15,7 @@
|
||||
package cache
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/client/cache"
|
||||
"github.com/beego/beego/v2/client/cache"
|
||||
)
|
||||
|
||||
// GetString convert interface to string.
|
||||
|
||||
2
adapter/cache/file.go
vendored
2
adapter/cache/file.go
vendored
@@ -15,7 +15,7 @@
|
||||
package cache
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/client/cache"
|
||||
"github.com/beego/beego/v2/client/cache"
|
||||
)
|
||||
|
||||
// NewFileCache Create new file cache with no config.
|
||||
|
||||
8
adapter/cache/memcache/memcache.go
vendored
8
adapter/cache/memcache/memcache.go
vendored
@@ -20,8 +20,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/astaxie/beego/cache/memcache"
|
||||
// "github.com/astaxie/beego/cache"
|
||||
// _ "github.com/beego/beego/v2/cache/memcache"
|
||||
// "github.com/beego/beego/v2/cache"
|
||||
// )
|
||||
//
|
||||
// bm, err := cache.NewCache("memcache", `{"conn":"127.0.0.1:11211"}`)
|
||||
@@ -30,8 +30,8 @@
|
||||
package memcache
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/adapter/cache"
|
||||
"github.com/astaxie/beego/client/cache/memcache"
|
||||
"github.com/beego/beego/v2/adapter/cache"
|
||||
"github.com/beego/beego/v2/client/cache/memcache"
|
||||
)
|
||||
|
||||
// NewMemCache create new memcache adapter.
|
||||
|
||||
2
adapter/cache/memcache/memcache_test.go
vendored
2
adapter/cache/memcache/memcache_test.go
vendored
@@ -21,7 +21,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego/adapter/cache"
|
||||
"github.com/beego/beego/v2/adapter/cache"
|
||||
)
|
||||
|
||||
func TestMemcacheCache(t *testing.T) {
|
||||
|
||||
2
adapter/cache/memory.go
vendored
2
adapter/cache/memory.go
vendored
@@ -15,7 +15,7 @@
|
||||
package cache
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/client/cache"
|
||||
"github.com/beego/beego/v2/client/cache"
|
||||
)
|
||||
|
||||
// NewMemoryCache returns a new MemoryCache.
|
||||
|
||||
8
adapter/cache/redis/redis.go
vendored
8
adapter/cache/redis/redis.go
vendored
@@ -20,8 +20,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/astaxie/beego/cache/redis"
|
||||
// "github.com/astaxie/beego/cache"
|
||||
// _ "github.com/beego/beego/v2/cache/redis"
|
||||
// "github.com/beego/beego/v2/cache"
|
||||
// )
|
||||
//
|
||||
// bm, err := cache.NewCache("redis", `{"conn":"127.0.0.1:11211"}`)
|
||||
@@ -30,8 +30,8 @@
|
||||
package redis
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/adapter/cache"
|
||||
redis2 "github.com/astaxie/beego/client/cache/redis"
|
||||
"github.com/beego/beego/v2/adapter/cache"
|
||||
redis2 "github.com/beego/beego/v2/client/cache/redis"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
6
adapter/cache/redis/redis_test.go
vendored
6
adapter/cache/redis/redis_test.go
vendored
@@ -22,7 +22,7 @@ import (
|
||||
|
||||
"github.com/gomodule/redigo/redis"
|
||||
|
||||
"github.com/astaxie/beego/adapter/cache"
|
||||
"github.com/beego/beego/v2/adapter/cache"
|
||||
)
|
||||
|
||||
func TestRedisCache(t *testing.T) {
|
||||
@@ -76,7 +76,7 @@ func TestRedisCache(t *testing.T) {
|
||||
t.Error("delete err")
|
||||
}
|
||||
|
||||
//test string
|
||||
// test string
|
||||
if err = bm.Put("astaxie", "author", timeoutDuration); err != nil {
|
||||
t.Error("set Error", err)
|
||||
}
|
||||
@@ -88,7 +88,7 @@ func TestRedisCache(t *testing.T) {
|
||||
t.Error("get err")
|
||||
}
|
||||
|
||||
//test GetMulti
|
||||
// test GetMulti
|
||||
if err = bm.Put("astaxie1", "author1", timeoutDuration); err != nil {
|
||||
t.Error("set Error", err)
|
||||
}
|
||||
|
||||
4
adapter/cache/ssdb/ssdb.go
vendored
4
adapter/cache/ssdb/ssdb.go
vendored
@@ -1,8 +1,8 @@
|
||||
package ssdb
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/adapter/cache"
|
||||
ssdb2 "github.com/astaxie/beego/client/cache/ssdb"
|
||||
"github.com/beego/beego/v2/adapter/cache"
|
||||
ssdb2 "github.com/beego/beego/v2/client/cache/ssdb"
|
||||
)
|
||||
|
||||
// NewSsdbCache create new ssdb adapter.
|
||||
|
||||
10
adapter/cache/ssdb/ssdb_test.go
vendored
10
adapter/cache/ssdb/ssdb_test.go
vendored
@@ -7,7 +7,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego/adapter/cache"
|
||||
"github.com/beego/beego/v2/adapter/cache"
|
||||
)
|
||||
|
||||
func TestSsdbcacheCache(t *testing.T) {
|
||||
@@ -26,7 +26,7 @@ func TestSsdbcacheCache(t *testing.T) {
|
||||
t.Error("check err")
|
||||
}
|
||||
timeoutDuration := 10 * time.Second
|
||||
//timeoutDuration := -10*time.Second if timeoutDuration is negtive,it means permanent
|
||||
// timeoutDuration := -10*time.Second if timeoutDuration is negtive,it means permanent
|
||||
if err = ssdb.Put("ssdb", "ssdb", timeoutDuration); err != nil {
|
||||
t.Error("set Error", err)
|
||||
}
|
||||
@@ -43,7 +43,7 @@ func TestSsdbcacheCache(t *testing.T) {
|
||||
t.Error("get Error")
|
||||
}
|
||||
|
||||
//inc/dec test done
|
||||
// inc/dec test done
|
||||
if err = ssdb.Put("ssdb", "2", timeoutDuration); err != nil {
|
||||
t.Error("set Error", err)
|
||||
}
|
||||
@@ -72,7 +72,7 @@ func TestSsdbcacheCache(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
//test string
|
||||
// test string
|
||||
if err = ssdb.Put("ssdb", "ssdb", -10*time.Second); err != nil {
|
||||
t.Error("set Error", err)
|
||||
}
|
||||
@@ -83,7 +83,7 @@ func TestSsdbcacheCache(t *testing.T) {
|
||||
t.Error("get err")
|
||||
}
|
||||
|
||||
//test GetMulti done
|
||||
// test GetMulti done
|
||||
if err = ssdb.Put("ssdb1", "ssdb1", -10*time.Second); err != nil {
|
||||
t.Error("set Error", err)
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
package adapter
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/adapter/session"
|
||||
newCfg "github.com/astaxie/beego/core/config"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
"github.com/beego/beego/v2/adapter/session"
|
||||
newCfg "github.com/beego/beego/v2/core/config"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
)
|
||||
|
||||
// Config is the main struct for BConfig
|
||||
|
||||
@@ -17,7 +17,7 @@ package config
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/astaxie/beego/core/config"
|
||||
"github.com/beego/beego/v2/core/config"
|
||||
)
|
||||
|
||||
type newToOldConfigerAdapter struct {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
// Package config is used to parse config.
|
||||
// Usage:
|
||||
// import "github.com/astaxie/beego/config"
|
||||
// import "github.com/beego/beego/v2/config"
|
||||
// Examples.
|
||||
//
|
||||
// cnf, err := config.NewConfig("ini", "config.conf")
|
||||
@@ -41,7 +41,7 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/core/config"
|
||||
"github.com/beego/beego/v2/core/config"
|
||||
)
|
||||
|
||||
// Configer defines how to get and set value from configuration raw data.
|
||||
|
||||
2
adapter/config/env/env.go
vendored
2
adapter/config/env/env.go
vendored
@@ -17,7 +17,7 @@
|
||||
package env
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/core/config/env"
|
||||
"github.com/beego/beego/v2/core/config/env"
|
||||
)
|
||||
|
||||
// Get returns a value by key.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/core/config"
|
||||
"github.com/beego/beego/v2/core/config"
|
||||
)
|
||||
|
||||
// NewFakeConfig return a fake Configer
|
||||
|
||||
@@ -145,7 +145,7 @@ httpport = 8080
|
||||
# enable db
|
||||
[dbinfo]
|
||||
# db type name
|
||||
# suport mysql,sqlserver
|
||||
# support mysql,sqlserver
|
||||
name = mysql
|
||||
`
|
||||
|
||||
@@ -161,7 +161,7 @@ httpport=8080
|
||||
# enable db
|
||||
[dbinfo]
|
||||
# db type name
|
||||
# suport mysql,sqlserver
|
||||
# support mysql,sqlserver
|
||||
name=mysql
|
||||
`
|
||||
)
|
||||
|
||||
@@ -15,5 +15,5 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
_ "github.com/astaxie/beego/core/config/json"
|
||||
_ "github.com/beego/beego/v2/core/config/json"
|
||||
)
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/astaxie/beego/config/xml"
|
||||
// "github.com/astaxie/beego/config"
|
||||
// _ "github.com/beego/beego/v2/config/xml"
|
||||
// "github.com/beego/beego/v2/config"
|
||||
// )
|
||||
//
|
||||
// cnf, err := config.NewConfig("xml", "config.xml")
|
||||
@@ -30,5 +30,5 @@
|
||||
package xml
|
||||
|
||||
import (
|
||||
_ "github.com/astaxie/beego/core/config/xml"
|
||||
_ "github.com/beego/beego/v2/core/config/xml"
|
||||
)
|
||||
|
||||
@@ -19,13 +19,13 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/astaxie/beego/adapter/config"
|
||||
"github.com/beego/beego/v2/adapter/config"
|
||||
)
|
||||
|
||||
func TestXML(t *testing.T) {
|
||||
|
||||
var (
|
||||
//xml parse should incluce in <config></config> tags
|
||||
// xml parse should incluce in <config></config> tags
|
||||
xmlcontext = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<config>
|
||||
<appname>beeapi</appname>
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/astaxie/beego/config/yaml"
|
||||
// "github.com/astaxie/beego/config"
|
||||
// _ "github.com/beego/beego/v2/config/yaml"
|
||||
// "github.com/beego/beego/v2/config"
|
||||
// )
|
||||
//
|
||||
// cnf, err := config.NewConfig("yaml", "config.yaml")
|
||||
@@ -30,5 +30,5 @@
|
||||
package yaml
|
||||
|
||||
import (
|
||||
_ "github.com/astaxie/beego/core/config/yaml"
|
||||
_ "github.com/beego/beego/v2/core/config/yaml"
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/astaxie/beego/adapter/config"
|
||||
"github.com/beego/beego/v2/adapter/config"
|
||||
)
|
||||
|
||||
func TestYaml(t *testing.T) {
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/astaxie/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
// InitGzip init the gzipcompress
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// Package context provide the context utils
|
||||
// Usage:
|
||||
//
|
||||
// import "github.com/astaxie/beego/context"
|
||||
// import "github.com/beego/beego/v2/context"
|
||||
//
|
||||
// ctx := context.Context{Request:req,ResponseWriter:rw}
|
||||
//
|
||||
@@ -27,7 +27,7 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
// commonly used mime-types
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package context
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
// BeegoInput operates the http request header, data, cookie and body.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package context
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
// BeegoOutput does work for sending response header.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package context
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
// Renderer defines an http response renderer
|
||||
|
||||
@@ -18,10 +18,10 @@ import (
|
||||
"mime/multipart"
|
||||
"net/url"
|
||||
|
||||
"github.com/astaxie/beego/adapter/session"
|
||||
webContext "github.com/astaxie/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/adapter/session"
|
||||
webContext "github.com/beego/beego/v2/server/web/context"
|
||||
|
||||
"github.com/astaxie/beego/server/web"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -212,7 +212,7 @@ func (c *Controller) ServeFormatted(encoding ...bool) {
|
||||
|
||||
// Input returns the input data map from POST or PUT request body and query string.
|
||||
func (c *Controller) Input() url.Values {
|
||||
val, _ := (*web.Controller)(c).Input()
|
||||
val, _ := (*web.Controller)(c).Input()
|
||||
return val
|
||||
}
|
||||
|
||||
|
||||
@@ -17,10 +17,10 @@ package adapter
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego/adapter/context"
|
||||
beecontext "github.com/astaxie/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/adapter/context"
|
||||
beecontext "github.com/beego/beego/v2/server/web/context"
|
||||
|
||||
"github.com/astaxie/beego/server/web"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
package adapter
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/adapter/context"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
beecontext "github.com/astaxie/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/adapter/context"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
beecontext "github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
// FilterFunc defines a filter function which is invoked before the controller handler is executed.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package adapter
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/server/web"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
)
|
||||
|
||||
// FlashData is a tools to maintain data when using across request.
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/astaxie/beego/server/web"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
)
|
||||
|
||||
type FileSystem web.FileSystem
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
// "net/http"
|
||||
// "os"
|
||||
//
|
||||
// "github.com/astaxie/beego/grace"
|
||||
// "github.com/beego/beego/v2/grace"
|
||||
// )
|
||||
//
|
||||
// func handler(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -46,7 +46,7 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego/server/web/grace"
|
||||
"github.com/beego/beego/v2/server/web/grace"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -3,7 +3,7 @@ package grace
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/astaxie/beego/server/web/grace"
|
||||
"github.com/beego/beego/v2/server/web/grace"
|
||||
)
|
||||
|
||||
// Server embedded http.Server
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// Package httplib is used as http.Client
|
||||
// Usage:
|
||||
//
|
||||
// import "github.com/astaxie/beego/httplib"
|
||||
// import "github.com/beego/beego/v2/httplib"
|
||||
//
|
||||
// b := httplib.Post("http://beego.me/")
|
||||
// b.Param("username","astaxie")
|
||||
@@ -38,7 +38,7 @@ import (
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego/client/httplib"
|
||||
"github.com/beego/beego/v2/client/httplib"
|
||||
)
|
||||
|
||||
// SetDefaultSetting Overwrite default settings
|
||||
|
||||
@@ -17,13 +17,13 @@ package adapter
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/astaxie/beego/core/logs"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
|
||||
webLog "github.com/astaxie/beego/core/logs"
|
||||
webLog "github.com/beego/beego/v2/core/logs"
|
||||
)
|
||||
|
||||
// Log levels to control the logging output.
|
||||
// Deprecated: use github.com/astaxie/beego/logs instead.
|
||||
// Deprecated: use github.com/beego/beego/v2/logs instead.
|
||||
const (
|
||||
LevelEmergency = webLog.LevelEmergency
|
||||
LevelAlert = webLog.LevelAlert
|
||||
@@ -36,90 +36,90 @@ const (
|
||||
)
|
||||
|
||||
// BeeLogger references the used application logger.
|
||||
// Deprecated: use github.com/astaxie/beego/logs instead.
|
||||
// Deprecated: use github.com/beego/beego/v2/logs instead.
|
||||
var BeeLogger = logs.GetBeeLogger()
|
||||
|
||||
// SetLevel sets the global log level used by the simple logger.
|
||||
// Deprecated: use github.com/astaxie/beego/logs instead.
|
||||
// Deprecated: use github.com/beego/beego/v2/logs instead.
|
||||
func SetLevel(l int) {
|
||||
logs.SetLevel(l)
|
||||
}
|
||||
|
||||
// SetLogFuncCall set the CallDepth, default is 3
|
||||
// Deprecated: use github.com/astaxie/beego/logs instead.
|
||||
// Deprecated: use github.com/beego/beego/v2/logs instead.
|
||||
func SetLogFuncCall(b bool) {
|
||||
logs.SetLogFuncCall(b)
|
||||
}
|
||||
|
||||
// SetLogger sets a new logger.
|
||||
// Deprecated: use github.com/astaxie/beego/logs instead.
|
||||
// Deprecated: use github.com/beego/beego/v2/logs instead.
|
||||
func SetLogger(adaptername string, config string) error {
|
||||
return logs.SetLogger(adaptername, config)
|
||||
}
|
||||
|
||||
// Emergency logs a message at emergency level.
|
||||
// Deprecated: use github.com/astaxie/beego/logs instead.
|
||||
// Deprecated: use github.com/beego/beego/v2/logs instead.
|
||||
func Emergency(v ...interface{}) {
|
||||
logs.Emergency(generateFmtStr(len(v)), v...)
|
||||
}
|
||||
|
||||
// Alert logs a message at alert level.
|
||||
// Deprecated: use github.com/astaxie/beego/logs instead.
|
||||
// Deprecated: use github.com/beego/beego/v2/logs instead.
|
||||
func Alert(v ...interface{}) {
|
||||
logs.Alert(generateFmtStr(len(v)), v...)
|
||||
}
|
||||
|
||||
// Critical logs a message at critical level.
|
||||
// Deprecated: use github.com/astaxie/beego/logs instead.
|
||||
// Deprecated: use github.com/beego/beego/v2/logs instead.
|
||||
func Critical(v ...interface{}) {
|
||||
logs.Critical(generateFmtStr(len(v)), v...)
|
||||
}
|
||||
|
||||
// Error logs a message at error level.
|
||||
// Deprecated: use github.com/astaxie/beego/logs instead.
|
||||
// Deprecated: use github.com/beego/beego/v2/logs instead.
|
||||
func Error(v ...interface{}) {
|
||||
logs.Error(generateFmtStr(len(v)), v...)
|
||||
}
|
||||
|
||||
// Warning logs a message at warning level.
|
||||
// Deprecated: use github.com/astaxie/beego/logs instead.
|
||||
// Deprecated: use github.com/beego/beego/v2/logs instead.
|
||||
func Warning(v ...interface{}) {
|
||||
logs.Warning(generateFmtStr(len(v)), v...)
|
||||
}
|
||||
|
||||
// Warn compatibility alias for Warning()
|
||||
// Deprecated: use github.com/astaxie/beego/logs instead.
|
||||
// Deprecated: use github.com/beego/beego/v2/logs instead.
|
||||
func Warn(v ...interface{}) {
|
||||
logs.Warn(generateFmtStr(len(v)), v...)
|
||||
}
|
||||
|
||||
// Notice logs a message at notice level.
|
||||
// Deprecated: use github.com/astaxie/beego/logs instead.
|
||||
// Deprecated: use github.com/beego/beego/v2/logs instead.
|
||||
func Notice(v ...interface{}) {
|
||||
logs.Notice(generateFmtStr(len(v)), v...)
|
||||
}
|
||||
|
||||
// Informational logs a message at info level.
|
||||
// Deprecated: use github.com/astaxie/beego/logs instead.
|
||||
// Deprecated: use github.com/beego/beego/v2/logs instead.
|
||||
func Informational(v ...interface{}) {
|
||||
logs.Informational(generateFmtStr(len(v)), v...)
|
||||
}
|
||||
|
||||
// Info compatibility alias for Warning()
|
||||
// Deprecated: use github.com/astaxie/beego/logs instead.
|
||||
// Deprecated: use github.com/beego/beego/v2/logs instead.
|
||||
func Info(v ...interface{}) {
|
||||
logs.Info(generateFmtStr(len(v)), v...)
|
||||
}
|
||||
|
||||
// Debug logs a message at debug level.
|
||||
// Deprecated: use github.com/astaxie/beego/logs instead.
|
||||
// Deprecated: use github.com/beego/beego/v2/logs instead.
|
||||
func Debug(v ...interface{}) {
|
||||
logs.Debug(generateFmtStr(len(v)), v...)
|
||||
}
|
||||
|
||||
// Trace logs a message at trace level.
|
||||
// compatibility alias for Warning()
|
||||
// Deprecated: use github.com/astaxie/beego/logs instead.
|
||||
// Deprecated: use github.com/beego/beego/v2/logs instead.
|
||||
func Trace(v ...interface{}) {
|
||||
logs.Trace(generateFmtStr(len(v)), v...)
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package logs
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/core/logs"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
)
|
||||
|
||||
// AccessLogRecord struct for holding access log data.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package alils
|
||||
|
||||
import (
|
||||
_ "github.com/astaxie/beego/core/logs/alils"
|
||||
_ "github.com/beego/beego/v2/core/logs/alils"
|
||||
)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package es
|
||||
|
||||
import (
|
||||
_ "github.com/astaxie/beego/core/logs/es"
|
||||
_ "github.com/beego/beego/v2/core/logs/es"
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// Package logs provide a general log interface
|
||||
// Usage:
|
||||
//
|
||||
// import "github.com/astaxie/beego/logs"
|
||||
// import "github.com/beego/beego/v2/logs"
|
||||
//
|
||||
// log := NewLogger(10000)
|
||||
// log.SetLogger("console", "")
|
||||
@@ -37,7 +37,7 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego/core/logs"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
)
|
||||
|
||||
// RFC5424 log message levels.
|
||||
|
||||
@@ -17,7 +17,7 @@ package logs
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego/core/logs"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
)
|
||||
|
||||
type oldToNewAdapter struct {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package logs
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/core/logs"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
)
|
||||
|
||||
// ColorByStatus return color by http code
|
||||
|
||||
@@ -23,9 +23,9 @@ import (
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
"github.com/astaxie/beego/core/logs"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
"github.com/beego/beego/v2"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
)
|
||||
|
||||
func PrometheusMiddleWare(next http.Handler) http.Handler {
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
|
||||
"github.com/astaxie/beego/adapter/context"
|
||||
"github.com/beego/beego/v2/adapter/context"
|
||||
)
|
||||
|
||||
func TestPrometheusMiddleWare(t *testing.T) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/client/orm/migration"
|
||||
"github.com/beego/beego/v2/client/orm/migration"
|
||||
)
|
||||
|
||||
// Index struct defines the structure of Index Columns
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/client/orm/migration"
|
||||
"github.com/beego/beego/v2/client/orm/migration"
|
||||
)
|
||||
|
||||
// const the data format for the bee generate migration datatype
|
||||
|
||||
@@ -17,10 +17,10 @@ package adapter
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
adtContext "github.com/astaxie/beego/adapter/context"
|
||||
"github.com/astaxie/beego/server/web/context"
|
||||
adtContext "github.com/beego/beego/v2/adapter/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
|
||||
"github.com/astaxie/beego/server/web"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
)
|
||||
|
||||
type namespaceCond func(*adtContext.Context) bool
|
||||
@@ -91,28 +91,28 @@ func oldToNewFilter(filter []FilterFunc) []web.FilterFunc {
|
||||
}
|
||||
|
||||
// Router same as beego.Rourer
|
||||
// refer: https://godoc.org/github.com/astaxie/beego#Router
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Router
|
||||
func (n *Namespace) Router(rootpath string, c ControllerInterface, mappingMethods ...string) *Namespace {
|
||||
(*web.Namespace)(n).Router(rootpath, c, mappingMethods...)
|
||||
return n
|
||||
}
|
||||
|
||||
// AutoRouter same as beego.AutoRouter
|
||||
// refer: https://godoc.org/github.com/astaxie/beego#AutoRouter
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#AutoRouter
|
||||
func (n *Namespace) AutoRouter(c ControllerInterface) *Namespace {
|
||||
(*web.Namespace)(n).AutoRouter(c)
|
||||
return n
|
||||
}
|
||||
|
||||
// AutoPrefix same as beego.AutoPrefix
|
||||
// refer: https://godoc.org/github.com/astaxie/beego#AutoPrefix
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#AutoPrefix
|
||||
func (n *Namespace) AutoPrefix(prefix string, c ControllerInterface) *Namespace {
|
||||
(*web.Namespace)(n).AutoPrefix(prefix, c)
|
||||
return n
|
||||
}
|
||||
|
||||
// Get same as beego.Get
|
||||
// refer: https://godoc.org/github.com/astaxie/beego#Get
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Get
|
||||
func (n *Namespace) Get(rootpath string, f FilterFunc) *Namespace {
|
||||
(*web.Namespace)(n).Get(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
@@ -121,7 +121,7 @@ func (n *Namespace) Get(rootpath string, f FilterFunc) *Namespace {
|
||||
}
|
||||
|
||||
// Post same as beego.Post
|
||||
// refer: https://godoc.org/github.com/astaxie/beego#Post
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Post
|
||||
func (n *Namespace) Post(rootpath string, f FilterFunc) *Namespace {
|
||||
(*web.Namespace)(n).Post(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
@@ -130,7 +130,7 @@ func (n *Namespace) Post(rootpath string, f FilterFunc) *Namespace {
|
||||
}
|
||||
|
||||
// Delete same as beego.Delete
|
||||
// refer: https://godoc.org/github.com/astaxie/beego#Delete
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Delete
|
||||
func (n *Namespace) Delete(rootpath string, f FilterFunc) *Namespace {
|
||||
(*web.Namespace)(n).Delete(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
@@ -139,7 +139,7 @@ func (n *Namespace) Delete(rootpath string, f FilterFunc) *Namespace {
|
||||
}
|
||||
|
||||
// Put same as beego.Put
|
||||
// refer: https://godoc.org/github.com/astaxie/beego#Put
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Put
|
||||
func (n *Namespace) Put(rootpath string, f FilterFunc) *Namespace {
|
||||
(*web.Namespace)(n).Put(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
@@ -148,7 +148,7 @@ func (n *Namespace) Put(rootpath string, f FilterFunc) *Namespace {
|
||||
}
|
||||
|
||||
// Head same as beego.Head
|
||||
// refer: https://godoc.org/github.com/astaxie/beego#Head
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Head
|
||||
func (n *Namespace) Head(rootpath string, f FilterFunc) *Namespace {
|
||||
(*web.Namespace)(n).Head(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
@@ -157,7 +157,7 @@ func (n *Namespace) Head(rootpath string, f FilterFunc) *Namespace {
|
||||
}
|
||||
|
||||
// Options same as beego.Options
|
||||
// refer: https://godoc.org/github.com/astaxie/beego#Options
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Options
|
||||
func (n *Namespace) Options(rootpath string, f FilterFunc) *Namespace {
|
||||
(*web.Namespace)(n).Options(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
@@ -166,7 +166,7 @@ func (n *Namespace) Options(rootpath string, f FilterFunc) *Namespace {
|
||||
}
|
||||
|
||||
// Patch same as beego.Patch
|
||||
// refer: https://godoc.org/github.com/astaxie/beego#Patch
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Patch
|
||||
func (n *Namespace) Patch(rootpath string, f FilterFunc) *Namespace {
|
||||
(*web.Namespace)(n).Patch(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
@@ -175,7 +175,7 @@ func (n *Namespace) Patch(rootpath string, f FilterFunc) *Namespace {
|
||||
}
|
||||
|
||||
// Any same as beego.Any
|
||||
// refer: https://godoc.org/github.com/astaxie/beego#Any
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Any
|
||||
func (n *Namespace) Any(rootpath string, f FilterFunc) *Namespace {
|
||||
(*web.Namespace)(n).Any(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
@@ -184,14 +184,14 @@ func (n *Namespace) Any(rootpath string, f FilterFunc) *Namespace {
|
||||
}
|
||||
|
||||
// Handler same as beego.Handler
|
||||
// refer: https://godoc.org/github.com/astaxie/beego#Handler
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Handler
|
||||
func (n *Namespace) Handler(rootpath string, h http.Handler) *Namespace {
|
||||
(*web.Namespace)(n).Handler(rootpath, h)
|
||||
return n
|
||||
}
|
||||
|
||||
// Include add include class
|
||||
// refer: https://godoc.org/github.com/astaxie/beego#Include
|
||||
// refer: https://godoc.org/github.com/beego/beego/v2#Include
|
||||
func (n *Namespace) Include(cList ...ControllerInterface) *Namespace {
|
||||
nL := oldToNewCtrlIntfs(cList)
|
||||
(*web.Namespace)(n).Include(nL...)
|
||||
@@ -238,141 +238,158 @@ func AddNamespace(nl ...*Namespace) {
|
||||
|
||||
// NSCond is Namespace Condition
|
||||
func NSCond(cond namespaceCond) LinkNamespace {
|
||||
wc := web.NSCond(func(b *context.Context) bool {
|
||||
return cond((*adtContext.Context)(b))
|
||||
})
|
||||
return func(namespace *Namespace) {
|
||||
web.NSCond(func(b *context.Context) bool {
|
||||
return cond((*adtContext.Context)(b))
|
||||
})
|
||||
wc((*web.Namespace)(namespace))
|
||||
}
|
||||
}
|
||||
|
||||
// NSBefore Namespace BeforeRouter filter
|
||||
func NSBefore(filterList ...FilterFunc) LinkNamespace {
|
||||
nfs := oldToNewFilter(filterList)
|
||||
wf := web.NSBefore(nfs...)
|
||||
return func(namespace *Namespace) {
|
||||
nfs := oldToNewFilter(filterList)
|
||||
web.NSBefore(nfs...)
|
||||
wf((*web.Namespace)(namespace))
|
||||
}
|
||||
}
|
||||
|
||||
// NSAfter add Namespace FinishRouter filter
|
||||
func NSAfter(filterList ...FilterFunc) LinkNamespace {
|
||||
nfs := oldToNewFilter(filterList)
|
||||
wf := web.NSAfter(nfs...)
|
||||
return func(namespace *Namespace) {
|
||||
nfs := oldToNewFilter(filterList)
|
||||
web.NSAfter(nfs...)
|
||||
wf((*web.Namespace)(namespace))
|
||||
}
|
||||
}
|
||||
|
||||
// NSInclude Namespace Include ControllerInterface
|
||||
func NSInclude(cList ...ControllerInterface) LinkNamespace {
|
||||
nfs := oldToNewCtrlIntfs(cList)
|
||||
wi := web.NSInclude(nfs...)
|
||||
return func(namespace *Namespace) {
|
||||
nfs := oldToNewCtrlIntfs(cList)
|
||||
web.NSInclude(nfs...)
|
||||
wi((*web.Namespace)(namespace))
|
||||
}
|
||||
}
|
||||
|
||||
// NSRouter call Namespace Router
|
||||
func NSRouter(rootpath string, c ControllerInterface, mappingMethods ...string) LinkNamespace {
|
||||
wn := web.NSRouter(rootpath, c, mappingMethods...)
|
||||
return func(namespace *Namespace) {
|
||||
web.Router(rootpath, c, web.SetRouterMethods(c, mappingMethods...))
|
||||
wn((*web.Namespace)(namespace))
|
||||
}
|
||||
}
|
||||
|
||||
// NSGet call Namespace Get
|
||||
func NSGet(rootpath string, f FilterFunc) LinkNamespace {
|
||||
ln := web.NSGet(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
})
|
||||
return func(ns *Namespace) {
|
||||
web.NSGet(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
})
|
||||
ln((*web.Namespace)(ns))
|
||||
}
|
||||
}
|
||||
|
||||
// NSPost call Namespace Post
|
||||
func NSPost(rootpath string, f FilterFunc) LinkNamespace {
|
||||
wp := web.NSPost(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
})
|
||||
return func(ns *Namespace) {
|
||||
web.Post(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
})
|
||||
wp((*web.Namespace)(ns))
|
||||
}
|
||||
}
|
||||
|
||||
// NSHead call Namespace Head
|
||||
func NSHead(rootpath string, f FilterFunc) LinkNamespace {
|
||||
wb := web.NSHead(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
})
|
||||
return func(ns *Namespace) {
|
||||
web.NSHead(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
})
|
||||
wb((*web.Namespace)(ns))
|
||||
}
|
||||
}
|
||||
|
||||
// NSPut call Namespace Put
|
||||
func NSPut(rootpath string, f FilterFunc) LinkNamespace {
|
||||
wn := web.NSPut(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
})
|
||||
return func(ns *Namespace) {
|
||||
web.NSPut(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
})
|
||||
wn((*web.Namespace)(ns))
|
||||
}
|
||||
}
|
||||
|
||||
// NSDelete call Namespace Delete
|
||||
func NSDelete(rootpath string, f FilterFunc) LinkNamespace {
|
||||
wn := web.NSDelete(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
})
|
||||
return func(ns *Namespace) {
|
||||
web.NSDelete(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
})
|
||||
wn((*web.Namespace)(ns))
|
||||
}
|
||||
}
|
||||
|
||||
// NSAny call Namespace Any
|
||||
func NSAny(rootpath string, f FilterFunc) LinkNamespace {
|
||||
wn := web.NSAny(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
})
|
||||
return func(ns *Namespace) {
|
||||
web.NSAny(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
})
|
||||
wn((*web.Namespace)(ns))
|
||||
}
|
||||
}
|
||||
|
||||
// NSOptions call Namespace Options
|
||||
func NSOptions(rootpath string, f FilterFunc) LinkNamespace {
|
||||
wo := web.NSOptions(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
})
|
||||
return func(ns *Namespace) {
|
||||
web.NSOptions(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
})
|
||||
wo((*web.Namespace)(ns))
|
||||
}
|
||||
}
|
||||
|
||||
// NSPatch call Namespace Patch
|
||||
func NSPatch(rootpath string, f FilterFunc) LinkNamespace {
|
||||
wn := web.NSPatch(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
})
|
||||
return func(ns *Namespace) {
|
||||
web.NSPatch(rootpath, func(ctx *context.Context) {
|
||||
f((*adtContext.Context)(ctx))
|
||||
})
|
||||
wn((*web.Namespace)(ns))
|
||||
}
|
||||
}
|
||||
|
||||
// NSAutoRouter call Namespace AutoRouter
|
||||
func NSAutoRouter(c ControllerInterface) LinkNamespace {
|
||||
wn := web.NSAutoRouter(c)
|
||||
return func(ns *Namespace) {
|
||||
web.NSAutoRouter(c)
|
||||
wn((*web.Namespace)(ns))
|
||||
}
|
||||
}
|
||||
|
||||
// NSAutoPrefix call Namespace AutoPrefix
|
||||
func NSAutoPrefix(prefix string, c ControllerInterface) LinkNamespace {
|
||||
wn := web.NSAutoPrefix(prefix, c)
|
||||
return func(ns *Namespace) {
|
||||
web.NSAutoPrefix(prefix, c)
|
||||
wn((*web.Namespace)(ns))
|
||||
}
|
||||
}
|
||||
|
||||
// NSNamespace add sub Namespace
|
||||
func NSNamespace(prefix string, params ...LinkNamespace) LinkNamespace {
|
||||
nps := oldToNewLinkNs(params)
|
||||
wn := web.NSNamespace(prefix, nps...)
|
||||
return func(ns *Namespace) {
|
||||
nps := oldToNewLinkNs(params)
|
||||
web.NSNamespace(prefix, nps...)
|
||||
wn((*web.Namespace)(ns))
|
||||
}
|
||||
}
|
||||
|
||||
// NSHandler add handler
|
||||
func NSHandler(rootpath string, h http.Handler) LinkNamespace {
|
||||
wn := web.NSHandler(rootpath, h)
|
||||
return func(ns *Namespace) {
|
||||
web.NSHandler(rootpath, h)
|
||||
wn((*web.Namespace)(ns))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package orm
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// RunCommand listen for orm command and then run it if command arguments passed.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package orm
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
"database/sql"
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// DriverType database driver constant int.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package orm
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// ResetModelCache Clean model cache. Then you can re-RegisterModel.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package orm
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// RegisterModel register models
|
||||
@@ -25,7 +25,7 @@ func RegisterModel(models ...interface{}) {
|
||||
|
||||
// RegisterModelWithPrefix register models with a prefix
|
||||
func RegisterModelWithPrefix(prefix string, models ...interface{}) {
|
||||
orm.RegisterModelWithPrefix(prefix, models)
|
||||
orm.RegisterModelWithPrefix(prefix, models...)
|
||||
}
|
||||
|
||||
// RegisterModelWithSuffix register models with a suffix
|
||||
|
||||
30
adapter/orm/models_boot_test.go
Normal file
30
adapter/orm/models_boot_test.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Copyright 2020 beego
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package orm
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
Id int
|
||||
}
|
||||
|
||||
type Seller struct {
|
||||
Id int
|
||||
}
|
||||
func TestRegisterModelWithPrefix(t *testing.T) {
|
||||
RegisterModelWithPrefix("test", &User{}, &Seller{})
|
||||
}
|
||||
@@ -17,7 +17,7 @@ package orm
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// Define the Type enum
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
//
|
||||
// import (
|
||||
// "fmt"
|
||||
// "github.com/astaxie/beego/orm"
|
||||
// "github.com/beego/beego/v2/orm"
|
||||
// _ "github.com/go-sql-driver/mysql" // import your used driver
|
||||
// )
|
||||
//
|
||||
@@ -58,9 +58,9 @@ import (
|
||||
"database/sql"
|
||||
"errors"
|
||||
|
||||
"github.com/astaxie/beego/client/orm"
|
||||
"github.com/astaxie/beego/client/orm/hints"
|
||||
"github.com/astaxie/beego/core/utils"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm/hints"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
)
|
||||
|
||||
// DebugQueries define the debug
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package orm
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// ExprSep define the expression separation
|
||||
|
||||
@@ -17,7 +17,7 @@ package orm
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/astaxie/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// Log implement the log.Logger
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package orm
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// define Col operations
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package orm
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// QueryBuilder is the Query builder interface
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package orm
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// CommaSpace is the separation
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package orm
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// TiDBQueryBuilder is the SQL build
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package orm
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
type baseQuerySetter struct {
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"context"
|
||||
"database/sql"
|
||||
|
||||
"github.com/astaxie/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// Params stores the Params
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
type fn func(string) string
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
//
|
||||
// Simple Usage:
|
||||
// import(
|
||||
// "github.com/astaxie/beego"
|
||||
// "github.com/astaxie/beego/plugins/apiauth"
|
||||
// "github.com/beego/beego/v2"
|
||||
// "github.com/beego/beego/v2/plugins/apiauth"
|
||||
// )
|
||||
//
|
||||
// func main(){
|
||||
@@ -58,10 +58,10 @@ package apiauth
|
||||
import (
|
||||
"net/url"
|
||||
|
||||
beego "github.com/astaxie/beego/adapter"
|
||||
"github.com/astaxie/beego/adapter/context"
|
||||
beecontext "github.com/astaxie/beego/server/web/context"
|
||||
"github.com/astaxie/beego/server/web/filter/apiauth"
|
||||
beego "github.com/beego/beego/v2/adapter"
|
||||
"github.com/beego/beego/v2/adapter/context"
|
||||
beecontext "github.com/beego/beego/v2/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/filter/apiauth"
|
||||
)
|
||||
|
||||
// AppIDToAppSecret is used to get appsecret throw appid
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
// Package auth provides handlers to enable basic auth support.
|
||||
// Simple Usage:
|
||||
// import(
|
||||
// "github.com/astaxie/beego"
|
||||
// "github.com/astaxie/beego/plugins/auth"
|
||||
// "github.com/beego/beego/v2"
|
||||
// "github.com/beego/beego/v2/plugins/auth"
|
||||
// )
|
||||
//
|
||||
// func main(){
|
||||
@@ -38,10 +38,10 @@ package auth
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
beego "github.com/astaxie/beego/adapter"
|
||||
"github.com/astaxie/beego/adapter/context"
|
||||
beecontext "github.com/astaxie/beego/server/web/context"
|
||||
"github.com/astaxie/beego/server/web/filter/auth"
|
||||
beego "github.com/beego/beego/v2/adapter"
|
||||
"github.com/beego/beego/v2/adapter/context"
|
||||
beecontext "github.com/beego/beego/v2/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/filter/auth"
|
||||
)
|
||||
|
||||
// Basic is the http basic auth
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
// Package authz provides handlers to enable ACL, RBAC, ABAC authorization support.
|
||||
// Simple Usage:
|
||||
// import(
|
||||
// "github.com/astaxie/beego"
|
||||
// "github.com/astaxie/beego/plugins/authz"
|
||||
// "github.com/beego/beego/v2"
|
||||
// "github.com/beego/beego/v2/plugins/authz"
|
||||
// "github.com/casbin/casbin"
|
||||
// )
|
||||
//
|
||||
@@ -44,10 +44,10 @@ import (
|
||||
|
||||
"github.com/casbin/casbin"
|
||||
|
||||
beego "github.com/astaxie/beego/adapter"
|
||||
"github.com/astaxie/beego/adapter/context"
|
||||
beecontext "github.com/astaxie/beego/server/web/context"
|
||||
"github.com/astaxie/beego/server/web/filter/authz"
|
||||
beego "github.com/beego/beego/v2/adapter"
|
||||
"github.com/beego/beego/v2/adapter/context"
|
||||
beecontext "github.com/beego/beego/v2/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/filter/authz"
|
||||
)
|
||||
|
||||
// NewAuthorizer returns the authorizer.
|
||||
|
||||
@@ -11,4 +11,4 @@ g = _, _
|
||||
e = some(where (p.eft == allow))
|
||||
|
||||
[matchers]
|
||||
m = g(r.sub, p.sub) && keyMatch(r.obj, p.obj) && (r.act == p.act || p.act == "*")
|
||||
m = g(r.sub, p.sub) && keyMatch(r.obj, p.obj) && (r.act == p.act || p.act == "*")
|
||||
|
||||
@@ -4,4 +4,4 @@ p, bob, /dataset2/resource1, *
|
||||
p, bob, /dataset2/resource2, GET
|
||||
p, bob, /dataset2/folder1/*, POST
|
||||
p, dataset1_admin, /dataset1/*, *
|
||||
g, cathy, dataset1_admin
|
||||
g, cathy, dataset1_admin
|
||||
|
||||
|
@@ -19,10 +19,11 @@ import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
beego "github.com/astaxie/beego/adapter"
|
||||
"github.com/astaxie/beego/adapter/context"
|
||||
"github.com/astaxie/beego/adapter/plugins/auth"
|
||||
"github.com/casbin/casbin"
|
||||
|
||||
beego "github.com/beego/beego/v2/adapter"
|
||||
"github.com/beego/beego/v2/adapter/context"
|
||||
"github.com/beego/beego/v2/adapter/plugins/auth"
|
||||
)
|
||||
|
||||
func testRequest(t *testing.T, handler *beego.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/astaxie/beego"
|
||||
// "github.com/astaxie/beego/plugins/cors"
|
||||
// "github.com/beego/beego/v2"
|
||||
// "github.com/beego/beego/v2/plugins/cors"
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
@@ -36,11 +36,11 @@
|
||||
package cors
|
||||
|
||||
import (
|
||||
beego "github.com/astaxie/beego/adapter"
|
||||
beecontext "github.com/astaxie/beego/server/web/context"
|
||||
"github.com/astaxie/beego/server/web/filter/cors"
|
||||
beego "github.com/beego/beego/v2/adapter"
|
||||
beecontext "github.com/beego/beego/v2/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/filter/cors"
|
||||
|
||||
"github.com/astaxie/beego/adapter/context"
|
||||
"github.com/beego/beego/v2/adapter/context"
|
||||
)
|
||||
|
||||
// Options represents Access Control options.
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
package adapter
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/adapter/context"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
beecontext "github.com/astaxie/beego/server/web/context"
|
||||
"github.com/beego/beego/v2/adapter/context"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
beecontext "github.com/beego/beego/v2/server/web/context"
|
||||
)
|
||||
|
||||
// PolicyFunc defines a policy function which is invoked before the controller handler is executed.
|
||||
|
||||
@@ -18,10 +18,10 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
beecontext "github.com/astaxie/beego/adapter/context"
|
||||
"github.com/astaxie/beego/server/web/context"
|
||||
beecontext "github.com/beego/beego/v2/adapter/context"
|
||||
"github.com/beego/beego/v2/server/web/context"
|
||||
|
||||
"github.com/astaxie/beego/server/web"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
)
|
||||
|
||||
// default filter execution points
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/astaxie/beego/session/couchbase"
|
||||
// "github.com/astaxie/beego/session"
|
||||
// _ "github.com/beego/beego/v2/session/couchbase"
|
||||
// "github.com/beego/beego/v2/session"
|
||||
// )
|
||||
//
|
||||
// func init() {
|
||||
@@ -36,8 +36,8 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego/adapter/session"
|
||||
beecb "github.com/astaxie/beego/server/web/session/couchbase"
|
||||
"github.com/beego/beego/v2/adapter/session"
|
||||
beecb "github.com/beego/beego/v2/server/web/session/couchbase"
|
||||
)
|
||||
|
||||
// SessionStore store each session
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego/adapter/session"
|
||||
beeLedis "github.com/astaxie/beego/server/web/session/ledis"
|
||||
"github.com/beego/beego/v2/adapter/session"
|
||||
beeLedis "github.com/beego/beego/v2/server/web/session/ledis"
|
||||
)
|
||||
|
||||
// SessionStore ledis session store
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/astaxie/beego/session/memcache"
|
||||
// "github.com/astaxie/beego/session"
|
||||
// _ "github.com/beego/beego/v2/session/memcache"
|
||||
// "github.com/beego/beego/v2/session"
|
||||
// )
|
||||
//
|
||||
// func init() {
|
||||
@@ -36,9 +36,9 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego/adapter/session"
|
||||
"github.com/beego/beego/v2/adapter/session"
|
||||
|
||||
beemem "github.com/astaxie/beego/server/web/session/memcache"
|
||||
beemem "github.com/beego/beego/v2/server/web/session/memcache"
|
||||
)
|
||||
|
||||
// SessionStore memcache session store
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/astaxie/beego/session/mysql"
|
||||
// "github.com/astaxie/beego/session"
|
||||
// _ "github.com/beego/beego/v2/session/mysql"
|
||||
// "github.com/beego/beego/v2/session"
|
||||
// )
|
||||
//
|
||||
// func init() {
|
||||
@@ -44,8 +44,8 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego/adapter/session"
|
||||
"github.com/astaxie/beego/server/web/session/mysql"
|
||||
"github.com/beego/beego/v2/adapter/session"
|
||||
"github.com/beego/beego/v2/server/web/session/mysql"
|
||||
|
||||
// import mysql driver
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/astaxie/beego/session/postgresql"
|
||||
// "github.com/astaxie/beego/session"
|
||||
// _ "github.com/beego/beego/v2/session/postgresql"
|
||||
// "github.com/beego/beego/v2/session"
|
||||
// )
|
||||
//
|
||||
// func init() {
|
||||
@@ -54,11 +54,11 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego/adapter/session"
|
||||
"github.com/beego/beego/v2/adapter/session"
|
||||
// import postgresql Driver
|
||||
_ "github.com/lib/pq"
|
||||
|
||||
"github.com/astaxie/beego/server/web/session/postgres"
|
||||
"github.com/beego/beego/v2/server/web/session/postgres"
|
||||
)
|
||||
|
||||
// SessionStore postgresql session store
|
||||
|
||||
@@ -17,7 +17,7 @@ package session
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/astaxie/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
type oldToNewProviderAdapter struct {
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/astaxie/beego/session/redis"
|
||||
// "github.com/astaxie/beego/session"
|
||||
// _ "github.com/beego/beego/v2/session/redis"
|
||||
// "github.com/beego/beego/v2/session"
|
||||
// )
|
||||
//
|
||||
// func init() {
|
||||
@@ -36,9 +36,9 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego/adapter/session"
|
||||
"github.com/beego/beego/v2/adapter/session"
|
||||
|
||||
beeRedis "github.com/astaxie/beego/server/web/session/redis"
|
||||
beeRedis "github.com/beego/beego/v2/server/web/session/redis"
|
||||
)
|
||||
|
||||
// MaxPoolSize redis max pool size
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/astaxie/beego/session/redis_cluster"
|
||||
// "github.com/astaxie/beego/session"
|
||||
// _ "github.com/beego/beego/v2/session/redis_cluster"
|
||||
// "github.com/beego/beego/v2/session"
|
||||
// )
|
||||
//
|
||||
// func init() {
|
||||
@@ -36,8 +36,8 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego/adapter/session"
|
||||
cluster "github.com/astaxie/beego/server/web/session/redis_cluster"
|
||||
"github.com/beego/beego/v2/adapter/session"
|
||||
cluster "github.com/beego/beego/v2/server/web/session/redis_cluster"
|
||||
)
|
||||
|
||||
// MaxPoolSize redis_cluster max pool size
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/astaxie/beego/session/redis_sentinel"
|
||||
// "github.com/astaxie/beego/session"
|
||||
// _ "github.com/beego/beego/v2/session/redis_sentinel"
|
||||
// "github.com/beego/beego/v2/session"
|
||||
// )
|
||||
//
|
||||
// func init() {
|
||||
@@ -36,9 +36,9 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego/adapter/session"
|
||||
"github.com/beego/beego/v2/adapter/session"
|
||||
|
||||
sentinel "github.com/astaxie/beego/server/web/session/redis_sentinel"
|
||||
sentinel "github.com/beego/beego/v2/server/web/session/redis_sentinel"
|
||||
)
|
||||
|
||||
// DefaultPoolSize redis_sentinel default pool size
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/astaxie/beego/adapter/session"
|
||||
"github.com/beego/beego/v2/adapter/session"
|
||||
)
|
||||
|
||||
func TestRedisSentinel(t *testing.T) {
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
// CookieSessionStore Cookie SessionStore
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
// FileSessionStore File session store
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
// MemSessionStore memory session store.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package session
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
// EncodeGob encode the obj to gob
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// "github.com/astaxie/beego/session"
|
||||
// "github.com/beego/beego/v2/session"
|
||||
// )
|
||||
//
|
||||
// func init() {
|
||||
@@ -32,7 +32,7 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/astaxie/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
// Store contains all data for one session process with specific id.
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego/adapter/session"
|
||||
"github.com/beego/beego/v2/adapter/session"
|
||||
|
||||
beeSsdb "github.com/astaxie/beego/server/web/session/ssdb"
|
||||
beeSsdb "github.com/beego/beego/v2/server/web/session/ssdb"
|
||||
)
|
||||
|
||||
// Provider holds ssdb client and configs
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego/server/web/session"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
type NewToOldStoreAdapter struct {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
package swagger
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/server/web/swagger"
|
||||
"github.com/beego/beego/v2/server/web/swagger"
|
||||
)
|
||||
|
||||
// Swagger list the resource
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego/server/web"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
)
|
||||
|
||||
// ExecuteTemplate applies the template with name to the specified data object,
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego/server/web"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/client/httplib/testing"
|
||||
"github.com/beego/beego/v2/client/httplib/testing"
|
||||
)
|
||||
|
||||
var port = ""
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
package toolbox
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/core/admin"
|
||||
"github.com/beego/beego/v2/core/admin"
|
||||
)
|
||||
|
||||
// AdminCheckList holds health checker map
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego/core/admin"
|
||||
"github.com/beego/beego/v2/core/admin"
|
||||
)
|
||||
|
||||
var startTime = time.Now()
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user