rename to v2

This commit is contained in:
Ming Deng
2020-12-14 11:12:00 +08:00
parent a70f7fc920
commit 7bc6010604
241 changed files with 489 additions and 489 deletions

View File

@@ -26,7 +26,7 @@ import (
"strconv"
"time"
"github.com/beego/beego/core/utils"
"github.com/beego/beego/v2/core/utils"
)
var startTime = time.Now()

View File

@@ -22,7 +22,7 @@ import (
"github.com/pkg/errors"
"github.com/beego/beego/core/logs"
"github.com/beego/beego/v2/core/logs"
)
const DefaultValueTagKey = "default"

View File

@@ -14,7 +14,7 @@
// Package config is used to parse config.
// Usage:
// import "github.com/beego/beego/config"
// import "github.com/beego/beego/v2/config"
// Examples.
//
// cnf, err := config.NewConfig("ini", "config.conf")

View File

@@ -21,7 +21,7 @@ import (
"os"
"strings"
"github.com/beego/beego/core/utils"
"github.com/beego/beego/v2/core/utils"
)
var env *utils.BeeMap

View File

@@ -26,8 +26,8 @@ import (
"github.com/pkg/errors"
"google.golang.org/grpc"
"github.com/beego/beego/core/config"
"github.com/beego/beego/core/logs"
"github.com/beego/beego/v2/core/config"
"github.com/beego/beego/v2/core/logs"
)
type EtcdConfiger struct {

View File

@@ -20,7 +20,7 @@ var globalInstance Configer
// InitGlobalInstance will ini the global instance
// If you want to use specific implementation, don't forget to import it.
// e.g. _ import "github.com/beego/beego/core/config/etcd"
// e.g. _ import "github.com/beego/beego/v2/core/config/etcd"
// err := InitGlobalInstance("etcd", "someconfig")
func InitGlobalInstance(name string, cfg string) error {
var err error

View File

@@ -30,7 +30,7 @@ import (
"github.com/mitchellh/mapstructure"
"github.com/beego/beego/core/logs"
"github.com/beego/beego/v2/core/logs"
)
var (

View File

@@ -26,8 +26,8 @@ import (
"github.com/mitchellh/mapstructure"
"github.com/beego/beego/core/config"
"github.com/beego/beego/core/logs"
"github.com/beego/beego/v2/core/config"
"github.com/beego/beego/v2/core/logs"
)
// JSONConfig is a json config parser and implements Config interface.

View File

@@ -21,7 +21,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/beego/beego/core/config"
"github.com/beego/beego/v2/core/config"
)
func TestJsonStartsWithArray(t *testing.T) {

View File

@@ -21,7 +21,7 @@ import (
"github.com/pelletier/go-toml"
"github.com/beego/beego/core/config"
"github.com/beego/beego/v2/core/config"
)
const keySeparator = "."

View File

@@ -21,7 +21,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/beego/beego/core/config"
"github.com/beego/beego/v2/core/config"
)
func TestConfig_Parse(t *testing.T) {

View File

@@ -20,8 +20,8 @@
//
// Usage:
// import(
// _ "github.com/beego/beego/config/xml"
// "github.com/beego/beego/config"
// _ "github.com/beego/beego/v2/config/xml"
// "github.com/beego/beego/v2/config"
// )
//
// cnf, err := config.NewConfig("xml", "config.xml")
@@ -41,8 +41,8 @@ import (
"github.com/mitchellh/mapstructure"
"github.com/beego/beego/core/config"
"github.com/beego/beego/core/logs"
"github.com/beego/beego/v2/core/config"
"github.com/beego/beego/v2/core/logs"
"github.com/beego/x2j"
)

View File

@@ -21,7 +21,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/beego/beego/core/config"
"github.com/beego/beego/v2/core/config"
)
func TestXML(t *testing.T) {

View File

@@ -20,8 +20,8 @@
//
// Usage:
// import(
// _ "github.com/beego/beego/config/yaml"
// "github.com/beego/beego/config"
// _ "github.com/beego/beego/v2/config/yaml"
// "github.com/beego/beego/v2/config"
// )
//
// cnf, err := config.NewConfig("yaml", "config.yaml")
@@ -43,8 +43,8 @@ import (
"github.com/beego/goyaml2"
"gopkg.in/yaml.v2"
"github.com/beego/beego/core/config"
"github.com/beego/beego/core/logs"
"github.com/beego/beego/v2/core/config"
"github.com/beego/beego/v2/core/logs"
)
// Config is a yaml config parser and implements Config interface.

View File

@@ -21,7 +21,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/beego/beego/core/config"
"github.com/beego/beego/v2/core/config"
)
func TestYaml(t *testing.T) {

View File

@@ -4,7 +4,7 @@ logs is a Go logs manager. It can use many logs adapters. The repo is inspired b
## How to install?
go get github.com/beego/beego/logs
go get github.com/beego/beego/v2/logs
## What adapters are supported?
@@ -18,7 +18,7 @@ First you must import it
```golang
import (
"github.com/beego/beego/logs"
"github.com/beego/beego/v2/logs"
)
```

View File

@@ -9,7 +9,7 @@ import (
"github.com/gogo/protobuf/proto"
"github.com/pkg/errors"
"github.com/beego/beego/core/logs"
"github.com/beego/beego/v2/core/logs"
)
const (

View File

@@ -12,7 +12,7 @@ import (
"github.com/elastic/go-elasticsearch/v6"
"github.com/elastic/go-elasticsearch/v6/esapi"
"github.com/beego/beego/core/logs"
"github.com/beego/beego/v2/core/logs"
)
// NewES returns a LoggerInterface
@@ -29,7 +29,7 @@ func NewES() logs.Logger {
// please import this package
// usually means that you can import this package in your main package
// for example, anonymous:
// import _ "github.com/beego/beego/logs/es"
// import _ "github.com/beego/beego/v2/logs/es"
type esLogger struct {
*elasticsearch.Client
DSN string `json:"dsn"`

View File

@@ -17,7 +17,7 @@ package es
import (
"fmt"
"github.com/beego/beego/core/logs"
"github.com/beego/beego/v2/core/logs"
)
// IndexNaming generate the index name

View File

@@ -20,7 +20,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/beego/beego/core/logs"
"github.com/beego/beego/v2/core/logs"
)
func TestDefaultIndexNaming_IndexName(t *testing.T) {

View File

@@ -15,7 +15,7 @@
// Package logs provide a general log interface
// Usage:
//
// import "github.com/beego/beego/logs"
// import "github.com/beego/beego/v2/logs"
//
// log := NewLogger(10000)
// log.SetLogger("console", "")

View File

@@ -8,7 +8,7 @@ In your beego.Controller:
package controllers
import "github.com/beego/beego/core/utils/pagination"
import "github.com/beego/beego/v2/core/utils/pagination"
type PostsController struct {
beego.Controller

View File

@@ -7,18 +7,18 @@ validation is a form validation for a data validation and error collecting using
Install:
go get github.com/beego/beego/validation
go get github.com/beego/beego/v2/validation
Test:
go test github.com/beego/beego/validation
go test github.com/beego/beego/v2/validation
## Example
Direct Use:
import (
"github.com/beego/beego/validation"
"github.com/beego/beego/v2/validation"
"log"
)
@@ -49,7 +49,7 @@ Direct Use:
Struct Tag Use:
import (
"github.com/beego/beego/validation"
"github.com/beego/beego/v2/validation"
)
// validation function follow with "valid" tag
@@ -81,7 +81,7 @@ Struct Tag Use:
Use custom function:
import (
"github.com/beego/beego/validation"
"github.com/beego/beego/v2/validation"
)
type user struct {

View File

@@ -15,7 +15,7 @@
// Package validation for validations
//
// import (
// "github.com/beego/beego/validation"
// "github.com/beego/beego/v2/validation"
// "log"
// )
//

View File

@@ -23,7 +23,7 @@ import (
"time"
"unicode/utf8"
"github.com/beego/beego/core/logs"
"github.com/beego/beego/v2/core/logs"
)
// CanSkipFuncs will skip valid if RequiredFirst is true and the struct field's value is empty