diff --git a/grace/grace.go b/grace/grace.go index fb0cb7bb..39d067fd 100644 --- a/grace/grace.go +++ b/grace/grace.go @@ -54,16 +54,22 @@ import ( const ( // PreSignal is the position to add filter before signal + // Deprecated: using pkg/grace, we will delete this in v2.1.0 PreSignal = iota // PostSignal is the position to add filter after signal + // Deprecated: using pkg/grace, we will delete this in v2.1.0 PostSignal // StateInit represent the application inited + // Deprecated: using pkg/grace, we will delete this in v2.1.0 StateInit // StateRunning represent the application is running + // Deprecated: using pkg/grace, we will delete this in v2.1.0 StateRunning // StateShuttingDown represent the application is shutting down + // Deprecated: using pkg/grace, we will delete this in v2.1.0 StateShuttingDown // StateTerminate represent the application is killed + // Deprecated: using pkg/grace, we will delete this in v2.1.0 StateTerminate ) @@ -106,6 +112,7 @@ func init() { } // NewServer returns a new graceServer. +// Deprecated: using pkg/grace, we will delete this in v2.1.0 func NewServer(addr string, handler http.Handler) (srv *Server) { regLock.Lock() defer regLock.Unlock() @@ -154,12 +161,14 @@ func NewServer(addr string, handler http.Handler) (srv *Server) { } // ListenAndServe refer http.ListenAndServe +// Deprecated: using pkg/grace, we will delete this in v2.1.0 func ListenAndServe(addr string, handler http.Handler) error { server := NewServer(addr, handler) return server.ListenAndServe() } // ListenAndServeTLS refer http.ListenAndServeTLS +// Deprecated: using pkg/grace, we will delete this in v2.1.0 func ListenAndServeTLS(addr string, certFile string, keyFile string, handler http.Handler) error { server := NewServer(addr, handler) return server.ListenAndServeTLS(certFile, keyFile) diff --git a/grace/server.go b/grace/server.go index 008a6171..cd659f82 100644 --- a/grace/server.go +++ b/grace/server.go @@ -18,6 +18,7 @@ import ( ) // Server embedded http.Server +// Deprecated: using pkg/grace, we will delete this in v2.1.0 type Server struct { *http.Server ln net.Listener @@ -32,6 +33,7 @@ type Server struct { // Serve accepts incoming connections on the Listener l, // creating a new service goroutine for each. // The service goroutines read requests and then call srv.Handler to reply to them. +// Deprecated: using pkg/grace, we will delete this in v2.1.0 func (srv *Server) Serve() (err error) { srv.state = StateRunning defer func() { srv.state = StateTerminate }() @@ -55,6 +57,7 @@ func (srv *Server) Serve() (err error) { // ListenAndServe listens on the TCP network address srv.Addr and then calls Serve // to handle requests on incoming connections. If srv.Addr is blank, ":http" is // used. +// Deprecated: using pkg/grace, we will delete this in v2.1.0 func (srv *Server) ListenAndServe() (err error) { addr := srv.Addr if addr == "" { @@ -94,6 +97,7 @@ func (srv *Server) ListenAndServe() (err error) { // CA's certificate. // // If srv.Addr is blank, ":https" is used. +// Deprecated: using pkg/grace, we will delete this in v2.1.0 func (srv *Server) ListenAndServeTLS(certFile, keyFile string) (err error) { addr := srv.Addr if addr == "" { @@ -140,6 +144,7 @@ func (srv *Server) ListenAndServeTLS(certFile, keyFile string) (err error) { // ListenAndServeMutualTLS listens on the TCP network address srv.Addr and then calls // Serve to handle requests on incoming mutual TLS connections. +// Deprecated: using pkg/grace, we will delete this in v2.1.0 func (srv *Server) ListenAndServeMutualTLS(certFile, keyFile, trustFile string) (err error) { addr := srv.Addr if addr == "" { @@ -340,6 +345,7 @@ func (srv *Server) fork() (err error) { } // RegisterSignalHook registers a function to be run PreSignal or PostSignal for a given signal. +// Deprecated: using pkg/grace, we will delete this in v2.1.0 func (srv *Server) RegisterSignalHook(ppFlag int, sig os.Signal, f func()) (err error) { if ppFlag != PreSignal && ppFlag != PostSignal { err = fmt.Errorf("Invalid ppFlag argument. Must be either grace.PreSignal or grace.PostSignal") diff --git a/pkg/admin.go b/pkg/admin.go index db52647e..4d8b256f 100644 --- a/pkg/admin.go +++ b/pkg/admin.go @@ -27,10 +27,10 @@ import ( "github.com/prometheus/client_golang/prometheus/promhttp" - "github.com/astaxie/beego/grace" - "github.com/astaxie/beego/logs" - "github.com/astaxie/beego/toolbox" - "github.com/astaxie/beego/utils" + "github.com/astaxie/beego/pkg/grace" + "github.com/astaxie/beego/pkg/logs" + "github.com/astaxie/beego/pkg/toolbox" + "github.com/astaxie/beego/pkg/utils" ) // BeeAdminApp is the default adminApp used by admin module. diff --git a/pkg/admin_test.go b/pkg/admin_test.go index 3f3612e4..e7eae771 100644 --- a/pkg/admin_test.go +++ b/pkg/admin_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/astaxie/beego/toolbox" + "github.com/astaxie/beego/pkg/toolbox" ) type SampleDatabaseCheck struct { diff --git a/pkg/app.go b/pkg/app.go index f3fe6f7b..eb672b1f 100644 --- a/pkg/app.go +++ b/pkg/app.go @@ -27,10 +27,11 @@ import ( "strings" "time" - "github.com/astaxie/beego/grace" - "github.com/astaxie/beego/logs" - "github.com/astaxie/beego/utils" "golang.org/x/crypto/acme/autocert" + + "github.com/astaxie/beego/pkg/grace" + "github.com/astaxie/beego/pkg/logs" + "github.com/astaxie/beego/pkg/utils" ) var ( @@ -348,7 +349,7 @@ func findAndRemoveSingleTree(entryPointTree *Tree) { // func (b *BankAccount)Mapping(){ // b.Mapping("ShowAccount" , b.ShowAccount) // b.Mapping("ModifyAccount", b.ModifyAccount) -//} +// } // // //@router /account/:id [get] // func (b *BankAccount) ShowAccount(){ diff --git a/pkg/cache/memcache/memcache.go b/pkg/cache/memcache/memcache.go index 19116bfa..b08596eb 100644 --- a/pkg/cache/memcache/memcache.go +++ b/pkg/cache/memcache/memcache.go @@ -35,8 +35,9 @@ import ( "strings" "time" - "github.com/astaxie/beego/cache" "github.com/bradfitz/gomemcache/memcache" + + "github.com/astaxie/beego/pkg/cache" ) // Cache Memcache adapter. diff --git a/pkg/cache/memcache/memcache_test.go b/pkg/cache/memcache/memcache_test.go index d9129b69..b7dad8fc 100644 --- a/pkg/cache/memcache/memcache_test.go +++ b/pkg/cache/memcache/memcache_test.go @@ -21,7 +21,7 @@ import ( "testing" "time" - "github.com/astaxie/beego/cache" + "github.com/astaxie/beego/pkg/cache" ) func TestMemcacheCache(t *testing.T) { @@ -70,7 +70,7 @@ func TestMemcacheCache(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) } @@ -82,7 +82,7 @@ func TestMemcacheCache(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) } diff --git a/pkg/cache/redis/redis.go b/pkg/cache/redis/redis.go index d8737b3c..a5fec591 100644 --- a/pkg/cache/redis/redis.go +++ b/pkg/cache/redis/redis.go @@ -34,12 +34,12 @@ import ( "errors" "fmt" "strconv" + "strings" "time" "github.com/gomodule/redigo/redis" - "github.com/astaxie/beego/cache" - "strings" + "github.com/astaxie/beego/pkg/cache" ) var ( @@ -56,7 +56,7 @@ type Cache struct { password string maxIdle int - //the timeout to a value less than the redis server's timeout. + // the timeout to a value less than the redis server's timeout. timeout time.Duration } diff --git a/pkg/cache/redis/redis_test.go b/pkg/cache/redis/redis_test.go index 60a19180..8de331ab 100644 --- a/pkg/cache/redis/redis_test.go +++ b/pkg/cache/redis/redis_test.go @@ -19,9 +19,10 @@ import ( "testing" "time" - "github.com/astaxie/beego/cache" "github.com/gomodule/redigo/redis" "github.com/stretchr/testify/assert" + + "github.com/astaxie/beego/pkg/cache" ) func TestRedisCache(t *testing.T) { @@ -70,7 +71,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) } @@ -82,7 +83,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) } diff --git a/pkg/cache/ssdb/ssdb.go b/pkg/cache/ssdb/ssdb.go index fa2ce04b..62a63c60 100644 --- a/pkg/cache/ssdb/ssdb.go +++ b/pkg/cache/ssdb/ssdb.go @@ -9,7 +9,7 @@ import ( "github.com/ssdb/gossdb/ssdb" - "github.com/astaxie/beego/cache" + "github.com/astaxie/beego/pkg/cache" ) // Cache SSDB adapter diff --git a/pkg/cache/ssdb/ssdb_test.go b/pkg/cache/ssdb/ssdb_test.go index dd474960..7390ea94 100644 --- a/pkg/cache/ssdb/ssdb_test.go +++ b/pkg/cache/ssdb/ssdb_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/astaxie/beego/cache" + "github.com/astaxie/beego/pkg/cache" ) func TestSsdbcacheCache(t *testing.T) { diff --git a/pkg/config.go b/pkg/config.go index b6c9a99c..2a5dec25 100644 --- a/pkg/config.go +++ b/pkg/config.go @@ -22,11 +22,11 @@ import ( "runtime" "strings" - "github.com/astaxie/beego/config" - "github.com/astaxie/beego/context" - "github.com/astaxie/beego/logs" - "github.com/astaxie/beego/session" - "github.com/astaxie/beego/utils" + "github.com/astaxie/beego/pkg/config" + "github.com/astaxie/beego/pkg/context" + "github.com/astaxie/beego/pkg/logs" + "github.com/astaxie/beego/pkg/session" + "github.com/astaxie/beego/pkg/utils" ) // Config is the main struct for BConfig diff --git a/pkg/config/env/env.go b/pkg/config/env/env.go index 34f094fe..7c729780 100644 --- a/pkg/config/env/env.go +++ b/pkg/config/env/env.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/astaxie/beego/utils" + "github.com/astaxie/beego/pkg/utils" ) var env *utils.BeeMap diff --git a/pkg/config/ini.go b/pkg/config/ini/ini.go similarity index 97% rename from pkg/config/ini.go rename to pkg/config/ini/ini.go index 002e5e05..a3c6462d 100644 --- a/pkg/config/ini.go +++ b/pkg/config/ini/ini.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package config +package ini import ( "bufio" @@ -26,6 +26,8 @@ import ( "strconv" "strings" "sync" + + "github.com/astaxie/beego/pkg/config" ) var ( @@ -45,7 +47,7 @@ type IniConfig struct { } // Parse creates a new Config and parses the file configuration from the named file. -func (ini *IniConfig) Parse(name string) (Configer, error) { +func (ini *IniConfig) Parse(name string) (config.Configer, error) { return ini.parseFile(name) } @@ -195,7 +197,7 @@ func (ini *IniConfig) parseData(dir string, data []byte) (*IniConfigContainer, e val = bytes.Trim(val, `"`) } - cfg.data[section][key] = ExpandValueEnv(string(val)) + cfg.data[section][key] = config.ExpandValueEnv(string(val)) if comment.Len() > 0 { cfg.keyComment[section+"."+key] = comment.String() comment.Reset() @@ -208,7 +210,7 @@ func (ini *IniConfig) parseData(dir string, data []byte) (*IniConfigContainer, e // ParseData parse ini the data // When include other.conf,other.conf is either absolute directory // or under beego in default temporary directory(/tmp/beego[-username]). -func (ini *IniConfig) ParseData(data []byte) (Configer, error) { +func (ini *IniConfig) ParseData(data []byte) (config.Configer, error) { dir := "beego" currentUser, err := user.Current() if err == nil { @@ -233,7 +235,7 @@ type IniConfigContainer struct { // Bool returns the boolean value for a given key. func (c *IniConfigContainer) Bool(key string) (bool, error) { - return ParseBool(c.getdata(key)) + return config.ParseBool(c.getdata(key)) } // DefaultBool returns the boolean value for a given key. @@ -500,5 +502,5 @@ func (c *IniConfigContainer) getdata(key string) string { } func init() { - Register("ini", &IniConfig{}) + config.Register("ini", &IniConfig{}) } diff --git a/pkg/config/ini_test.go b/pkg/config/ini/ini_test.go similarity index 95% rename from pkg/config/ini_test.go rename to pkg/config/ini/ini_test.go index ffcdb294..70f1091d 100644 --- a/pkg/config/ini_test.go +++ b/pkg/config/ini/ini_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package config +package ini import ( "fmt" @@ -20,6 +20,8 @@ import ( "os" "strings" "testing" + + "github.com/astaxie/beego/pkg/config" ) func TestIni(t *testing.T) { @@ -92,7 +94,7 @@ password = ${GOPATH} } f.Close() defer os.Remove("testini.conf") - iniconf, err := NewConfig("ini", "testini.conf") + iniconf, err := config.NewConfig("ini", "testini.conf") if err != nil { t.Fatal(err) } @@ -165,7 +167,7 @@ httpport=8080 name=mysql ` ) - cfg, err := NewConfigData("ini", []byte(inicontext)) + cfg, err := config.NewConfigData("ini", []byte(inicontext)) if err != nil { t.Fatal(err) } diff --git a/pkg/config/json.go b/pkg/config/json/json.go similarity index 95% rename from pkg/config/json.go rename to pkg/config/json/json.go index c4ef25cd..49bd38ff 100644 --- a/pkg/config/json.go +++ b/pkg/config/json/json.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package config +package json import ( "encoding/json" @@ -23,6 +23,8 @@ import ( "strconv" "strings" "sync" + + "github.com/astaxie/beego/pkg/config" ) // JSONConfig is a json config parser and implements Config interface. @@ -30,7 +32,7 @@ type JSONConfig struct { } // Parse returns a ConfigContainer with parsed json config map. -func (js *JSONConfig) Parse(filename string) (Configer, error) { +func (js *JSONConfig) Parse(filename string) (config.Configer, error) { file, err := os.Open(filename) if err != nil { return nil, err @@ -45,7 +47,7 @@ func (js *JSONConfig) Parse(filename string) (Configer, error) { } // ParseData returns a ConfigContainer with json string -func (js *JSONConfig) ParseData(data []byte) (Configer, error) { +func (js *JSONConfig) ParseData(data []byte) (config.Configer, error) { x := &JSONConfigContainer{ data: make(map[string]interface{}), } @@ -59,7 +61,7 @@ func (js *JSONConfig) ParseData(data []byte) (Configer, error) { x.data["rootArray"] = wrappingArray } - x.data = ExpandValueEnvForMap(x.data) + x.data = config.ExpandValueEnvForMap(x.data) return x, nil } @@ -75,7 +77,7 @@ type JSONConfigContainer struct { func (c *JSONConfigContainer) Bool(key string) (bool, error) { val := c.getData(key) if val != nil { - return ParseBool(val) + return config.ParseBool(val) } return false, fmt.Errorf("not exist key: %q", key) } @@ -265,5 +267,5 @@ func (c *JSONConfigContainer) getData(key string) interface{} { } func init() { - Register("json", &JSONConfig{}) + config.Register("json", &JSONConfig{}) } diff --git a/pkg/config/json_test.go b/pkg/config/json/json_test.go similarity index 97% rename from pkg/config/json_test.go rename to pkg/config/json/json_test.go index 16f42409..da87986f 100644 --- a/pkg/config/json_test.go +++ b/pkg/config/json/json_test.go @@ -12,12 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -package config +package json import ( "fmt" "os" "testing" + + "github.com/astaxie/beego/pkg/config" ) func TestJsonStartsWithArray(t *testing.T) { @@ -43,7 +45,7 @@ func TestJsonStartsWithArray(t *testing.T) { } f.Close() defer os.Remove("testjsonWithArray.conf") - jsonconf, err := NewConfig("json", "testjsonWithArray.conf") + jsonconf, err := config.NewConfig("json", "testjsonWithArray.conf") if err != nil { t.Fatal(err) } @@ -143,7 +145,7 @@ func TestJson(t *testing.T) { } f.Close() defer os.Remove("testjson.conf") - jsonconf, err := NewConfig("json", "testjson.conf") + jsonconf, err := config.NewConfig("json", "testjson.conf") if err != nil { t.Fatal(err) } diff --git a/pkg/config/xml/xml.go b/pkg/config/xml/xml.go index 494242d3..b1cce5c8 100644 --- a/pkg/config/xml/xml.go +++ b/pkg/config/xml/xml.go @@ -39,7 +39,7 @@ import ( "strings" "sync" - "github.com/astaxie/beego/config" + "github.com/astaxie/beego/pkg/config" "github.com/beego/x2j" ) diff --git a/pkg/config/xml/xml_test.go b/pkg/config/xml/xml_test.go index 346c866e..b7828933 100644 --- a/pkg/config/xml/xml_test.go +++ b/pkg/config/xml/xml_test.go @@ -19,7 +19,7 @@ import ( "os" "testing" - "github.com/astaxie/beego/config" + "github.com/astaxie/beego/pkg/config" ) func TestXML(t *testing.T) { diff --git a/pkg/config/yaml/yaml.go b/pkg/config/yaml/yaml.go index a5644c7b..3dcb45fd 100644 --- a/pkg/config/yaml/yaml.go +++ b/pkg/config/yaml/yaml.go @@ -40,7 +40,7 @@ import ( "strings" "sync" - "github.com/astaxie/beego/config" + "github.com/astaxie/beego/pkg/config" "github.com/beego/goyaml2" ) diff --git a/pkg/config/yaml/yaml_test.go b/pkg/config/yaml/yaml_test.go index 49cc1d1e..0e76457f 100644 --- a/pkg/config/yaml/yaml_test.go +++ b/pkg/config/yaml/yaml_test.go @@ -19,7 +19,7 @@ import ( "os" "testing" - "github.com/astaxie/beego/config" + "github.com/astaxie/beego/pkg/config" ) func TestYaml(t *testing.T) { diff --git a/pkg/config_test.go b/pkg/config_test.go index 5f71f1c3..c810a9e3 100644 --- a/pkg/config_test.go +++ b/pkg/config_test.go @@ -19,7 +19,7 @@ import ( "reflect" "testing" - "github.com/astaxie/beego/config" + beeJson "github.com/astaxie/beego/pkg/config/json" ) func TestDefaults(t *testing.T) { @@ -35,7 +35,7 @@ func TestDefaults(t *testing.T) { func TestAssignConfig_01(t *testing.T) { _BConfig := &Config{} _BConfig.AppName = "beego_test" - jcf := &config.JSONConfig{} + jcf := &beeJson.JSONConfig{} ac, _ := jcf.ParseData([]byte(`{"AppName":"beego_json"}`)) assignSingleConfig(_BConfig, ac) if _BConfig.AppName != "beego_json" { @@ -73,7 +73,7 @@ func TestAssignConfig_02(t *testing.T) { configMap["SessionProviderConfig"] = "file" configMap["FileLineNum"] = true - jcf := &config.JSONConfig{} + jcf := &beeJson.JSONConfig{} bs, _ = json.Marshal(configMap) ac, _ := jcf.ParseData(bs) @@ -109,7 +109,7 @@ func TestAssignConfig_02(t *testing.T) { } func TestAssignConfig_03(t *testing.T) { - jcf := &config.JSONConfig{} + jcf := &beeJson.JSONConfig{} ac, _ := jcf.ParseData([]byte(`{"AppName":"beego"}`)) ac.Set("AppName", "test_app") ac.Set("RunMode", "online") diff --git a/pkg/context/context.go b/pkg/context/context.go index de248ed2..9326fa28 100644 --- a/pkg/context/context.go +++ b/pkg/context/context.go @@ -35,7 +35,7 @@ import ( "strings" "time" - "github.com/astaxie/beego/utils" + "github.com/astaxie/beego/pkg/utils" ) //commonly used mime-types diff --git a/pkg/context/input.go b/pkg/context/input.go index 385549c1..04347e04 100644 --- a/pkg/context/input.go +++ b/pkg/context/input.go @@ -29,7 +29,7 @@ import ( "strings" "sync" - "github.com/astaxie/beego/session" + "github.com/astaxie/beego/pkg/session" ) // Regexes for checking the accept headers diff --git a/pkg/context/param/conv.go b/pkg/context/param/conv.go index c200e008..d96f964c 100644 --- a/pkg/context/param/conv.go +++ b/pkg/context/param/conv.go @@ -4,8 +4,8 @@ import ( "fmt" "reflect" - beecontext "github.com/astaxie/beego/context" - "github.com/astaxie/beego/logs" + beecontext "github.com/astaxie/beego/pkg/context" + "github.com/astaxie/beego/pkg/logs" ) // ConvertParams converts http method params to values that will be passed to the method controller as arguments diff --git a/pkg/controller.go b/pkg/controller.go index 0e8853b3..f3989a76 100644 --- a/pkg/controller.go +++ b/pkg/controller.go @@ -28,9 +28,9 @@ import ( "strconv" "strings" - "github.com/astaxie/beego/context" - "github.com/astaxie/beego/context/param" - "github.com/astaxie/beego/session" + "github.com/astaxie/beego/pkg/context" + "github.com/astaxie/beego/pkg/context/param" + "github.com/astaxie/beego/pkg/session" ) var ( diff --git a/pkg/controller_test.go b/pkg/controller_test.go index 1e53416d..f51cc109 100644 --- a/pkg/controller_test.go +++ b/pkg/controller_test.go @@ -19,7 +19,7 @@ import ( "strconv" "testing" - "github.com/astaxie/beego/context" + "github.com/astaxie/beego/pkg/context" "os" "path/filepath" ) diff --git a/pkg/doc.go b/pkg/doc.go index 8825bd29..a1cdbbb0 100644 --- a/pkg/doc.go +++ b/pkg/doc.go @@ -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/astaxie/beego" + import "github.com/astaxie/beego/pkg" func main() { beego.Run() diff --git a/pkg/error.go b/pkg/error.go index f268f723..aff984c0 100644 --- a/pkg/error.go +++ b/pkg/error.go @@ -23,8 +23,8 @@ import ( "strconv" "strings" - "github.com/astaxie/beego/context" - "github.com/astaxie/beego/utils" + "github.com/astaxie/beego/pkg/context" + "github.com/astaxie/beego/pkg/utils" ) const ( diff --git a/pkg/filter.go b/pkg/filter.go index 9cc6e913..4e212e06 100644 --- a/pkg/filter.go +++ b/pkg/filter.go @@ -14,7 +14,7 @@ package beego -import "github.com/astaxie/beego/context" +import "github.com/astaxie/beego/pkg/context" // FilterFunc defines a filter function which is invoked before the controller handler is executed. type FilterFunc func(*context.Context) diff --git a/pkg/filter_test.go b/pkg/filter_test.go index 4ca4d2b8..3a1bcb07 100644 --- a/pkg/filter_test.go +++ b/pkg/filter_test.go @@ -19,7 +19,7 @@ import ( "net/http/httptest" "testing" - "github.com/astaxie/beego/context" + "github.com/astaxie/beego/pkg/context" ) var FilterUser = func(ctx *context.Context) { diff --git a/pkg/hooks.go b/pkg/hooks.go index 49c42d5a..8c782383 100644 --- a/pkg/hooks.go +++ b/pkg/hooks.go @@ -6,9 +6,9 @@ import ( "net/http" "path/filepath" - "github.com/astaxie/beego/context" - "github.com/astaxie/beego/logs" - "github.com/astaxie/beego/session" + "github.com/astaxie/beego/pkg/context" + "github.com/astaxie/beego/pkg/logs" + "github.com/astaxie/beego/pkg/session" ) // register MIME type with content type diff --git a/pkg/log.go b/pkg/log.go index cc4c0f81..785f96d8 100644 --- a/pkg/log.go +++ b/pkg/log.go @@ -17,11 +17,11 @@ package beego import ( "strings" - "github.com/astaxie/beego/logs" + "github.com/astaxie/beego/pkg/logs" ) // Log levels to control the logging output. -// Deprecated: use github.com/astaxie/beego/logs instead. +// Deprecated: use github.com/astaxie/beego/pkg/logs instead. const ( LevelEmergency = iota LevelAlert @@ -34,90 +34,90 @@ const ( ) // BeeLogger references the used application logger. -// Deprecated: use github.com/astaxie/beego/logs instead. +// Deprecated: use github.com/astaxie/beego/pkg/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/astaxie/beego/pkg/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/astaxie/beego/pkg/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/astaxie/beego/pkg/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/astaxie/beego/pkg/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/astaxie/beego/pkg/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/astaxie/beego/pkg/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/astaxie/beego/pkg/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/astaxie/beego/pkg/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/astaxie/beego/pkg/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/astaxie/beego/pkg/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/astaxie/beego/pkg/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/astaxie/beego/pkg/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/astaxie/beego/pkg/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/astaxie/beego/pkg/logs instead. func Trace(v ...interface{}) { logs.Trace(generateFmtStr(len(v)), v...) } diff --git a/pkg/logs/alils/alils.go b/pkg/logs/alils/alils.go index 867ff4cb..8397b3da 100644 --- a/pkg/logs/alils/alils.go +++ b/pkg/logs/alils/alils.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/astaxie/beego/logs" + "github.com/astaxie/beego/pkg/logs" "github.com/gogo/protobuf/proto" ) diff --git a/pkg/logs/es/es.go b/pkg/logs/es/es.go index 2b7b1710..af6a7892 100644 --- a/pkg/logs/es/es.go +++ b/pkg/logs/es/es.go @@ -12,7 +12,7 @@ import ( "github.com/elastic/go-elasticsearch/v6" "github.com/elastic/go-elasticsearch/v6/esapi" - "github.com/astaxie/beego/logs" + "github.com/astaxie/beego/pkg/logs" ) // NewES return a LoggerInterface diff --git a/pkg/metric/prometheus.go b/pkg/metric/prometheus.go index 86e2c1b1..6a97aec5 100644 --- a/pkg/metric/prometheus.go +++ b/pkg/metric/prometheus.go @@ -23,8 +23,8 @@ import ( "github.com/prometheus/client_golang/prometheus" - "github.com/astaxie/beego" - "github.com/astaxie/beego/logs" + "github.com/astaxie/beego/pkg" + "github.com/astaxie/beego/pkg/logs" ) func PrometheusMiddleWare(next http.Handler) http.Handler { diff --git a/pkg/metric/prometheus_test.go b/pkg/metric/prometheus_test.go index d82a6dec..e04c3285 100644 --- a/pkg/metric/prometheus_test.go +++ b/pkg/metric/prometheus_test.go @@ -22,7 +22,7 @@ import ( "github.com/prometheus/client_golang/prometheus" - "github.com/astaxie/beego/context" + "github.com/astaxie/beego/pkg/context" ) func TestPrometheusMiddleWare(t *testing.T) { diff --git a/pkg/migration/ddl.go b/pkg/migration/ddl.go index cd2c1c49..b6d3a2d9 100644 --- a/pkg/migration/ddl.go +++ b/pkg/migration/ddl.go @@ -17,7 +17,7 @@ package migration import ( "fmt" - "github.com/astaxie/beego/logs" + "github.com/astaxie/beego/pkg/logs" ) // Index struct defines the structure of Index Columns diff --git a/pkg/migration/migration.go b/pkg/migration/migration.go index 5ddfd972..c62fd901 100644 --- a/pkg/migration/migration.go +++ b/pkg/migration/migration.go @@ -33,8 +33,8 @@ import ( "strings" "time" - "github.com/astaxie/beego/logs" - "github.com/astaxie/beego/orm" + "github.com/astaxie/beego/pkg/logs" + "github.com/astaxie/beego/pkg/orm" ) // const the data format for the bee generate migration datatype diff --git a/pkg/namespace.go b/pkg/namespace.go index 4952c9d5..bda18f4b 100644 --- a/pkg/namespace.go +++ b/pkg/namespace.go @@ -18,7 +18,7 @@ import ( "net/http" "strings" - beecontext "github.com/astaxie/beego/context" + beecontext "github.com/astaxie/beego/pkg/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/astaxie/beego#Router +// refer: https://godoc.org/github.com/astaxie/beego/pkg#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/astaxie/beego#AutoRouter +// refer: https://godoc.org/github.com/astaxie/beego/pkg#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/astaxie/beego#AutoPrefix +// refer: https://godoc.org/github.com/astaxie/beego/pkg#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/astaxie/beego#Get +// refer: https://godoc.org/github.com/astaxie/beego/pkg#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/astaxie/beego#Post +// refer: https://godoc.org/github.com/astaxie/beego/pkg#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/astaxie/beego#Delete +// refer: https://godoc.org/github.com/astaxie/beego/pkg#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/astaxie/beego#Put +// refer: https://godoc.org/github.com/astaxie/beego/pkg#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/astaxie/beego#Head +// refer: https://godoc.org/github.com/astaxie/beego/pkg#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/astaxie/beego#Options +// refer: https://godoc.org/github.com/astaxie/beego/pkg#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/astaxie/beego#Patch +// refer: https://godoc.org/github.com/astaxie/beego/pkg#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/astaxie/beego#Any +// refer: https://godoc.org/github.com/astaxie/beego/pkg#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/astaxie/beego#Handler +// refer: https://godoc.org/github.com/astaxie/beego/pkg#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/astaxie/beego#Include +// refer: https://godoc.org/github.com/astaxie/beego/pkg#Include func (n *Namespace) Include(cList ...ControllerInterface) *Namespace { n.handlers.Include(cList...) return n diff --git a/pkg/namespace_test.go b/pkg/namespace_test.go index b3f20dff..bdf33b4f 100644 --- a/pkg/namespace_test.go +++ b/pkg/namespace_test.go @@ -20,7 +20,7 @@ import ( "strconv" "testing" - "github.com/astaxie/beego/context" + "github.com/astaxie/beego/pkg/context" ) func TestNamespaceGet(t *testing.T) { diff --git a/pkg/orm/orm.go b/pkg/orm/orm.go index b2f1e693..9a94fb11 100644 --- a/pkg/orm/orm.go +++ b/pkg/orm/orm.go @@ -63,7 +63,7 @@ import ( "reflect" "time" - "github.com/astaxie/beego/logs" + "github.com/astaxie/beego/pkg/logs" ) // DebugQueries define the debug diff --git a/pkg/parser.go b/pkg/parser.go index 3a311894..606be190 100644 --- a/pkg/parser.go +++ b/pkg/parser.go @@ -30,16 +30,16 @@ import ( "strings" "unicode" - "github.com/astaxie/beego/context/param" - "github.com/astaxie/beego/logs" - "github.com/astaxie/beego/utils" + "github.com/astaxie/beego/pkg/context/param" + "github.com/astaxie/beego/pkg/logs" + "github.com/astaxie/beego/pkg/utils" ) var globalRouterTemplate = `package {{.routersDir}} import ( - "github.com/astaxie/beego" - "github.com/astaxie/beego/context/param"{{.globalimport}} + "github.com/astaxie/beego/pkg" + "github.com/astaxie/beego/pkg/context/param"{{.globalimport}} ) func init() { diff --git a/pkg/plugins/apiauth/apiauth.go b/pkg/plugins/apiauth/apiauth.go index 10e25f3f..90360aba 100644 --- a/pkg/plugins/apiauth/apiauth.go +++ b/pkg/plugins/apiauth/apiauth.go @@ -65,8 +65,8 @@ import ( "sort" "time" - "github.com/astaxie/beego" - "github.com/astaxie/beego/context" + "github.com/astaxie/beego/pkg" + "github.com/astaxie/beego/pkg/context" ) // AppIDToAppSecret is used to get appsecret throw appid diff --git a/pkg/plugins/auth/basic.go b/pkg/plugins/auth/basic.go index c478044a..aa548f1a 100644 --- a/pkg/plugins/auth/basic.go +++ b/pkg/plugins/auth/basic.go @@ -40,8 +40,8 @@ import ( "net/http" "strings" - "github.com/astaxie/beego" - "github.com/astaxie/beego/context" + "github.com/astaxie/beego/pkg" + "github.com/astaxie/beego/pkg/context" ) var defaultRealm = "Authorization Required" diff --git a/pkg/plugins/authz/authz.go b/pkg/plugins/authz/authz.go index 9dc0db76..a375c593 100644 --- a/pkg/plugins/authz/authz.go +++ b/pkg/plugins/authz/authz.go @@ -40,8 +40,8 @@ package authz import ( - "github.com/astaxie/beego" - "github.com/astaxie/beego/context" + "github.com/astaxie/beego/pkg" + "github.com/astaxie/beego/pkg/context" "github.com/casbin/casbin" "net/http" ) diff --git a/pkg/plugins/authz/authz_test.go b/pkg/plugins/authz/authz_test.go index 49aed84c..53e2652a 100644 --- a/pkg/plugins/authz/authz_test.go +++ b/pkg/plugins/authz/authz_test.go @@ -15,9 +15,9 @@ package authz import ( - "github.com/astaxie/beego" - "github.com/astaxie/beego/context" - "github.com/astaxie/beego/plugins/auth" + "github.com/astaxie/beego/pkg" + "github.com/astaxie/beego/pkg/context" + "github.com/astaxie/beego/pkg/plugins/auth" "github.com/casbin/casbin" "net/http" "net/http/httptest" diff --git a/pkg/plugins/cors/cors.go b/pkg/plugins/cors/cors.go index 45c327ab..a4fb3b39 100644 --- a/pkg/plugins/cors/cors.go +++ b/pkg/plugins/cors/cors.go @@ -42,8 +42,8 @@ import ( "strings" "time" - "github.com/astaxie/beego" - "github.com/astaxie/beego/context" + "github.com/astaxie/beego/pkg" + "github.com/astaxie/beego/pkg/context" ) const ( diff --git a/pkg/plugins/cors/cors_test.go b/pkg/plugins/cors/cors_test.go index 34039143..9757a32b 100644 --- a/pkg/plugins/cors/cors_test.go +++ b/pkg/plugins/cors/cors_test.go @@ -21,8 +21,8 @@ import ( "testing" "time" - "github.com/astaxie/beego" - "github.com/astaxie/beego/context" + "github.com/astaxie/beego/pkg" + "github.com/astaxie/beego/pkg/context" ) // HTTPHeaderGuardRecorder is httptest.ResponseRecorder with own http.Header diff --git a/pkg/policy.go b/pkg/policy.go index ab23f927..4af240f1 100644 --- a/pkg/policy.go +++ b/pkg/policy.go @@ -17,7 +17,7 @@ package beego import ( "strings" - "github.com/astaxie/beego/context" + "github.com/astaxie/beego/pkg/context" ) // PolicyFunc defines a policy function which is invoked before the controller handler is executed. diff --git a/pkg/router.go b/pkg/router.go index 6a8ac6f7..995fb767 100644 --- a/pkg/router.go +++ b/pkg/router.go @@ -27,11 +27,11 @@ import ( "sync" "time" - beecontext "github.com/astaxie/beego/context" - "github.com/astaxie/beego/context/param" - "github.com/astaxie/beego/logs" - "github.com/astaxie/beego/toolbox" - "github.com/astaxie/beego/utils" + beecontext "github.com/astaxie/beego/pkg/context" + "github.com/astaxie/beego/pkg/context/param" + "github.com/astaxie/beego/pkg/logs" + "github.com/astaxie/beego/pkg/toolbox" + "github.com/astaxie/beego/pkg/utils" ) // default filter execution points diff --git a/pkg/router_test.go b/pkg/router_test.go index 8ec7927a..8a7862f6 100644 --- a/pkg/router_test.go +++ b/pkg/router_test.go @@ -21,8 +21,8 @@ import ( "strings" "testing" - "github.com/astaxie/beego/context" - "github.com/astaxie/beego/logs" + "github.com/astaxie/beego/pkg/context" + "github.com/astaxie/beego/pkg/logs" ) type TestController struct { diff --git a/pkg/session/couchbase/sess_couchbase.go b/pkg/session/couchbase/sess_couchbase.go index 707d042c..227c0bc6 100644 --- a/pkg/session/couchbase/sess_couchbase.go +++ b/pkg/session/couchbase/sess_couchbase.go @@ -39,7 +39,7 @@ import ( couchbase "github.com/couchbase/go-couchbase" - "github.com/astaxie/beego/session" + "github.com/astaxie/beego/pkg/session" ) var couchbpder = &Provider{} diff --git a/pkg/session/ledis/ledis_session.go b/pkg/session/ledis/ledis_session.go index ee81df67..a0988327 100644 --- a/pkg/session/ledis/ledis_session.go +++ b/pkg/session/ledis/ledis_session.go @@ -10,7 +10,7 @@ import ( "github.com/ledisdb/ledisdb/config" "github.com/ledisdb/ledisdb/ledis" - "github.com/astaxie/beego/session" + "github.com/astaxie/beego/pkg/session" ) var ( diff --git a/pkg/session/memcache/sess_memcache.go b/pkg/session/memcache/sess_memcache.go index 85a2d815..6cd8acab 100644 --- a/pkg/session/memcache/sess_memcache.go +++ b/pkg/session/memcache/sess_memcache.go @@ -37,7 +37,7 @@ import ( "strings" "sync" - "github.com/astaxie/beego/session" + "github.com/astaxie/beego/pkg/session" "github.com/bradfitz/gomemcache/memcache" ) diff --git a/pkg/session/mysql/sess_mysql.go b/pkg/session/mysql/sess_mysql.go index 301353ab..73738496 100644 --- a/pkg/session/mysql/sess_mysql.go +++ b/pkg/session/mysql/sess_mysql.go @@ -46,7 +46,7 @@ import ( "sync" "time" - "github.com/astaxie/beego/session" + "github.com/astaxie/beego/pkg/session" // import mysql driver _ "github.com/go-sql-driver/mysql" ) diff --git a/pkg/session/postgres/sess_postgresql.go b/pkg/session/postgres/sess_postgresql.go index 0b8b9645..e6c9ed89 100644 --- a/pkg/session/postgres/sess_postgresql.go +++ b/pkg/session/postgres/sess_postgresql.go @@ -56,7 +56,7 @@ import ( "sync" "time" - "github.com/astaxie/beego/session" + "github.com/astaxie/beego/pkg/session" // import postgresql Driver _ "github.com/lib/pq" ) diff --git a/pkg/session/redis/sess_redis.go b/pkg/session/redis/sess_redis.go index 5c382d61..f569f9dd 100644 --- a/pkg/session/redis/sess_redis.go +++ b/pkg/session/redis/sess_redis.go @@ -39,7 +39,7 @@ import ( "sync" "time" - "github.com/astaxie/beego/session" + "github.com/astaxie/beego/pkg/session" "github.com/gomodule/redigo/redis" ) diff --git a/pkg/session/redis_cluster/redis_cluster.go b/pkg/session/redis_cluster/redis_cluster.go index 262fa2e3..f7fc7845 100644 --- a/pkg/session/redis_cluster/redis_cluster.go +++ b/pkg/session/redis_cluster/redis_cluster.go @@ -33,7 +33,7 @@ package redis_cluster import ( - "github.com/astaxie/beego/session" + "github.com/astaxie/beego/pkg/session" rediss "github.com/go-redis/redis" "net/http" "strconv" diff --git a/pkg/session/redis_sentinel/sess_redis_sentinel.go b/pkg/session/redis_sentinel/sess_redis_sentinel.go index 6ecb2977..23bebf2a 100644 --- a/pkg/session/redis_sentinel/sess_redis_sentinel.go +++ b/pkg/session/redis_sentinel/sess_redis_sentinel.go @@ -33,7 +33,7 @@ package redis_sentinel import ( - "github.com/astaxie/beego/session" + "github.com/astaxie/beego/pkg/session" "github.com/go-redis/redis" "net/http" "strconv" diff --git a/pkg/session/redis_sentinel/sess_redis_sentinel_test.go b/pkg/session/redis_sentinel/sess_redis_sentinel_test.go index fd4155c6..bd31741f 100644 --- a/pkg/session/redis_sentinel/sess_redis_sentinel_test.go +++ b/pkg/session/redis_sentinel/sess_redis_sentinel_test.go @@ -5,7 +5,7 @@ import ( "net/http/httptest" "testing" - "github.com/astaxie/beego/session" + "github.com/astaxie/beego/pkg/session" ) func TestRedisSentinel(t *testing.T) { diff --git a/pkg/session/sess_utils.go b/pkg/session/sess_utils.go index 20915bb6..5b70afa8 100644 --- a/pkg/session/sess_utils.go +++ b/pkg/session/sess_utils.go @@ -29,7 +29,7 @@ import ( "strconv" "time" - "github.com/astaxie/beego/utils" + "github.com/astaxie/beego/pkg/utils" ) func init() { diff --git a/pkg/session/ssdb/sess_ssdb.go b/pkg/session/ssdb/sess_ssdb.go index de0c6360..1b382954 100644 --- a/pkg/session/ssdb/sess_ssdb.go +++ b/pkg/session/ssdb/sess_ssdb.go @@ -7,7 +7,7 @@ import ( "strings" "sync" - "github.com/astaxie/beego/session" + "github.com/astaxie/beego/pkg/session" "github.com/ssdb/gossdb/ssdb" ) diff --git a/pkg/staticfile.go b/pkg/staticfile.go index e26776c5..27e83395 100644 --- a/pkg/staticfile.go +++ b/pkg/staticfile.go @@ -26,8 +26,8 @@ import ( "sync" "time" - "github.com/astaxie/beego/context" - "github.com/astaxie/beego/logs" + "github.com/astaxie/beego/pkg/context" + "github.com/astaxie/beego/pkg/logs" "github.com/hashicorp/golang-lru" ) diff --git a/pkg/template.go b/pkg/template.go index 59875be7..8edd9dc1 100644 --- a/pkg/template.go +++ b/pkg/template.go @@ -27,8 +27,8 @@ import ( "strings" "sync" - "github.com/astaxie/beego/logs" - "github.com/astaxie/beego/utils" + "github.com/astaxie/beego/pkg/logs" + "github.com/astaxie/beego/pkg/utils" ) var ( diff --git a/pkg/template_test.go b/pkg/template_test.go index 287faadc..590a7bd6 100644 --- a/pkg/template_test.go +++ b/pkg/template_test.go @@ -16,7 +16,7 @@ package beego import ( "bytes" - "github.com/astaxie/beego/testdata" + "github.com/astaxie/beego/pkg/testdata" "github.com/elazarl/go-bindata-assetfs" "net/http" "os" diff --git a/pkg/testing/assertions.go b/pkg/testing/assertions.go deleted file mode 100644 index 96c5d4dd..00000000 --- a/pkg/testing/assertions.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2014 beego Author. All Rights Reserved. -// -// 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 testing diff --git a/pkg/testing/client.go b/pkg/testing/client.go index c3737e9c..0062b857 100644 --- a/pkg/testing/client.go +++ b/pkg/testing/client.go @@ -15,8 +15,8 @@ package testing import ( - "github.com/astaxie/beego/config" - "github.com/astaxie/beego/httplib" + "github.com/astaxie/beego/pkg/config" + "github.com/astaxie/beego/pkg/httplib" ) var port = "" diff --git a/pkg/tree.go b/pkg/tree.go index 9e53003b..785ba6a6 100644 --- a/pkg/tree.go +++ b/pkg/tree.go @@ -19,8 +19,8 @@ import ( "regexp" "strings" - "github.com/astaxie/beego/context" - "github.com/astaxie/beego/utils" + "github.com/astaxie/beego/pkg/context" + "github.com/astaxie/beego/pkg/utils" ) var ( diff --git a/pkg/tree_test.go b/pkg/tree_test.go index d412a348..8758e0c0 100644 --- a/pkg/tree_test.go +++ b/pkg/tree_test.go @@ -18,7 +18,7 @@ import ( "strings" "testing" - "github.com/astaxie/beego/context" + "github.com/astaxie/beego/pkg/context" ) type testinfo struct { diff --git a/pkg/utils/captcha/captcha.go b/pkg/utils/captcha/captcha.go index 42ac70d3..f0c37058 100644 --- a/pkg/utils/captcha/captcha.go +++ b/pkg/utils/captcha/captcha.go @@ -66,11 +66,11 @@ import ( "strings" "time" - "github.com/astaxie/beego" - "github.com/astaxie/beego/cache" - "github.com/astaxie/beego/context" - "github.com/astaxie/beego/logs" - "github.com/astaxie/beego/utils" + "github.com/astaxie/beego/pkg" + "github.com/astaxie/beego/pkg/cache" + "github.com/astaxie/beego/pkg/context" + "github.com/astaxie/beego/pkg/logs" + "github.com/astaxie/beego/pkg/utils" ) var ( diff --git a/pkg/utils/captcha/image_test.go b/pkg/utils/captcha/image_test.go index 5e35b7f7..73d3361b 100644 --- a/pkg/utils/captcha/image_test.go +++ b/pkg/utils/captcha/image_test.go @@ -17,7 +17,7 @@ package captcha import ( "testing" - "github.com/astaxie/beego/utils" + "github.com/astaxie/beego/pkg/utils" ) type byteCounter struct { diff --git a/pkg/utils/pagination/controller.go b/pkg/utils/pagination/controller.go index 2f022d0c..b5b09a2f 100644 --- a/pkg/utils/pagination/controller.go +++ b/pkg/utils/pagination/controller.go @@ -15,7 +15,7 @@ package pagination import ( - "github.com/astaxie/beego/context" + "github.com/astaxie/beego/pkg/context" ) // SetPaginator Instantiates a Paginator and assigns it to context.Input.Data("paginator"). diff --git a/pkg/utils/pagination/doc.go b/pkg/utils/pagination/doc.go index 9abc6d78..718f5e7a 100644 --- a/pkg/utils/pagination/doc.go +++ b/pkg/utils/pagination/doc.go @@ -8,7 +8,7 @@ In your beego.Controller: package controllers - import "github.com/astaxie/beego/utils/pagination" + import "github.com/astaxie/beego/pkg/utils/pagination" type PostsController struct { beego.Controller diff --git a/pkg/validation/validators.go b/pkg/validation/validators.go index 38b6f1aa..87c83ccd 100644 --- a/pkg/validation/validators.go +++ b/pkg/validation/validators.go @@ -16,7 +16,7 @@ package validation import ( "fmt" - "github.com/astaxie/beego/logs" + "github.com/astaxie/beego/pkg/logs" "reflect" "regexp" "strings"