update package reference

This commit is contained in:
kevin
2020-08-08 16:40:10 +08:00
parent d19d25c72f
commit 0a7e0cce77
377 changed files with 881 additions and 1423 deletions

View File

@@ -1,5 +1,5 @@
package cache
import "zero/core/stores/internal"
import "github.com/tal-tech/go-zero/core/stores/internal"
type CacheConf = internal.ClusterConf

View File

@@ -3,7 +3,7 @@ package cache
import (
"time"
"zero/core/stores/internal"
"github.com/tal-tech/go-zero/core/stores/internal"
)
type Option = internal.Option

View File

@@ -1,9 +1,8 @@
package clickhouse
import (
"zero/core/stores/sqlx"
_ "github.com/kshvakov/clickhouse"
"github.com/tal-tech/go-zero/core/stores/sqlx"
)
const clickHouseDriverName = "clickhouse"

View File

@@ -5,9 +5,9 @@ import (
"log"
"time"
"zero/core/errorx"
"zero/core/hash"
"zero/core/syncx"
"github.com/tal-tech/go-zero/core/errorx"
"github.com/tal-tech/go-zero/core/hash"
"github.com/tal-tech/go-zero/core/syncx"
)
type (

View File

@@ -8,13 +8,12 @@ import (
"testing"
"time"
"zero/core/errorx"
"zero/core/hash"
"zero/core/stores/redis"
"zero/core/syncx"
"github.com/alicebob/miniredis"
"github.com/stretchr/testify/assert"
"github.com/tal-tech/go-zero/core/errorx"
"github.com/tal-tech/go-zero/core/hash"
"github.com/tal-tech/go-zero/core/stores/redis"
"github.com/tal-tech/go-zero/core/syncx"
)
type mockedNode struct {

View File

@@ -8,11 +8,11 @@ import (
"sync"
"time"
"zero/core/logx"
"zero/core/mathx"
"zero/core/stat"
"zero/core/stores/redis"
"zero/core/syncx"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/core/mathx"
"github.com/tal-tech/go-zero/core/stat"
"github.com/tal-tech/go-zero/core/stores/redis"
"github.com/tal-tech/go-zero/core/syncx"
)
const (

View File

@@ -7,13 +7,12 @@ import (
"testing"
"time"
"zero/core/logx"
"zero/core/mathx"
"zero/core/stat"
"zero/core/stores/redis"
"github.com/alicebob/miniredis"
"github.com/stretchr/testify/assert"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/core/mathx"
"github.com/tal-tech/go-zero/core/stat"
"github.com/tal-tech/go-zero/core/stores/redis"
)
func init() {

View File

@@ -4,7 +4,7 @@ import (
"sync/atomic"
"time"
"zero/core/logx"
"github.com/tal-tech/go-zero/core/logx"
)
const statInterval = time.Minute

View File

@@ -4,13 +4,13 @@ import (
"fmt"
"time"
"zero/core/collection"
"zero/core/lang"
"zero/core/logx"
"zero/core/proc"
"zero/core/stat"
"zero/core/stringx"
"zero/core/threading"
"github.com/tal-tech/go-zero/core/collection"
"github.com/tal-tech/go-zero/core/lang"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/core/proc"
"github.com/tal-tech/go-zero/core/stat"
"github.com/tal-tech/go-zero/core/stringx"
"github.com/tal-tech/go-zero/core/threading"
)
const (

View File

@@ -1,6 +1,6 @@
package internal
import "zero/core/stores/redis"
import "github.com/tal-tech/go-zero/core/stores/redis"
type (
ClusterConf []NodeConf

View File

@@ -1,5 +1,5 @@
package kv
import "zero/core/stores/internal"
import "github.com/tal-tech/go-zero/core/stores/internal"
type KvConf = internal.ClusterConf

View File

@@ -4,10 +4,10 @@ import (
"errors"
"log"
"zero/core/errorx"
"zero/core/hash"
"zero/core/stores/internal"
"zero/core/stores/redis"
"github.com/tal-tech/go-zero/core/errorx"
"github.com/tal-tech/go-zero/core/hash"
"github.com/tal-tech/go-zero/core/stores/internal"
"github.com/tal-tech/go-zero/core/stores/redis"
)
var ErrNoRedisNode = errors.New("no redis node")

View File

@@ -4,12 +4,11 @@ import (
"testing"
"time"
"zero/core/stores/internal"
"zero/core/stores/redis"
"zero/core/stringx"
"github.com/alicebob/miniredis"
"github.com/stretchr/testify/assert"
"github.com/tal-tech/go-zero/core/stores/internal"
"github.com/tal-tech/go-zero/core/stores/redis"
"github.com/tal-tech/go-zero/core/stringx"
)
var s1, _ = miniredis.Run()

View File

@@ -3,10 +3,9 @@ package mongo
import (
"time"
"zero/core/executors"
"zero/core/logx"
"github.com/globalsign/mgo"
"github.com/tal-tech/go-zero/core/executors"
"github.com/tal-tech/go-zero/core/logx"
)
const (

View File

@@ -4,11 +4,10 @@ import (
"encoding/json"
"time"
"zero/core/breaker"
"zero/core/logx"
"zero/core/timex"
"github.com/globalsign/mgo"
"github.com/tal-tech/go-zero/core/breaker"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/core/timex"
)
const slowThreshold = time.Millisecond * 500

View File

@@ -6,8 +6,7 @@ import (
"github.com/globalsign/mgo"
"github.com/stretchr/testify/assert"
"zero/core/stringx"
"github.com/tal-tech/go-zero/core/stringx"
)
func TestKeepPromise_accept(t *testing.T) {

View File

@@ -2,9 +2,8 @@
package mongo
import (
"zero/core/breaker"
"github.com/globalsign/mgo/bson"
"github.com/tal-tech/go-zero/core/breaker"
)
type (

View File

@@ -4,13 +4,12 @@ import (
"errors"
"testing"
"zero/core/breaker"
"zero/core/stringx"
"zero/core/syncx"
"github.com/globalsign/mgo"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/tal-tech/go-zero/core/breaker"
"github.com/tal-tech/go-zero/core/stringx"
"github.com/tal-tech/go-zero/core/syncx"
)
func TestClosableIter_Close(t *testing.T) {

View File

@@ -3,9 +3,8 @@ package mongo
import (
"time"
"zero/core/breaker"
"github.com/globalsign/mgo"
"github.com/tal-tech/go-zero/core/breaker"
)
type (

View File

@@ -3,9 +3,8 @@ package mongo
import (
"testing"
"zero/core/breaker"
"github.com/stretchr/testify/assert"
"github.com/tal-tech/go-zero/core/breaker"
)
func TestRejectedPipe_All(t *testing.T) {

View File

@@ -3,9 +3,8 @@ package mongo
import (
"time"
"zero/core/breaker"
"github.com/globalsign/mgo"
"github.com/tal-tech/go-zero/core/breaker"
)
type (

View File

@@ -3,10 +3,9 @@ package mongo
import (
"testing"
"zero/core/breaker"
"github.com/globalsign/mgo"
"github.com/stretchr/testify/assert"
"github.com/tal-tech/go-zero/core/breaker"
)
func Test_rejectedQuery_All(t *testing.T) {

View File

@@ -4,10 +4,9 @@ import (
"io"
"time"
"zero/core/logx"
"zero/core/syncx"
"github.com/globalsign/mgo"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/core/syncx"
)
const (

View File

@@ -1,11 +1,10 @@
package mongoc
import (
"zero/core/stores/internal"
"zero/core/stores/mongo"
"zero/core/syncx"
"github.com/globalsign/mgo"
"github.com/tal-tech/go-zero/core/stores/internal"
"github.com/tal-tech/go-zero/core/stores/mongo"
"github.com/tal-tech/go-zero/core/syncx"
)
var (

View File

@@ -11,15 +11,14 @@ import (
"testing"
"time"
"zero/core/stat"
"zero/core/stores/internal"
"zero/core/stores/mongo"
"zero/core/stores/redis"
"github.com/alicebob/miniredis"
"github.com/globalsign/mgo"
"github.com/globalsign/mgo/bson"
"github.com/stretchr/testify/assert"
"github.com/tal-tech/go-zero/core/stat"
"github.com/tal-tech/go-zero/core/stores/internal"
"github.com/tal-tech/go-zero/core/stores/mongo"
"github.com/tal-tech/go-zero/core/stores/redis"
)
func init() {

View File

@@ -3,12 +3,11 @@ package mongoc
import (
"log"
"zero/core/stores/cache"
"zero/core/stores/internal"
"zero/core/stores/mongo"
"zero/core/stores/redis"
"github.com/globalsign/mgo"
"github.com/tal-tech/go-zero/core/stores/cache"
"github.com/tal-tech/go-zero/core/stores/internal"
"github.com/tal-tech/go-zero/core/stores/mongo"
"github.com/tal-tech/go-zero/core/stores/redis"
)
type Model struct {

View File

@@ -1,9 +1,8 @@
package postgres
import (
"zero/core/stores/sqlx"
_ "github.com/lib/pq"
"github.com/tal-tech/go-zero/core/stores/sqlx"
)
const postgreDriverName = "postgres"

View File

@@ -3,11 +3,10 @@ package redis
import (
"strings"
"zero/core/logx"
"zero/core/mapping"
"zero/core/timex"
red "github.com/go-redis/redis"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/core/mapping"
"github.com/tal-tech/go-zero/core/timex"
)
func process(proc func(red.Cmder) error) func(red.Cmder) error {

View File

@@ -6,10 +6,9 @@ import (
"strconv"
"time"
"zero/core/breaker"
"zero/core/mapping"
red "github.com/go-redis/redis"
"github.com/tal-tech/go-zero/core/breaker"
"github.com/tal-tech/go-zero/core/mapping"
)
const (

View File

@@ -3,9 +3,8 @@ package redis
import (
"fmt"
"zero/core/logx"
red "github.com/go-redis/redis"
"github.com/tal-tech/go-zero/core/logx"
)
type ClosableNode interface {

View File

@@ -3,9 +3,8 @@ package redis
import (
"io"
"zero/core/syncx"
red "github.com/go-redis/redis"
"github.com/tal-tech/go-zero/core/syncx"
)
const (

View File

@@ -3,9 +3,8 @@ package redis
import (
"io"
"zero/core/syncx"
red "github.com/go-redis/redis"
"github.com/tal-tech/go-zero/core/syncx"
)
var clusterManager = syncx.NewResourceManager()

View File

@@ -6,9 +6,8 @@ import (
"sync/atomic"
"time"
"zero/core/logx"
red "github.com/go-redis/redis"
"github.com/tal-tech/go-zero/core/logx"
)
const (

View File

@@ -3,9 +3,8 @@ package redis
import (
"testing"
"zero/core/stringx"
"github.com/stretchr/testify/assert"
"github.com/tal-tech/go-zero/core/stringx"
)
func TestRedisLock(t *testing.T) {

View File

@@ -4,11 +4,11 @@ import (
"database/sql"
"time"
"zero/core/stores/cache"
"zero/core/stores/internal"
"zero/core/stores/redis"
"zero/core/stores/sqlx"
"zero/core/syncx"
"github.com/tal-tech/go-zero/core/stores/cache"
"github.com/tal-tech/go-zero/core/stores/internal"
"github.com/tal-tech/go-zero/core/stores/redis"
"github.com/tal-tech/go-zero/core/stores/sqlx"
"github.com/tal-tech/go-zero/core/syncx"
)
// see doc/sql-cache.md

View File

@@ -14,14 +14,13 @@ import (
"testing"
"time"
"zero/core/logx"
"zero/core/stat"
"zero/core/stores/cache"
"zero/core/stores/redis"
"zero/core/stores/sqlx"
"github.com/alicebob/miniredis"
"github.com/stretchr/testify/assert"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/core/stat"
"github.com/tal-tech/go-zero/core/stores/cache"
"github.com/tal-tech/go-zero/core/stores/redis"
"github.com/tal-tech/go-zero/core/stores/sqlx"
)
func init() {

View File

@@ -6,9 +6,9 @@ import (
"strings"
"time"
"zero/core/executors"
"zero/core/logx"
"zero/core/stringx"
"github.com/tal-tech/go-zero/core/executors"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/core/stringx"
)
const (

View File

@@ -5,10 +5,9 @@ import (
"strconv"
"testing"
"zero/core/logx"
"github.com/DATA-DOG/go-sqlmock"
"github.com/stretchr/testify/assert"
"github.com/tal-tech/go-zero/core/logx"
)
type mockedConn struct {

View File

@@ -3,12 +3,11 @@ package sqlx
import (
"testing"
"zero/core/breaker"
"zero/core/logx"
"zero/core/stat"
"github.com/go-sql-driver/mysql"
"github.com/stretchr/testify/assert"
"github.com/tal-tech/go-zero/core/breaker"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/core/stat"
)
func init() {

View File

@@ -5,7 +5,7 @@ import (
"reflect"
"strings"
"zero/core/mapping"
"github.com/tal-tech/go-zero/core/mapping"
)
const tagName = "db"

View File

@@ -4,10 +4,9 @@ import (
"database/sql"
"testing"
"zero/core/logx"
"github.com/DATA-DOG/go-sqlmock"
"github.com/stretchr/testify/assert"
"github.com/tal-tech/go-zero/core/logx"
)
func TestUnmarshalRowBool(t *testing.T) {

View File

@@ -3,7 +3,7 @@ package sqlx
import (
"database/sql"
"zero/core/breaker"
"github.com/tal-tech/go-zero/core/breaker"
)
var ErrNotFound = sql.ErrNoRows

View File

@@ -6,7 +6,7 @@ import (
"sync"
"time"
"zero/core/syncx"
"github.com/tal-tech/go-zero/core/syncx"
)
const (

View File

@@ -5,8 +5,8 @@ import (
"fmt"
"time"
"zero/core/logx"
"zero/core/timex"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/core/timex"
)
const slowThreshold = time.Millisecond * 500

View File

@@ -4,8 +4,8 @@ import (
"fmt"
"strings"
"zero/core/logx"
"zero/core/mapping"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/core/mapping"
)
func desensitize(datasource string) string {