rename to v2
This commit is contained in:
4
client/cache/README.md
vendored
4
client/cache/README.md
vendored
@@ -4,7 +4,7 @@ cache is a Go cache manager. It can use many cache adapters. The repo is inspire
|
||||
|
||||
## How to install?
|
||||
|
||||
go get github.com/beego/beego/cache
|
||||
go get github.com/beego/beego/v2/cache
|
||||
|
||||
|
||||
## What adapters are supported?
|
||||
@@ -17,7 +17,7 @@ As of now this cache support memory, Memcache and Redis.
|
||||
First you must import it
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/cache"
|
||||
"github.com/beego/beego/v2/cache"
|
||||
)
|
||||
|
||||
Then init a Cache (example with memory adapter)
|
||||
|
||||
2
client/cache/cache.go
vendored
2
client/cache/cache.go
vendored
@@ -16,7 +16,7 @@
|
||||
// Usage:
|
||||
//
|
||||
// import(
|
||||
// "github.com/beego/beego/cache"
|
||||
// "github.com/beego/beego/v2/cache"
|
||||
// )
|
||||
//
|
||||
// bm, err := cache.NewCache("memory", `{"interval":60}`)
|
||||
|
||||
6
client/cache/memcache/memcache.go
vendored
6
client/cache/memcache/memcache.go
vendored
@@ -20,8 +20,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/beego/beego/cache/memcache"
|
||||
// "github.com/beego/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"}`)
|
||||
@@ -39,7 +39,7 @@ import (
|
||||
|
||||
"github.com/bradfitz/gomemcache/memcache"
|
||||
|
||||
"github.com/beego/beego/client/cache"
|
||||
"github.com/beego/beego/v2/client/cache"
|
||||
)
|
||||
|
||||
// Cache Memcache adapter.
|
||||
|
||||
2
client/cache/memcache/memcache_test.go
vendored
2
client/cache/memcache/memcache_test.go
vendored
@@ -24,7 +24,7 @@ import (
|
||||
|
||||
_ "github.com/bradfitz/gomemcache/memcache"
|
||||
|
||||
"github.com/beego/beego/client/cache"
|
||||
"github.com/beego/beego/v2/client/cache"
|
||||
)
|
||||
|
||||
func TestMemcacheCache(t *testing.T) {
|
||||
|
||||
6
client/cache/redis/redis.go
vendored
6
client/cache/redis/redis.go
vendored
@@ -20,8 +20,8 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/beego/beego/cache/redis"
|
||||
// "github.com/beego/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"}`)
|
||||
@@ -40,7 +40,7 @@ import (
|
||||
|
||||
"github.com/gomodule/redigo/redis"
|
||||
|
||||
"github.com/beego/beego/client/cache"
|
||||
"github.com/beego/beego/v2/client/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
2
client/cache/redis/redis_test.go
vendored
2
client/cache/redis/redis_test.go
vendored
@@ -24,7 +24,7 @@ import (
|
||||
"github.com/gomodule/redigo/redis"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/client/cache"
|
||||
"github.com/beego/beego/v2/client/cache"
|
||||
)
|
||||
|
||||
func TestRedisCache(t *testing.T) {
|
||||
|
||||
2
client/cache/ssdb/ssdb.go
vendored
2
client/cache/ssdb/ssdb.go
vendored
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
"github.com/ssdb/gossdb/ssdb"
|
||||
|
||||
"github.com/beego/beego/client/cache"
|
||||
"github.com/beego/beego/v2/client/cache"
|
||||
)
|
||||
|
||||
// Cache SSDB adapter
|
||||
|
||||
2
client/cache/ssdb/ssdb_test.go
vendored
2
client/cache/ssdb/ssdb_test.go
vendored
@@ -8,7 +8,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/client/cache"
|
||||
"github.com/beego/beego/v2/client/cache"
|
||||
)
|
||||
|
||||
func TestSsdbcacheCache(t *testing.T) {
|
||||
|
||||
@@ -6,7 +6,7 @@ httplib is an libs help you to curl remote url.
|
||||
## GET
|
||||
you can use Get to crawl data.
|
||||
|
||||
import "github.com/beego/beego/httplib"
|
||||
import "github.com/beego/beego/v2/httplib"
|
||||
|
||||
str, err := httplib.Get("http://beego.me/").String()
|
||||
if err != nil {
|
||||
@@ -94,4 +94,4 @@ httplib support mutil file upload, use `req.PostFile()`
|
||||
|
||||
See godoc for further documentation and examples.
|
||||
|
||||
* [godoc.org/github.com/beego/beego/httplib](https://godoc.org/github.com/beego/beego/httplib)
|
||||
* [godoc.org/github.com/beego/beego/v2/httplib](https://godoc.org/github.com/beego/beego/v2/httplib)
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/beego/beego/client/httplib"
|
||||
"github.com/beego/beego/v2/client/httplib"
|
||||
logKit "github.com/go-kit/kit/log"
|
||||
opentracingKit "github.com/go-kit/kit/tracing/opentracing"
|
||||
"github.com/opentracing/opentracing-go"
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/client/httplib"
|
||||
"github.com/beego/beego/v2/client/httplib"
|
||||
)
|
||||
|
||||
func TestFilterChainBuilder_FilterChain(t *testing.T) {
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
|
||||
"github.com/beego/beego/client/httplib"
|
||||
"github.com/beego/beego/v2/client/httplib"
|
||||
)
|
||||
|
||||
type FilterChainBuilder struct {
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/client/httplib"
|
||||
"github.com/beego/beego/v2/client/httplib"
|
||||
)
|
||||
|
||||
func TestFilterChainBuilder_FilterChain(t *testing.T) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// Package httplib is used as http.Client
|
||||
// Usage:
|
||||
//
|
||||
// import "github.com/beego/beego/httplib"
|
||||
// import "github.com/beego/beego/v2/httplib"
|
||||
//
|
||||
// b := httplib.Post("http://beego.me/")
|
||||
// b.Param("username","astaxie")
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/client/httplib"
|
||||
"github.com/beego/beego/v2/client/httplib"
|
||||
)
|
||||
|
||||
var port = ""
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# beego orm
|
||||
|
||||
[](https://drone.io/github.com/beego/beego/latest)
|
||||
[](https://drone.io/github.com/beego/beego/v2/latest)
|
||||
|
||||
A powerful orm framework for go.
|
||||
|
||||
@@ -27,7 +27,7 @@ more features please read the docs
|
||||
|
||||
**Install:**
|
||||
|
||||
go get github.com/beego/beego/orm
|
||||
go get github.com/beego/beego/v2/orm
|
||||
|
||||
## Changelog
|
||||
|
||||
@@ -45,7 +45,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/beego/beego/orm"
|
||||
"github.com/beego/beego/v2/orm"
|
||||
_ "github.com/go-sql-driver/mysql" // import your used driver
|
||||
)
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/client/orm/hints"
|
||||
"github.com/beego/beego/v2/client/orm/hints"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/beego/beego/client/orm/hints"
|
||||
"github.com/beego/beego/v2/client/orm/hints"
|
||||
)
|
||||
|
||||
// oracle operators.
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/client/orm/hints"
|
||||
"github.com/beego/beego/v2/client/orm/hints"
|
||||
)
|
||||
|
||||
// sqlite operators.
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"context"
|
||||
"database/sql"
|
||||
|
||||
"github.com/beego/beego/core/utils"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
)
|
||||
|
||||
// DoNothingOrm won't do anything, usually you use this to custom your mock Ormer implementation
|
||||
|
||||
@@ -19,10 +19,10 @@ import (
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/beego/beego/core/logs"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
|
||||
"github.com/beego/beego/client/orm"
|
||||
"github.com/beego/beego/core/bean"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/bean"
|
||||
)
|
||||
|
||||
// DefaultValueFilterChainBuilder only works for InsertXXX method,
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
func TestDefaultValueFilterChainBuilder_FilterChain(t *testing.T) {
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
|
||||
"github.com/opentracing/opentracing-go"
|
||||
|
||||
"github.com/beego/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// FilterChainBuilder provides an extension point
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
"github.com/opentracing/opentracing-go"
|
||||
|
||||
"github.com/beego/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
func TestFilterChainBuilder_FilterChain(t *testing.T) {
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
|
||||
"github.com/beego/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// FilterChainBuilder is an extension point,
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/client/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
func TestFilterChainBuilder_FilterChain1(t *testing.T) {
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/core/utils"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/beego/beego/core/utils"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package hints
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/core/utils"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -17,7 +17,7 @@ package migration
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/beego/beego/core/logs"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
)
|
||||
|
||||
// Index struct defines the structure of Index Columns
|
||||
|
||||
@@ -33,8 +33,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/client/orm"
|
||||
"github.com/beego/beego/core/logs"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
)
|
||||
|
||||
// const the data format for the bee generate migration datatype
|
||||
|
||||
@@ -194,7 +194,7 @@ checkType:
|
||||
}
|
||||
fieldType = f.FieldType()
|
||||
if fieldType&IsRelField > 0 {
|
||||
err = fmt.Errorf("unsupport type custom field, please refer to https://github.com/beego/beego/blob/master/orm/models_fields.go#L24-L42")
|
||||
err = fmt.Errorf("unsupport type custom field, please refer to https://github.com/beego/beego/v2/blob/master/orm/models_fields.go#L24-L42")
|
||||
goto end
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -318,7 +318,7 @@ type Post struct {
|
||||
Created time.Time `orm:"auto_now_add"`
|
||||
Updated time.Time `orm:"auto_now"`
|
||||
UpdatedPrecision time.Time `orm:"auto_now;type(datetime);precision(4)"`
|
||||
Tags []*Tag `orm:"rel(m2m);rel_through(github.com/beego/beego/client/orm.PostTags)"`
|
||||
Tags []*Tag `orm:"rel(m2m);rel_through(github.com/beego/beego/v2/client/orm.PostTags)"`
|
||||
}
|
||||
|
||||
func (u *Post) TableIndex() [][]string {
|
||||
@@ -376,7 +376,7 @@ type Group struct {
|
||||
type Permission struct {
|
||||
ID int `orm:"column(id)"`
|
||||
Name string
|
||||
Groups []*Group `orm:"rel(m2m);rel_through(github.com/beego/beego/client/orm.GroupPermissions)"`
|
||||
Groups []*Group `orm:"rel(m2m);rel_through(github.com/beego/beego/v2/client/orm.GroupPermissions)"`
|
||||
}
|
||||
|
||||
type GroupPermissions struct {
|
||||
@@ -485,7 +485,7 @@ var (
|
||||
|
||||
usage:
|
||||
|
||||
go get -u github.com/beego/beego/client/orm
|
||||
go get -u github.com/beego/beego/v2/client/orm
|
||||
go get -u github.com/go-sql-driver/mysql
|
||||
go get -u github.com/mattn/go-sqlite3
|
||||
go get -u github.com/lib/pq
|
||||
@@ -495,25 +495,25 @@ var (
|
||||
mysql -u root -e 'create database orm_test;'
|
||||
export ORM_DRIVER=mysql
|
||||
export ORM_SOURCE="root:@/orm_test?charset=utf8"
|
||||
go test -v github.com/beego/beego/client/orm
|
||||
go test -v github.com/beego/beego/v2/client/orm
|
||||
|
||||
|
||||
#### Sqlite3
|
||||
export ORM_DRIVER=sqlite3
|
||||
export ORM_SOURCE='file:memory_test?mode=memory'
|
||||
go test -v github.com/beego/beego/client/orm
|
||||
go test -v github.com/beego/beego/v2/client/orm
|
||||
|
||||
|
||||
#### PostgreSQL
|
||||
psql -c 'create database orm_test;' -U postgres
|
||||
export ORM_DRIVER=postgres
|
||||
export ORM_SOURCE="user=postgres dbname=orm_test sslmode=disable"
|
||||
go test -v github.com/beego/beego/client/orm
|
||||
go test -v github.com/beego/beego/v2/client/orm
|
||||
|
||||
#### TiDB
|
||||
export ORM_DRIVER=tidb
|
||||
export ORM_SOURCE='memory://test/test'
|
||||
go test -v github.com/beego/beego/pgk/orm
|
||||
go test -v github.com/beego/beego/v2/pgk/orm
|
||||
|
||||
`
|
||||
)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
//
|
||||
// import (
|
||||
// "fmt"
|
||||
// "github.com/beego/beego/client/orm"
|
||||
// "github.com/beego/beego/v2/client/orm"
|
||||
// _ "github.com/go-sql-driver/mysql" // import your used driver
|
||||
// )
|
||||
//
|
||||
@@ -62,10 +62,10 @@ import (
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/client/orm/hints"
|
||||
"github.com/beego/beego/core/utils"
|
||||
"github.com/beego/beego/v2/client/orm/hints"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
|
||||
"github.com/beego/beego/core/logs"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
)
|
||||
|
||||
// DebugQueries define the debug
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/beego/beego/client/orm/hints"
|
||||
"github.com/beego/beego/v2/client/orm/hints"
|
||||
)
|
||||
|
||||
type colValue struct {
|
||||
|
||||
@@ -31,7 +31,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/client/orm/hints"
|
||||
"github.com/beego/beego/v2/client/orm/hints"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/core/utils"
|
||||
"github.com/beego/beego/v2/core/utils"
|
||||
)
|
||||
|
||||
// TableNaming is usually used by model
|
||||
|
||||
Reference in New Issue
Block a user