From 9e060edc2df5605e48588b39bb1b03c7af23df60 Mon Sep 17 00:00:00 2001 From: chenzhihui Date: Sat, 28 Mar 2020 18:02:25 +0800 Subject: [PATCH] replace pkg name to go-kratos --- README.md | 10 +++---- doc/wiki-cn/FAQ.md | 2 +- doc/wiki-cn/blademaster-mid.md | 2 +- doc/wiki-cn/blademaster-pb.md | 8 +++--- doc/wiki-cn/database-hbase.md | 2 +- doc/wiki-cn/ecode.md | 10 +++---- doc/wiki-cn/install.md | 2 +- doc/wiki-cn/kratos-protoc.md | 10 +++---- doc/wiki-cn/kratos-tool.md | 4 +-- doc/wiki-cn/quickstart.md | 4 +-- doc/wiki-cn/summary.md | 2 +- doc/wiki-cn/trace.md | 4 +-- doc/wiki-cn/ut-support.md | 2 +- doc/wiki-cn/ut-testcli.md | 14 +++++----- doc/wiki-cn/ut-testgen.md | 4 +-- doc/wiki-cn/warden-mid.md | 14 +++++----- doc/wiki-cn/warden-pb.md | 6 ++--- doc/wiki-cn/warden-quickstart.md | 8 +++--- doc/wiki-cn/warden-resolver.md | 12 ++++----- example/blademaster/middleware/auth/auth.go | 6 ++--- .../middleware/auth/example_test.go | 6 ++--- example/protobuf/api.bm.go | 4 +-- example/protobuf/api.ecode.go | 2 +- go.mod | 2 +- pkg/cache/memcache/conn_test.go | 2 +- pkg/cache/memcache/encoding_test.go | 2 +- pkg/cache/memcache/main_test.go | 4 +-- pkg/cache/memcache/memcache.go | 4 +-- pkg/cache/memcache/metrics.go | 2 +- pkg/cache/memcache/pool_conn.go | 2 +- pkg/cache/memcache/pool_conn_test.go | 4 +-- pkg/cache/memcache/trace_conn.go | 4 +-- pkg/cache/memcache/util_test.go | 2 +- pkg/cache/metrics.go | 2 +- pkg/cache/redis/main_test.go | 6 ++--- pkg/cache/redis/metrics.go | 2 +- pkg/cache/redis/pipeline_test.go | 4 +-- pkg/cache/redis/pool.go | 6 ++--- pkg/cache/redis/pool_test.go | 2 +- pkg/cache/redis/redis.go | 4 +-- pkg/cache/redis/redis_test.go | 4 +-- pkg/cache/redis/trace.go | 4 +-- pkg/cache/redis/trace_test.go | 2 +- pkg/conf/dsn/dsn_test.go | 2 +- pkg/conf/dsn/example_test.go | 4 +-- pkg/conf/dsn/query_test.go | 8 +++--- pkg/conf/paladin/apollo/apollo.go | 2 +- pkg/conf/paladin/apollo/apollo_test.go | 2 +- pkg/conf/paladin/example_test.go | 4 +-- pkg/conf/paladin/map_test.go | 2 +- pkg/conf/paladin/mock_test.go | 2 +- pkg/container/pool/list_test.go | 2 +- pkg/container/pool/pool.go | 2 +- pkg/container/pool/slice_test.go | 2 +- pkg/container/queue/aqm/codel.go | 2 +- pkg/container/queue/aqm/codel_test.go | 2 +- pkg/database/hbase/README.md | 2 +- pkg/database/hbase/config.go | 2 +- pkg/database/hbase/hbase.go | 2 +- pkg/database/hbase/metrics.go | 2 +- pkg/database/hbase/slowlog.go | 2 +- pkg/database/hbase/trace.go | 2 +- pkg/database/sql/metrics.go | 2 +- pkg/database/sql/mysql.go | 6 ++--- pkg/database/sql/sql.go | 8 +++--- pkg/database/tidb/discovery.go | 8 +++--- pkg/database/tidb/metrics.go | 2 +- pkg/database/tidb/node_proc.go | 2 +- pkg/database/tidb/sql.go | 8 +++--- pkg/database/tidb/tidb.go | 6 ++--- pkg/ecode/status.go | 2 +- pkg/ecode/status_test.go | 2 +- pkg/ecode/types/status.pb.go | 2 +- pkg/ecode/types/status.proto | 2 +- pkg/log/field.go | 2 +- pkg/log/file.go | 2 +- pkg/log/internal/core/field.go | 2 +- pkg/log/log.go | 4 +-- pkg/log/log_test.go | 2 +- pkg/log/util.go | 8 +++--- pkg/naming/discovery/discovery.go | 12 ++++----- pkg/naming/etcd/etcd.go | 4 +-- pkg/naming/etcd/etcd_test.go | 2 +- pkg/naming/opt.go | 4 +-- pkg/naming/zookeeper/zookeeper.go | 6 ++--- pkg/naming/zookeeper/zookeeper_test.go | 2 +- pkg/net/http/blademaster/client.go | 8 +++--- pkg/net/http/blademaster/context.go | 6 ++--- pkg/net/http/blademaster/cors.go | 2 +- pkg/net/http/blademaster/criticality.go | 4 +-- pkg/net/http/blademaster/csrf.go | 2 +- pkg/net/http/blademaster/logger.go | 6 ++--- pkg/net/http/blademaster/metadata.go | 8 +++--- pkg/net/http/blademaster/metrics.go | 2 +- pkg/net/http/blademaster/perf.go | 2 +- pkg/net/http/blademaster/ratelimit.go | 6 ++--- pkg/net/http/blademaster/recovery.go | 2 +- pkg/net/http/blademaster/server.go | 12 ++++----- pkg/net/http/blademaster/server_test.go | 6 ++--- pkg/net/http/blademaster/trace.go | 4 +-- pkg/net/netutil/breaker/breaker.go | 2 +- pkg/net/netutil/breaker/breaker_test.go | 2 +- pkg/net/netutil/breaker/example_test.go | 4 +-- pkg/net/netutil/breaker/sre_breaker.go | 6 ++--- pkg/net/netutil/breaker/sre_breaker_test.go | 4 +-- pkg/net/rpc/warden/balancer/p2c/p2c.go | 8 +++--- pkg/net/rpc/warden/balancer/p2c/p2c_test.go | 6 ++--- pkg/net/rpc/warden/balancer/wrr/wrr.go | 10 +++---- pkg/net/rpc/warden/balancer/wrr/wrr_test.go | 8 +++--- pkg/net/rpc/warden/client.go | 26 +++++++++---------- pkg/net/rpc/warden/exapmle_test.go | 10 +++---- .../internal/benchmark/bench/client/client.go | 8 +++--- .../internal/benchmark/bench/server/server.go | 6 ++--- .../helloworld/client/greeter_client.go | 8 +++--- .../helloworld/server/greeter_server.go | 6 ++--- .../warden/internal/examples/client/client.go | 6 ++--- .../warden/internal/examples/server/main.go | 10 +++---- pkg/net/rpc/warden/internal/status/status.go | 2 +- .../rpc/warden/internal/status/status_test.go | 2 +- pkg/net/rpc/warden/logging.go | 6 ++--- pkg/net/rpc/warden/logging_test.go | 2 +- pkg/net/rpc/warden/metrics.go | 2 +- pkg/net/rpc/warden/ratelimiter/ratelimiter.go | 8 +++--- pkg/net/rpc/warden/recovery.go | 4 +-- pkg/net/rpc/warden/resolver/direct/direct.go | 6 ++--- .../resolver/direct/test/direct_test.go | 12 ++++----- pkg/net/rpc/warden/resolver/resolver.go | 8 +++--- .../rpc/warden/resolver/test/mockdiscovery.go | 4 +-- .../rpc/warden/resolver/test/resovler_test.go | 14 +++++----- pkg/net/rpc/warden/server.go | 16 ++++++------ pkg/net/rpc/warden/server_test.go | 14 +++++----- pkg/net/rpc/warden/stats.go | 4 +-- pkg/net/rpc/warden/validate.go | 2 +- pkg/net/trace/config.go | 6 ++--- pkg/net/trace/marshal.go | 2 +- pkg/net/trace/mocktrace/mocktrace.go | 2 +- pkg/net/trace/span.go | 2 +- pkg/net/trace/util.go | 4 +-- pkg/net/trace/zipkin/config.go | 6 ++--- pkg/net/trace/zipkin/zipkin.go | 4 +-- pkg/net/trace/zipkin/zipkin_test.go | 4 +-- pkg/ratelimit/bbr/bbr.go | 12 ++++----- pkg/ratelimit/bbr/bbr_test.go | 4 +-- pkg/sync/pipeline/fanout/fanout.go | 6 ++--- pkg/sync/pipeline/fanout/metrics.go | 2 +- pkg/sync/pipeline/pipeline.go | 6 ++--- pkg/sync/pipeline/pipeline_test.go | 4 +-- pkg/testing/lich/README.md | 2 +- pkg/testing/lich/composer.go | 2 +- pkg/testing/lich/healthcheck.go | 2 +- tool/kratos-gen-bts/header_template.go | 4 +-- tool/kratos-gen-bts/main.go | 2 +- tool/kratos-gen-bts/testdata/dao.bts.go | 4 +-- tool/kratos-gen-bts/testdata/dao.go | 2 +- tool/kratos-gen-mc/header_template.go | 6 ++--- tool/kratos-gen-mc/main.go | 2 +- tool/kratos-gen-mc/testdata/dao.go | 6 ++--- tool/kratos-gen-mc/testdata/mc.cache.go | 4 +-- tool/kratos-gen-project/main-packr.go | 2 +- tool/kratos-gen-project/new.go | 2 +- .../templates/all/api/client.go.tmpl | 2 +- .../templates/all/cmd/main.go.tmpl | 4 +-- .../templates/all/go.mod.tmpl | 2 +- .../templates/all/internal/dao/dao.go.tmpl | 12 ++++----- .../all/internal/dao/dao_test.go.tmpl | 4 +-- .../templates/all/internal/dao/db.go.tmpl | 4 +-- .../templates/all/internal/dao/mc.go.tmpl | 6 ++--- .../templates/all/internal/dao/redis.go.tmpl | 6 ++--- .../templates/all/internal/di/app.go.tmpl | 6 ++--- .../all/internal/server/grpc/server.go.tmpl | 4 +-- .../all/internal/server/http/server.go.tmpl | 6 ++--- .../all/internal/service/service.go.tmpl | 2 +- .../templates/grpc/api/client.go.tmpl | 2 +- .../templates/grpc/cmd/main.go.tmpl | 4 +-- .../templates/grpc/go.mod.tmpl | 2 +- .../templates/grpc/internal/dao/dao.go.tmpl | 12 ++++----- .../grpc/internal/dao/dao_test.go.tmpl | 4 +-- .../templates/grpc/internal/dao/db.go.tmpl | 4 +-- .../templates/grpc/internal/dao/mc.go.tmpl | 6 ++--- .../templates/grpc/internal/dao/redis.go.tmpl | 6 ++--- .../templates/grpc/internal/di/app.go.tmpl | 4 +-- .../grpc/internal/server/grpc/server.go.tmpl | 4 +-- .../grpc/internal/service/service.go.tmpl | 2 +- .../templates/http/api/client.go.tmpl | 2 +- .../templates/http/cmd/main.go.tmpl | 4 +-- .../templates/http/go.mod.tmpl | 2 +- .../templates/http/internal/dao/dao.go.tmpl | 12 ++++----- .../http/internal/dao/dao_test.go.tmpl | 4 +-- .../templates/http/internal/dao/db.go.tmpl | 4 +-- .../templates/http/internal/dao/mc.go.tmpl | 6 ++--- .../templates/http/internal/dao/redis.go.tmpl | 6 ++--- .../templates/http/internal/di/app.go.tmpl | 4 +-- .../http/internal/server/http/server.go.tmpl | 6 ++--- .../http/internal/service/service.go.tmpl | 2 +- tool/kratos-protoc/bm.go | 2 +- tool/kratos-protoc/ecode.go | 2 +- tool/kratos-protoc/protoc.go | 2 +- tool/kratos-protoc/swagger.go | 2 +- tool/kratos/README.MD | 2 +- tool/kratos/tool.go | 2 +- tool/kratos/tool_index.go | 14 +++++----- .../pkg/extensions/gogoproto/gogo.pb.go | 2 +- .../pkg/extensions/gogoproto/gogo.proto | 2 +- tool/protobuf/pkg/generator/generator.go | 12 ++++----- tool/protobuf/pkg/generator/helper.go | 6 ++--- tool/protobuf/pkg/generator/http.go | 4 +-- tool/protobuf/pkg/naming/naming.go | 2 +- tool/protobuf/pkg/project/project.go | 2 +- tool/protobuf/pkg/tag/ext_tags.go | 2 +- .../protoc-gen-bm/generator/generator.go | 14 +++++----- tool/protobuf/protoc-gen-bm/main.go | 6 ++--- .../protobuf/protoc-gen-bswagger/generator.go | 10 +++---- tool/protobuf/protoc-gen-bswagger/main.go | 4 +-- .../protoc-gen-ecode/generator/generator.go | 6 ++--- tool/protobuf/protoc-gen-ecode/main.go | 6 ++--- tool/testcli/README.MD | 14 +++++----- tool/testcli/main.go | 2 +- tool/testgen/README.md | 4 +-- 218 files changed, 522 insertions(+), 522 deletions(-) diff --git a/README.md b/README.md index e1670b436..a9070bac7 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ ![kratos](doc/img/kratos3.png) [![Language](https://img.shields.io/badge/Language-Go-blue.svg)](https://golang.org/) -[![Build Status](https://travis-ci.org/bilibili/kratos.svg?branch=master)](https://travis-ci.org/bilibili/kratos) -[![GoDoc](https://godoc.org/github.com/bilibili/kratos?status.svg)](https://godoc.org/github.com/bilibili/kratos) -[![Go Report Card](https://goreportcard.com/badge/github.com/bilibili/kratos)](https://goreportcard.com/report/github.com/bilibili/kratos) +[![Build Status](https://travis-ci.org/go-kratos/kratos.svg?branch=master)](https://travis-ci.org/go-kratos/kratos) +[![GoDoc](https://godoc.org/github.com/go-kratos/kratos?status.svg)](https://godoc.org/github.com/go-kratos/kratos) +[![Go Report Card](https://goreportcard.com/badge/github.com/go-kratos/kratos)](https://goreportcard.com/report/github.com/go-kratos/kratos) # Kratos @@ -33,12 +33,12 @@ Go version>=1.13 ### Installation ```shell -GO111MODULE=on && go get -u github.com/bilibili/kratos/tool/kratos +GO111MODULE=on && go get -u github.com/go-kratos/kratos/tool/kratos cd $GOPATH/src kratos new kratos-demo ``` -通过 `kratos new` 会快速生成基于kratos库的脚手架代码,如生成 [kratos-demo](https://github.com/bilibili/kratos-demo) +通过 `kratos new` 会快速生成基于kratos库的脚手架代码,如生成 [kratos-demo](https://github.com/go-kratos/kratos-demo) ### Build & Run diff --git a/doc/wiki-cn/FAQ.md b/doc/wiki-cn/FAQ.md index bdfca3499..768e19318 100644 --- a/doc/wiki-cn/FAQ.md +++ b/doc/wiki-cn/FAQ.md @@ -2,7 +2,7 @@ 执行 ```shell -go get -u github.com/bilibili/kratos/tool/kratos +go get -u github.com/go-kratos/kratos/tool/kratos ``` 出现以下错误时 ```shell diff --git a/doc/wiki-cn/blademaster-mid.md b/doc/wiki-cn/blademaster-mid.md index 0c2d8257e..204b6b878 100644 --- a/doc/wiki-cn/blademaster-mid.md +++ b/doc/wiki-cn/blademaster-mid.md @@ -76,7 +76,7 @@ engine.Use(YourMiddleware()) # 局部中间件 -先来看一段鉴权伪代码示例([auth示例代码位置](https://github.com/bilibili/kratos/tree/master/example/blademaster/middleware/auth)): +先来看一段鉴权伪代码示例([auth示例代码位置](https://github.com/go-kratos/kratos/tree/master/example/blademaster/middleware/auth)): ```go func Example() { diff --git a/doc/wiki-cn/blademaster-pb.md b/doc/wiki-cn/blademaster-pb.md index c9cbe683f..bf368b848 100644 --- a/doc/wiki-cn/blademaster-pb.md +++ b/doc/wiki-cn/blademaster-pb.md @@ -3,7 +3,7 @@ 基于proto文件可以快速生成`bm`框架对应的代码,提前需要准备以下工作: * 安装`kratos tool protoc`工具,请看[kratos工具](kratos-tool.md) -* 编写`proto`文件,示例可参考[kratos-demo内proto文件](https://github.com/bilibili/kratos-demo/blob/master/api/api.proto) +* 编写`proto`文件,示例可参考[kratos-demo内proto文件](https://github.com/go-kratos/kratos-demo/blob/master/api/api.proto) ### kratos工具说明 @@ -31,7 +31,7 @@ service Demo { # 使用 -建议在项目`api`目录下编写`proto`文件及生成对应的代码,可参考[kratos-demo内的api目录](https://github.com/bilibili/kratos-demo/tree/master/api)。 +建议在项目`api`目录下编写`proto`文件及生成对应的代码,可参考[kratos-demo内的api目录](https://github.com/go-kratos/kratos-demo/tree/master/api)。 执行命令后生成的`api.bm.go`代码,注意其中的`type DemoBMServer interface`和`RegisterDemoBMServer`,其中: @@ -39,7 +39,7 @@ service Demo { * `RegisterDemoBMServer`方法提供注册`DemoBMServer`接口的实现对象,和`bm`的`Engine`用于注册路由 * `DemoBMServer`接口的实现,一般为`internal/service`内的业务逻辑代码,需要实现`DemoBMServer`接口 -使用`RegisterDemoBMServer`示例代码请参考[kratos-demo内的http](https://github.com/bilibili/kratos-demo/blob/master/internal/server/http/server.go)内的如下代码: +使用`RegisterDemoBMServer`示例代码请参考[kratos-demo内的http](https://github.com/go-kratos/kratos-demo/blob/master/internal/server/http/server.go)内的如下代码: ```go engine = bm.DefaultServer(hc.Server) @@ -47,7 +47,7 @@ pb.RegisterDemoBMServer(engine, svc) initRouter(engine) ``` -`internal/service`内的`Service`结构实现了`DemoBMServer`接口可参考[kratos-demo内的service](https://github.com/bilibili/kratos-demo/blob/master/internal/service/service.go)内的如下代码: +`internal/service`内的`Service`结构实现了`DemoBMServer`接口可参考[kratos-demo内的service](https://github.com/go-kratos/kratos-demo/blob/master/internal/service/service.go)内的如下代码: ```go // SayHelloURL bm demo func. diff --git a/doc/wiki-cn/database-hbase.md b/doc/wiki-cn/database-hbase.md index ab9932951..854542b24 100644 --- a/doc/wiki-cn/database-hbase.md +++ b/doc/wiki-cn/database-hbase.md @@ -18,7 +18,7 @@ import ( "context" "fmt" - "github.com/bilibili/kratos/pkg/database/hbase" + "github.com/go-kratos/kratos/pkg/database/hbase" ) func main() { diff --git a/doc/wiki-cn/ecode.md b/doc/wiki-cn/ecode.md index d1cbf0817..10d8f0e8b 100644 --- a/doc/wiki-cn/ecode.md +++ b/doc/wiki-cn/ecode.md @@ -5,7 +5,7 @@ ## 错误码之Codes -在`kratos`里,错误码被设计成`Codes`接口,声明如下[代码位置](https://github.com/bilibili/kratos/blob/master/pkg/ecode/ecode.go): +在`kratos`里,错误码被设计成`Codes`接口,声明如下[代码位置](https://github.com/go-kratos/kratos/blob/master/pkg/ecode/ecode.go): ```go // Codes ecode error interface which has a code & message. @@ -47,9 +47,9 @@ fmt.Println(ecode.OK.Message()) // 输出:很好很强大! ### Details `Details`接口为`gRPC`预留,`gRPC`传递异常会将服务端的错误码pb序列化之后赋值给`Details`,客户端拿到之后反序列化得到,具体可阅读`status`的实现: -1. `ecode`包内的`Status`结构体实现了`Codes`接口[代码位置](https://github.com/bilibili/kratos/blob/master/pkg/ecode/status.go) -2. `warden/internal/status`包内包装了`ecode.Status`和`grpc.Status`进行互相转换的方法[代码位置](https://github.com/bilibili/kratos/blob/master/pkg/net/rpc/warden/internal/status/status.go) -3. `warden`的`client`和`server`则使用转换方法将`gRPC`底层返回的`error`最终转换为`ecode.Status` [代码位置](https://github.com/bilibili/kratos/blob/master/pkg/net/rpc/warden/client.go#L162) +1. `ecode`包内的`Status`结构体实现了`Codes`接口[代码位置](https://github.com/go-kratos/kratos/blob/master/pkg/ecode/status.go) +2. `warden/internal/status`包内包装了`ecode.Status`和`grpc.Status`进行互相转换的方法[代码位置](https://github.com/go-kratos/kratos/blob/master/pkg/net/rpc/warden/internal/status/status.go) +3. `warden`的`client`和`server`则使用转换方法将`gRPC`底层返回的`error`最终转换为`ecode.Status` [代码位置](https://github.com/go-kratos/kratos/blob/master/pkg/net/rpc/warden/client.go#L162) ## 转换为ecode @@ -90,7 +90,7 @@ enum UserErrCode { package ecode import ( - "github.com/bilibili/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/ecode" ) var _ ecode.Codes diff --git a/doc/wiki-cn/install.md b/doc/wiki-cn/install.md index 91b8c4655..9c9e8f873 100644 --- a/doc/wiki-cn/install.md +++ b/doc/wiki-cn/install.md @@ -47,7 +47,7 @@ go get google.golang.org/genproto/... 6.安装kratos tool ``` -go get -u github.com/bilibili/kratos/tool/kratos +go get -u github.com/go-kratos/kratos/tool/kratos cd $GOPATH/src kratos new kratos-demo --proto ``` diff --git a/doc/wiki-cn/kratos-protoc.md b/doc/wiki-cn/kratos-protoc.md index dd416d196..02fe0d79a 100644 --- a/doc/wiki-cn/kratos-protoc.md +++ b/doc/wiki-cn/kratos-protoc.md @@ -13,17 +13,17 @@ kratos tool protoc --ecode api.proto kratos tool protoc --swagger api.proto ``` -执行生成如 `api.pb.go/api.bm.go/api.swagger.json/api.ecode.go` 的对应文件,需要注意的是:`ecode`生成有固定规则,需要首先是`enum`类型,且`enum`名字要以`ErrCode`结尾,如`enum UserErrCode`。详情可见:[example](https://github.com/bilibili/kratos/tree/master/example/protobuf) +执行生成如 `api.pb.go/api.bm.go/api.swagger.json/api.ecode.go` 的对应文件,需要注意的是:`ecode`生成有固定规则,需要首先是`enum`类型,且`enum`名字要以`ErrCode`结尾,如`enum UserErrCode`。详情可见:[example](https://github.com/go-kratos/kratos/tree/master/example/protobuf) > 该工具在Windows/Linux下运行,需提前安装好 [protobuf](https://github.com/google/protobuf) 工具 `kratos tool protoc`本质上是拼接好了`protoc`命令然后进行执行,在执行时会打印出对应执行的`protoc`命令,如下可见: ```shell -protoc --proto_path=$GOPATH --proto_path=$GOPATH/github.com/bilibili/kratos/third_party --proto_path=. --bm_out=:. api.proto -protoc --proto_path=$GOPATH --proto_path=$GOPATH/github.com/bilibili/kratos/third_party --proto_path=. --gofast_out=plugins=grpc:. api.proto -protoc --proto_path=$GOPATH --proto_path=$GOPATH/github.com/bilibili/kratos/third_party --proto_path=. --bswagger_out=:. api.proto -protoc --proto_path=$GOPATH --proto_path=$GOPATH/github.com/bilibili/kratos/third_party --proto_path=. --ecode_out=:. api.proto +protoc --proto_path=$GOPATH --proto_path=$GOPATH/github.com/go-kratos/kratos/third_party --proto_path=. --bm_out=:. api.proto +protoc --proto_path=$GOPATH --proto_path=$GOPATH/github.com/go-kratos/kratos/third_party --proto_path=. --gofast_out=plugins=grpc:. api.proto +protoc --proto_path=$GOPATH --proto_path=$GOPATH/github.com/go-kratos/kratos/third_party --proto_path=. --bswagger_out=:. api.proto +protoc --proto_path=$GOPATH --proto_path=$GOPATH/github.com/go-kratos/kratos/third_party --proto_path=. --ecode_out=:. api.proto ``` ------------- diff --git a/doc/wiki-cn/kratos-tool.md b/doc/wiki-cn/kratos-tool.md index 312b36be4..e72028234 100644 --- a/doc/wiki-cn/kratos-tool.md +++ b/doc/wiki-cn/kratos-tool.md @@ -6,7 +6,7 @@ kratos包含了一批好用的工具集,比如项目一键生成、基于proto 执行以下命令,即可快速安装好`kratos`工具 ```shell -go get -u github.com/bilibili/kratos/tool/kratos +go get -u github.com/go-kratos/kratos/tool/kratos ``` 那么接下来让我们快速开始熟悉工具的用法~ @@ -93,7 +93,7 @@ swagger(已安装): swagger api文档 Author(goswagger.io) [2019/05/05] 安装全部工具: kratos tool install all 全部升级: kratos tool upgrade all -详细文档: https://github.com/bilibili/kratos/blob/master/doc/wiki-cn/kratos-tool.md +详细文档: https://github.com/go-kratos/kratos/blob/master/doc/wiki-cn/kratos-tool.md ``` > 小小说明:如未安装工具,第一次运行也可自动安装,不需要特别执行install diff --git a/doc/wiki-cn/quickstart.md b/doc/wiki-cn/quickstart.md index 3faed015e..e1da9a541 100644 --- a/doc/wiki-cn/quickstart.md +++ b/doc/wiki-cn/quickstart.md @@ -3,12 +3,12 @@ 快速使用kratos项目,可以使用`kratos`工具,如下: ```shell -go get -u github.com/bilibili/kratos/tool/kratos +go get -u github.com/go-kratos/kratos/tool/kratos cd $GOPATH/src kratos new kratos-demo ``` -根据提示可以快速创建项目,如[kratos-demo](https://github.com/bilibili/kratos-demo)就是通过工具创建生成。目录结构如下: +根据提示可以快速创建项目,如[kratos-demo](https://github.com/go-kratos/kratos-demo)就是通过工具创建生成。目录结构如下: ``` ├── CHANGELOG.md diff --git a/doc/wiki-cn/summary.md b/doc/wiki-cn/summary.md index 9bbb252c0..3986cd8ca 100644 --- a/doc/wiki-cn/summary.md +++ b/doc/wiki-cn/summary.md @@ -2,7 +2,7 @@ * [介绍](README.md) * [快速开始](quickstart.md) - * [案例](https://github.com/bilibili/kratos-demo) + * [案例](https://github.com/go-kratos/kratos-demo) * [http blademaster](blademaster.md) * [bm quickstart](blademaster-quickstart.md) * [bm module](blademaster-mod.md) diff --git a/doc/wiki-cn/trace.md b/doc/wiki-cn/trace.md index 6a0c5d555..f486e5843 100644 --- a/doc/wiki-cn/trace.md +++ b/doc/wiki-cn/trace.md @@ -19,14 +19,14 @@ kratos本身不提供整套`trace`数据方案,但在`net/trace/report.go`内 ### zipkin使用 -可以看[zipkin](https://github.com/bilibili/kratos/tree/master/pkg/net/trace/zipkin)的协议上报实现,具体使用方式如下: +可以看[zipkin](https://github.com/go-kratos/kratos/tree/master/pkg/net/trace/zipkin)的协议上报实现,具体使用方式如下: 1. 前提是需要有一套自己搭建的`zipkin`集群 2. 在业务代码的`main`函数内进行初始化,代码如下: ```go // 忽略其他代码 -import "github.com/bilibili/kratos/pkg/net/trace/zipkin" +import "github.com/go-kratos/kratos/pkg/net/trace/zipkin" // 忽略其他代码 func main(){ // 忽略其他代码 diff --git a/doc/wiki-cn/ut-support.md b/doc/wiki-cn/ut-support.md index b4b3dd707..48c0eff68 100644 --- a/doc/wiki-cn/ut-support.md +++ b/doc/wiki-cn/ut-support.md @@ -146,7 +146,7 @@ func TestUsers(t *testing.T) { ``` #### 使用建议 -强烈建议使用 [testgen](https://github.com/bilibili/kratos/blob/master/doc/wiki-cn/ut-testgen.md) 进行测试用例的生成,生成后每个方法将包含一个符合以下规范的正向用例。 +强烈建议使用 [testgen](https://github.com/go-kratos/kratos/blob/master/doc/wiki-cn/ut-testgen.md) 进行测试用例的生成,生成后每个方法将包含一个符合以下规范的正向用例。 用例规范: 1. 每个方法至少包含一个测试方法(命名为Test[PackageName][FunctionName]) diff --git a/doc/wiki-cn/ut-testcli.md b/doc/wiki-cn/ut-testcli.md index f17e3d281..7be62e3b9 100644 --- a/doc/wiki-cn/ut-testcli.md +++ b/doc/wiki-cn/ut-testcli.md @@ -1,7 +1,7 @@ ## testcli UT运行环境构建工具 基于 docker-compose 实现跨平台跨语言环境的容器依赖管理方案,以解决运行ut场景下的 (mysql, redis, mc)容器依赖问题。 -*这个是testing/lich的二进制工具版本(Go请直接使用库版本:github.com/bilibili/kratos/pkg/testing/lich)* +*这个是testing/lich的二进制工具版本(Go请直接使用库版本:github.com/go-kratos/kratos/pkg/testing/lich)* ### 功能和特性 - 自动读取 test 目录下的 yaml 并启动依赖 @@ -14,18 +14,18 @@ #### Method 1. With go get ```shell -go get -u github.com/bilibili/kratos/tool/testcli +go get -u github.com/go-kratos/kratos/tool/testcli $GOPATH/bin/testcli -h ``` #### Method 2. Build with Go ```shell -cd github.com/bilibili/kratos/tool/testcli +cd github.com/go-kratos/kratos/tool/testcli go build -o $GOPATH/bin/testcli $GOPATH/bin/testcli -h ``` #### Method 3. Import with Kratos pkg ```Go -import "github.com/bilibili/kratos/pkg/testing/lich" +import "github.com/go-kratos/kratos/pkg/testing/lich" ``` ### 构建数据 @@ -105,7 +105,7 @@ example: testcli -f ../../test/docker-compose.yaml run go test -v ./ ``` #### Method 2. Import with Kratos pkg -- Step1. 在 Dao|Service 层中的 TestMain 单测主入口中,import "github.com/bilibili/kratos/pkg/testing/lich" 引入testcli工具的go库版本。 +- Step1. 在 Dao|Service 层中的 TestMain 单测主入口中,import "github.com/go-kratos/kratos/pkg/testing/lich" 引入testcli工具的go库版本。 - Step2. 使用 flag.Set("f", "../../test/docker-compose.yaml") 指定 docker-compose.yaml 文件的路径。 - Step3. 在 flag.Parse() 后即可使用 lich.Setup() 安装依赖&初始化数据(注意测试用例执行结束后 lich.Teardown() 回收下~) - Step4. 运行 `go test -v ./ `看看效果吧~ @@ -121,8 +121,8 @@ import ( "strings" "testing" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/testing/lich" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/testing/lich" ) var ( diff --git a/doc/wiki-cn/ut-testgen.md b/doc/wiki-cn/ut-testgen.md index 3ec686e7f..890992ae8 100644 --- a/doc/wiki-cn/ut-testgen.md +++ b/doc/wiki-cn/ut-testgen.md @@ -12,12 +12,12 @@ ### 编译安装 #### Method 1. With go get ```shell -go get -u github.com/bilibili/kratos/tool/testgen +go get -u github.com/go-kratos/kratos/tool/testgen $GOPATH/bin/testgen -h ``` #### Method 2. Build with Go ```shell -cd github.com/bilibili/kratos/tool/testgen +cd github.com/go-kratos/kratos/tool/testgen go build -o $GOPATH/bin/testgen $GOPATH/bin/testgen -h ``` diff --git a/doc/wiki-cn/warden-mid.md b/doc/wiki-cn/warden-mid.md index 8609d32f6..8afcfdb33 100644 --- a/doc/wiki-cn/warden-mid.md +++ b/doc/wiki-cn/warden-mid.md @@ -42,7 +42,7 @@ type UnaryServerInterceptor func(ctx context.Context, req interface{}, info *Una * 一个`UnaryHandler`方法用于传递`Handler`,就是基于`proto`文件`service`内声明而生成的方法 * 一个`UnaryServerInterceptor`用于拦截`Handler`方法,可在`Handler`执行前后插入拦截代码 -为了更形象的说明拦截器的执行过程,请看基于`proto`生成的以下代码[代码位置](https://github.com/bilibili/kratos-demo/blob/master/api/api.pb.go): +为了更形象的说明拦截器的执行过程,请看基于`proto`生成的以下代码[代码位置](https://github.com/go-kratos/kratos-demo/blob/master/api/api.pb.go): ```go func _Demo_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -89,7 +89,7 @@ func UnaryInterceptor(i UnaryServerInterceptor) ServerOption { > Only one unary interceptor can be installed. The construction of multiple interceptors (e.g., chaining) can be implemented at the caller. -`gRPC`本身只支持一个`interceptor`,想要多`interceptors`需要自己实现~~所以`warden`基于`grpc.UnaryClientInterceptor`实现了`interceptor chain`,请看下面代码[代码位置](https://github.com/bilibili/kratos/blob/master/pkg/net/rpc/warden/server.go): +`gRPC`本身只支持一个`interceptor`,想要多`interceptors`需要自己实现~~所以`warden`基于`grpc.UnaryClientInterceptor`实现了`interceptor chain`,请看下面代码[代码位置](https://github.com/go-kratos/kratos/blob/master/pkg/net/rpc/warden/server.go): ```go // Use attachs a global inteceptor to the server. @@ -167,7 +167,7 @@ type UnaryClientInterceptor func(ctx context.Context, method string, req, reply * 一个`UnaryInvoker`表示客户端具体要发出的执行方法 * 一个`UnaryClientInterceptor`用于拦截`Invoker`方法,可在`Invoker`执行前后插入拦截代码 -具体执行过程,请看基于`proto`生成的下面代码[代码位置](https://github.com/bilibili/kratos-demo/blob/master/api/api.pb.go): +具体执行过程,请看基于`proto`生成的下面代码[代码位置](https://github.com/go-kratos/kratos-demo/blob/master/api/api.pb.go): ```go func (c *demoClient) SayHello(ctx context.Context, in *HelloReq, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { @@ -211,7 +211,7 @@ func WithUnaryInterceptor(f UnaryClientInterceptor) DialOption { } ``` -需要注意的是客户端的拦截器在官方`gRPC`内也只能支持注册一个,与服务端拦截器`interceptor chain`逻辑类似`warden`在客户端拦截器也做了相同处理,并且在客户端连接时进行注册,请看下面代码[代码位置](https://github.com/bilibili/kratos/blob/master/pkg/net/rpc/warden/client.go): +需要注意的是客户端的拦截器在官方`gRPC`内也只能支持注册一个,与服务端拦截器`interceptor chain`逻辑类似`warden`在客户端拦截器也做了相同处理,并且在客户端连接时进行注册,请看下面代码[代码位置](https://github.com/go-kratos/kratos/blob/master/pkg/net/rpc/warden/client.go): ```go // Use attachs a global inteceptor to the Client. @@ -332,9 +332,9 @@ package grpc import ( pb "kratos-demo/api" "kratos-demo/internal/service" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/net/rpc/warden" - "github.com/bilibili/kratos/pkg/net/rpc/warden/ratelimiter" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" + "github.com/go-kratos/kratos/pkg/net/rpc/warden/ratelimiter" ) // New new a grpc server. diff --git a/doc/wiki-cn/warden-pb.md b/doc/wiki-cn/warden-pb.md index b0a47acc9..ca8856de8 100644 --- a/doc/wiki-cn/warden-pb.md +++ b/doc/wiki-cn/warden-pb.md @@ -3,7 +3,7 @@ 基于proto文件可以快速生成`warden`框架对应的代码,提前需要准备以下工作: * 安装`kratos tool protoc`工具,请看[kratos工具](kratos-tool.md) -* 编写`proto`文件,示例可参考[kratos-demo内proto文件](https://github.com/bilibili/kratos-demo/blob/master/api/api.proto) +* 编写`proto`文件,示例可参考[kratos-demo内proto文件](https://github.com/go-kratos/kratos-demo/blob/master/api/api.proto) ### kratos工具说明 @@ -16,14 +16,14 @@ kratos tool protoc --grpc api.proto # 使用 -建议在项目`api`目录下编写`proto`文件及生成对应的代码,可参考[kratos-demo内的api目录](https://github.com/bilibili/kratos-demo/tree/master/api)。 +建议在项目`api`目录下编写`proto`文件及生成对应的代码,可参考[kratos-demo内的api目录](https://github.com/go-kratos/kratos-demo/tree/master/api)。 执行命令后生成的`api.pb.go`代码,注意其中的`DemoClient`和`DemoServer`,其中: * `DemoClient`接口为客户端调用接口,相对应的有`demoClient`结构体为其实现 * `DemoServer`接口为服务端接口声明,需要业务自己实现该接口的所有方法,`kratos`建议在`internal/service`目录下使用`Service`结构体实现 -`internal/service`内的`Service`结构实现了`DemoServer`接口可参考[kratos-demo内的service](https://github.com/bilibili/kratos-demo/blob/master/internal/service/service.go)内的如下代码: +`internal/service`内的`Service`结构实现了`DemoServer`接口可参考[kratos-demo内的service](https://github.com/go-kratos/kratos-demo/blob/master/internal/service/service.go)内的如下代码: ```go // SayHelloURL bm demo func. diff --git a/doc/wiki-cn/warden-quickstart.md b/doc/wiki-cn/warden-quickstart.md index 3ca32bd9c..9ce395d39 100644 --- a/doc/wiki-cn/warden-quickstart.md +++ b/doc/wiki-cn/warden-quickstart.md @@ -35,8 +35,8 @@ package grpc import ( pb "kratos-demo/api" "kratos-demo/internal/service" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/net/rpc/warden" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" ) // New new a grpc server. @@ -99,7 +99,7 @@ package dao import ( "context" - "github.com/bilibili/kratos/pkg/net/rpc/warden" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" "google.golang.org/grpc" ) @@ -131,7 +131,7 @@ package dao import( demoapi "kratos-demo/api" grpcempty "github.com/golang/protobuf/ptypes/empty" - "github.com/bilibili/kratos/pkg/net/rpc/warden" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" "github.com/pkg/errors" ) diff --git a/doc/wiki-cn/warden-resolver.md b/doc/wiki-cn/warden-resolver.md index 0e84a9044..8304dca0c 100644 --- a/doc/wiki-cn/warden-resolver.md +++ b/doc/wiki-cn/warden-resolver.md @@ -119,9 +119,9 @@ package dao import ( "context" - "github.com/bilibili/kratos/pkg/naming/discovery" - "github.com/bilibili/kratos/pkg/net/rpc/warden" - "github.com/bilibili/kratos/pkg/net/rpc/warden/resolver" + "github.com/go-kratos/kratos/pkg/naming/discovery" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" + "github.com/go-kratos/kratos/pkg/net/rpc/warden/resolver" "google.golang.org/grpc" ) @@ -206,9 +206,9 @@ package dao import ( "context" - "github.com/bilibili/kratos/pkg/naming/etcd" - "github.com/bilibili/kratos/pkg/net/rpc/warden" - "github.com/bilibili/kratos/pkg/net/rpc/warden/resolver" + "github.com/go-kratos/kratos/pkg/naming/etcd" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" + "github.com/go-kratos/kratos/pkg/net/rpc/warden/resolver" "google.golang.org/grpc" ) diff --git a/example/blademaster/middleware/auth/auth.go b/example/blademaster/middleware/auth/auth.go index 7c77c280e..cb3accf66 100644 --- a/example/blademaster/middleware/auth/auth.go +++ b/example/blademaster/middleware/auth/auth.go @@ -1,9 +1,9 @@ package auth import ( - "github.com/bilibili/kratos/pkg/ecode" - bm "github.com/bilibili/kratos/pkg/net/http/blademaster" - "github.com/bilibili/kratos/pkg/net/metadata" + "github.com/go-kratos/kratos/pkg/ecode" + bm "github.com/go-kratos/kratos/pkg/net/http/blademaster" + "github.com/go-kratos/kratos/pkg/net/metadata" ) // Config is the identify config model. diff --git a/example/blademaster/middleware/auth/example_test.go b/example/blademaster/middleware/auth/example_test.go index 0d5b30b46..d77d34494 100644 --- a/example/blademaster/middleware/auth/example_test.go +++ b/example/blademaster/middleware/auth/example_test.go @@ -3,9 +3,9 @@ package auth_test import ( "fmt" - "github.com/bilibili/kratos/example/blademaster/middleware/auth" - bm "github.com/bilibili/kratos/pkg/net/http/blademaster" - "github.com/bilibili/kratos/pkg/net/metadata" + "github.com/go-kratos/kratos/example/blademaster/middleware/auth" + bm "github.com/go-kratos/kratos/pkg/net/http/blademaster" + "github.com/go-kratos/kratos/pkg/net/metadata" ) // This example create a identify middleware instance and attach to several path, diff --git a/example/protobuf/api.bm.go b/example/protobuf/api.bm.go index 6e3ce12a7..ebe6252ec 100644 --- a/example/protobuf/api.bm.go +++ b/example/protobuf/api.bm.go @@ -6,8 +6,8 @@ package api import ( "context" - bm "github.com/bilibili/kratos/pkg/net/http/blademaster" - "github.com/bilibili/kratos/pkg/net/http/blademaster/binding" + bm "github.com/go-kratos/kratos/pkg/net/http/blademaster" + "github.com/go-kratos/kratos/pkg/net/http/blademaster/binding" ) import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" diff --git a/example/protobuf/api.ecode.go b/example/protobuf/api.ecode.go index dfed755c1..7563f36ab 100644 --- a/example/protobuf/api.ecode.go +++ b/example/protobuf/api.ecode.go @@ -4,7 +4,7 @@ package api import ( - "github.com/bilibili/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/ecode" ) // to suppressed 'imported but not used warning' diff --git a/go.mod b/go.mod index db6133747..c1edff070 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/bilibili/kratos +module github.com/go-kratos/kratos go 1.13 diff --git a/pkg/cache/memcache/conn_test.go b/pkg/cache/memcache/conn_test.go index 0d48ad702..fef0ad14e 100644 --- a/pkg/cache/memcache/conn_test.go +++ b/pkg/cache/memcache/conn_test.go @@ -5,7 +5,7 @@ import ( "encoding/json" "testing" - test "github.com/bilibili/kratos/pkg/cache/memcache/test" + test "github.com/go-kratos/kratos/pkg/cache/memcache/test" "github.com/gogo/protobuf/proto" ) diff --git a/pkg/cache/memcache/encoding_test.go b/pkg/cache/memcache/encoding_test.go index 3fadac5fb..c00a45c95 100644 --- a/pkg/cache/memcache/encoding_test.go +++ b/pkg/cache/memcache/encoding_test.go @@ -4,7 +4,7 @@ import ( "bytes" "testing" - mt "github.com/bilibili/kratos/pkg/cache/memcache/test" + mt "github.com/go-kratos/kratos/pkg/cache/memcache/test" ) func TestEncode(t *testing.T) { diff --git a/pkg/cache/memcache/main_test.go b/pkg/cache/memcache/main_test.go index 5d40535a6..46e8b5689 100644 --- a/pkg/cache/memcache/main_test.go +++ b/pkg/cache/memcache/main_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/container/pool" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/container/pool" + xtime "github.com/go-kratos/kratos/pkg/time" ) var testConnASCII Conn diff --git a/pkg/cache/memcache/memcache.go b/pkg/cache/memcache/memcache.go index a0b745e4b..ce51a0720 100644 --- a/pkg/cache/memcache/memcache.go +++ b/pkg/cache/memcache/memcache.go @@ -3,8 +3,8 @@ package memcache import ( "context" - "github.com/bilibili/kratos/pkg/container/pool" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/container/pool" + xtime "github.com/go-kratos/kratos/pkg/time" ) const ( diff --git a/pkg/cache/memcache/metrics.go b/pkg/cache/memcache/metrics.go index dc91a3c24..0eeb60573 100644 --- a/pkg/cache/memcache/metrics.go +++ b/pkg/cache/memcache/metrics.go @@ -1,6 +1,6 @@ package memcache -import "github.com/bilibili/kratos/pkg/stat/metric" +import "github.com/go-kratos/kratos/pkg/stat/metric" const namespace = "memcache_client" diff --git a/pkg/cache/memcache/pool_conn.go b/pkg/cache/memcache/pool_conn.go index f376880a7..6de7a31cd 100644 --- a/pkg/cache/memcache/pool_conn.go +++ b/pkg/cache/memcache/pool_conn.go @@ -6,7 +6,7 @@ import ( "io" "time" - "github.com/bilibili/kratos/pkg/container/pool" + "github.com/go-kratos/kratos/pkg/container/pool" ) // Pool memcache connection pool struct. diff --git a/pkg/cache/memcache/pool_conn_test.go b/pkg/cache/memcache/pool_conn_test.go index a61bdb697..dadfb1278 100644 --- a/pkg/cache/memcache/pool_conn_test.go +++ b/pkg/cache/memcache/pool_conn_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/container/pool" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/container/pool" + xtime "github.com/go-kratos/kratos/pkg/time" ) var itempool = &Item{ diff --git a/pkg/cache/memcache/trace_conn.go b/pkg/cache/memcache/trace_conn.go index 086dab5c7..776a2488c 100644 --- a/pkg/cache/memcache/trace_conn.go +++ b/pkg/cache/memcache/trace_conn.go @@ -6,8 +6,8 @@ import ( "strings" "time" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/net/trace" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/net/trace" ) const ( diff --git a/pkg/cache/memcache/util_test.go b/pkg/cache/memcache/util_test.go index 080ef4549..f14a888f6 100644 --- a/pkg/cache/memcache/util_test.go +++ b/pkg/cache/memcache/util_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - pb "github.com/bilibili/kratos/pkg/cache/memcache/test" + pb "github.com/go-kratos/kratos/pkg/cache/memcache/test" "github.com/stretchr/testify/assert" ) diff --git a/pkg/cache/metrics.go b/pkg/cache/metrics.go index 649df52fd..4c41b429c 100644 --- a/pkg/cache/metrics.go +++ b/pkg/cache/metrics.go @@ -1,6 +1,6 @@ package cache -import "github.com/bilibili/kratos/pkg/stat/metric" +import "github.com/go-kratos/kratos/pkg/stat/metric" const _metricNamespace = "cache" diff --git a/pkg/cache/redis/main_test.go b/pkg/cache/redis/main_test.go index 3164628f2..0cf3556b5 100644 --- a/pkg/cache/redis/main_test.go +++ b/pkg/cache/redis/main_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/container/pool" - "github.com/bilibili/kratos/pkg/testing/lich" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/container/pool" + "github.com/go-kratos/kratos/pkg/testing/lich" + xtime "github.com/go-kratos/kratos/pkg/time" ) var ( diff --git a/pkg/cache/redis/metrics.go b/pkg/cache/redis/metrics.go index 2037ce48a..4ad7a0b87 100644 --- a/pkg/cache/redis/metrics.go +++ b/pkg/cache/redis/metrics.go @@ -1,7 +1,7 @@ package redis import ( - "github.com/bilibili/kratos/pkg/stat/metric" + "github.com/go-kratos/kratos/pkg/stat/metric" ) const namespace = "redis_client" diff --git a/pkg/cache/redis/pipeline_test.go b/pkg/cache/redis/pipeline_test.go index d3d95d260..9b5d4ee53 100644 --- a/pkg/cache/redis/pipeline_test.go +++ b/pkg/cache/redis/pipeline_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/container/pool" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/container/pool" + xtime "github.com/go-kratos/kratos/pkg/time" ) func TestRedis_Pipeline(t *testing.T) { diff --git a/pkg/cache/redis/pool.go b/pkg/cache/redis/pool.go index cd64de6a5..df2d0829d 100644 --- a/pkg/cache/redis/pool.go +++ b/pkg/cache/redis/pool.go @@ -25,9 +25,9 @@ import ( "sync" "time" - "github.com/bilibili/kratos/pkg/container/pool" - "github.com/bilibili/kratos/pkg/net/trace" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/container/pool" + "github.com/go-kratos/kratos/pkg/net/trace" + xtime "github.com/go-kratos/kratos/pkg/time" ) var beginTime, _ = time.Parse("2006-01-02 15:04:05", "2006-01-02 15:04:05") diff --git a/pkg/cache/redis/pool_test.go b/pkg/cache/redis/pool_test.go index fdea2a337..5018a8156 100644 --- a/pkg/cache/redis/pool_test.go +++ b/pkg/cache/redis/pool_test.go @@ -23,7 +23,7 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/container/pool" + "github.com/go-kratos/kratos/pkg/container/pool" ) type poolTestConn struct { diff --git a/pkg/cache/redis/redis.go b/pkg/cache/redis/redis.go index f912372b0..a664cfe51 100644 --- a/pkg/cache/redis/redis.go +++ b/pkg/cache/redis/redis.go @@ -17,8 +17,8 @@ package redis import ( "context" - "github.com/bilibili/kratos/pkg/container/pool" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/container/pool" + xtime "github.com/go-kratos/kratos/pkg/time" ) // Error represents an error returned in a command reply. diff --git a/pkg/cache/redis/redis_test.go b/pkg/cache/redis/redis_test.go index 464cbff8f..5a150a282 100644 --- a/pkg/cache/redis/redis_test.go +++ b/pkg/cache/redis/redis_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/container/pool" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/container/pool" + xtime "github.com/go-kratos/kratos/pkg/time" ) func TestRedis(t *testing.T) { diff --git a/pkg/cache/redis/trace.go b/pkg/cache/redis/trace.go index ed0b2a62d..90144ce34 100644 --- a/pkg/cache/redis/trace.go +++ b/pkg/cache/redis/trace.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/net/trace" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/net/trace" ) const ( diff --git a/pkg/cache/redis/trace_test.go b/pkg/cache/redis/trace_test.go index 181910342..c9502b808 100644 --- a/pkg/cache/redis/trace_test.go +++ b/pkg/cache/redis/trace_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/net/trace" + "github.com/go-kratos/kratos/pkg/net/trace" "github.com/stretchr/testify/assert" ) diff --git a/pkg/conf/dsn/dsn_test.go b/pkg/conf/dsn/dsn_test.go index 01573be51..2a25acfb5 100644 --- a/pkg/conf/dsn/dsn_test.go +++ b/pkg/conf/dsn/dsn_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - xtime "github.com/bilibili/kratos/pkg/time" + xtime "github.com/go-kratos/kratos/pkg/time" ) type config struct { diff --git a/pkg/conf/dsn/example_test.go b/pkg/conf/dsn/example_test.go index 51d075d96..b2ac38421 100644 --- a/pkg/conf/dsn/example_test.go +++ b/pkg/conf/dsn/example_test.go @@ -3,8 +3,8 @@ package dsn_test import ( "log" - "github.com/bilibili/kratos/pkg/conf/dsn" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/conf/dsn" + xtime "github.com/go-kratos/kratos/pkg/time" ) // Config struct diff --git a/pkg/conf/dsn/query_test.go b/pkg/conf/dsn/query_test.go index 3bac1f9eb..10d431db5 100644 --- a/pkg/conf/dsn/query_test.go +++ b/pkg/conf/dsn/query_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - xtime "github.com/bilibili/kratos/pkg/time" + xtime "github.com/go-kratos/kratos/pkg/time" ) type cfg1 struct { @@ -66,7 +66,7 @@ func TestDecodeQuery(t *testing.T) { }, }, { - name: "test github.com/bilibili/kratos/pkg/time", + name: "test github.com/go-kratos/kratos/pkg/time", args: args{ query: url.Values{ "timeout": {"1s"}, @@ -77,7 +77,7 @@ func TestDecodeQuery(t *testing.T) { cfg: &cfg2{xtime.Duration(time.Second)}, }, { - name: "test empty github.com/bilibili/kratos/pkg/time", + name: "test empty github.com/go-kratos/kratos/pkg/time", args: args{ query: url.Values{}, v: &cfg2{}, @@ -86,7 +86,7 @@ func TestDecodeQuery(t *testing.T) { cfg: &cfg2{}, }, { - name: "test github.com/bilibili/kratos/pkg/time", + name: "test github.com/go-kratos/kratos/pkg/time", args: args{ query: url.Values{}, v: &cfg4{}, diff --git a/pkg/conf/paladin/apollo/apollo.go b/pkg/conf/paladin/apollo/apollo.go index e30317edd..b5752620a 100644 --- a/pkg/conf/paladin/apollo/apollo.go +++ b/pkg/conf/paladin/apollo/apollo.go @@ -12,7 +12,7 @@ import ( "github.com/philchia/agollo" - "github.com/bilibili/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/conf/paladin" ) var ( diff --git a/pkg/conf/paladin/apollo/apollo_test.go b/pkg/conf/paladin/apollo/apollo_test.go index bb97f5d22..6b3b76d6a 100644 --- a/pkg/conf/paladin/apollo/apollo_test.go +++ b/pkg/conf/paladin/apollo/apollo_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/conf/paladin/apollo/internal/mockserver" + "github.com/go-kratos/kratos/pkg/conf/paladin/apollo/internal/mockserver" ) func TestMain(m *testing.M) { diff --git a/pkg/conf/paladin/example_test.go b/pkg/conf/paladin/example_test.go index 110e402b8..5262785a7 100644 --- a/pkg/conf/paladin/example_test.go +++ b/pkg/conf/paladin/example_test.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/conf/paladin/apollo" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/conf/paladin/apollo" "github.com/BurntSushi/toml" ) diff --git a/pkg/conf/paladin/map_test.go b/pkg/conf/paladin/map_test.go index 99bef1990..b4d7a3ac0 100644 --- a/pkg/conf/paladin/map_test.go +++ b/pkg/conf/paladin/map_test.go @@ -3,7 +3,7 @@ package paladin_test import ( "testing" - "github.com/bilibili/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/conf/paladin" "github.com/BurntSushi/toml" "github.com/stretchr/testify/assert" diff --git a/pkg/conf/paladin/mock_test.go b/pkg/conf/paladin/mock_test.go index 7181d4dc7..09785d716 100644 --- a/pkg/conf/paladin/mock_test.go +++ b/pkg/conf/paladin/mock_test.go @@ -3,7 +3,7 @@ package paladin_test import ( "testing" - "github.com/bilibili/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/conf/paladin" "github.com/stretchr/testify/assert" ) diff --git a/pkg/container/pool/list_test.go b/pkg/container/pool/list_test.go index 2c9091591..68fc70edd 100644 --- a/pkg/container/pool/list_test.go +++ b/pkg/container/pool/list_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - xtime "github.com/bilibili/kratos/pkg/time" + xtime "github.com/go-kratos/kratos/pkg/time" "github.com/stretchr/testify/assert" ) diff --git a/pkg/container/pool/pool.go b/pkg/container/pool/pool.go index 7e273241e..9aec0697c 100644 --- a/pkg/container/pool/pool.go +++ b/pkg/container/pool/pool.go @@ -6,7 +6,7 @@ import ( "io" "time" - xtime "github.com/bilibili/kratos/pkg/time" + xtime "github.com/go-kratos/kratos/pkg/time" ) var ( diff --git a/pkg/container/pool/slice_test.go b/pkg/container/pool/slice_test.go index 104d20ff5..b2bc07b5b 100644 --- a/pkg/container/pool/slice_test.go +++ b/pkg/container/pool/slice_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - xtime "github.com/bilibili/kratos/pkg/time" + xtime "github.com/go-kratos/kratos/pkg/time" "github.com/stretchr/testify/assert" ) diff --git a/pkg/container/queue/aqm/codel.go b/pkg/container/queue/aqm/codel.go index df32fade0..809c2fd5e 100644 --- a/pkg/container/queue/aqm/codel.go +++ b/pkg/container/queue/aqm/codel.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/bilibili/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/ecode" ) // Config codel config. diff --git a/pkg/container/queue/aqm/codel_test.go b/pkg/container/queue/aqm/codel_test.go index 1edef0f70..0ac541ddb 100644 --- a/pkg/container/queue/aqm/codel_test.go +++ b/pkg/container/queue/aqm/codel_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/ecode" ) var testConf = &Config{ diff --git a/pkg/database/hbase/README.md b/pkg/database/hbase/README.md index d36973a04..8e1280821 100644 --- a/pkg/database/hbase/README.md +++ b/pkg/database/hbase/README.md @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/bilibili/kratos/pkg/database/hbase" + "github.com/go-kratos/kratos/pkg/database/hbase" ) func main() { diff --git a/pkg/database/hbase/config.go b/pkg/database/hbase/config.go index f928b8b7a..8b24b0862 100644 --- a/pkg/database/hbase/config.go +++ b/pkg/database/hbase/config.go @@ -1,7 +1,7 @@ package hbase import ( - xtime "github.com/bilibili/kratos/pkg/time" + xtime "github.com/go-kratos/kratos/pkg/time" ) // ZKConfig Server&Client settings. diff --git a/pkg/database/hbase/hbase.go b/pkg/database/hbase/hbase.go index bb5bd3f9f..da8d441b8 100644 --- a/pkg/database/hbase/hbase.go +++ b/pkg/database/hbase/hbase.go @@ -9,7 +9,7 @@ import ( "github.com/tsuna/gohbase" "github.com/tsuna/gohbase/hrpc" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/log" ) // HookFunc hook function call before every method and hook return function will call after finish. diff --git a/pkg/database/hbase/metrics.go b/pkg/database/hbase/metrics.go index a29f82e3f..ad09331a3 100644 --- a/pkg/database/hbase/metrics.go +++ b/pkg/database/hbase/metrics.go @@ -9,7 +9,7 @@ import ( "github.com/tsuna/gohbase" "github.com/tsuna/gohbase/hrpc" - "github.com/bilibili/kratos/pkg/stat/metric" + "github.com/go-kratos/kratos/pkg/stat/metric" ) const namespace = "hbase_client" diff --git a/pkg/database/hbase/slowlog.go b/pkg/database/hbase/slowlog.go index f7dc4741a..8edd28c4e 100644 --- a/pkg/database/hbase/slowlog.go +++ b/pkg/database/hbase/slowlog.go @@ -6,7 +6,7 @@ import ( "github.com/tsuna/gohbase/hrpc" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/log" ) // NewSlowLogHook log slow operation. diff --git a/pkg/database/hbase/trace.go b/pkg/database/hbase/trace.go index b11b69d42..e836ce19f 100644 --- a/pkg/database/hbase/trace.go +++ b/pkg/database/hbase/trace.go @@ -6,7 +6,7 @@ import ( "github.com/tsuna/gohbase/hrpc" - "github.com/bilibili/kratos/pkg/net/trace" + "github.com/go-kratos/kratos/pkg/net/trace" ) // TraceHook create new hbase trace hook. diff --git a/pkg/database/sql/metrics.go b/pkg/database/sql/metrics.go index 2ef1b2b23..a4e187d54 100644 --- a/pkg/database/sql/metrics.go +++ b/pkg/database/sql/metrics.go @@ -1,6 +1,6 @@ package sql -import "github.com/bilibili/kratos/pkg/stat/metric" +import "github.com/go-kratos/kratos/pkg/stat/metric" const namespace = "mysql_client" diff --git a/pkg/database/sql/mysql.go b/pkg/database/sql/mysql.go index 29a1f6e4d..36baf21bf 100644 --- a/pkg/database/sql/mysql.go +++ b/pkg/database/sql/mysql.go @@ -1,9 +1,9 @@ package sql import ( - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/net/netutil/breaker" - "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/net/netutil/breaker" + "github.com/go-kratos/kratos/pkg/time" // database driver _ "github.com/go-sql-driver/mysql" diff --git a/pkg/database/sql/sql.go b/pkg/database/sql/sql.go index f0406c002..4dbb2f683 100644 --- a/pkg/database/sql/sql.go +++ b/pkg/database/sql/sql.go @@ -7,10 +7,10 @@ import ( "sync/atomic" "time" - "github.com/bilibili/kratos/pkg/ecode" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/net/netutil/breaker" - "github.com/bilibili/kratos/pkg/net/trace" + "github.com/go-kratos/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/net/netutil/breaker" + "github.com/go-kratos/kratos/pkg/net/trace" "github.com/go-sql-driver/mysql" "github.com/pkg/errors" diff --git a/pkg/database/tidb/discovery.go b/pkg/database/tidb/discovery.go index c3898e6a7..fb728c2aa 100644 --- a/pkg/database/tidb/discovery.go +++ b/pkg/database/tidb/discovery.go @@ -6,10 +6,10 @@ import ( "strings" "time" - "github.com/bilibili/kratos/pkg/conf/env" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/naming" - "github.com/bilibili/kratos/pkg/naming/discovery" + "github.com/go-kratos/kratos/pkg/conf/env" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/naming" + "github.com/go-kratos/kratos/pkg/naming/discovery" ) var _schema = "tidb://" diff --git a/pkg/database/tidb/metrics.go b/pkg/database/tidb/metrics.go index dfcef6253..96687ed16 100644 --- a/pkg/database/tidb/metrics.go +++ b/pkg/database/tidb/metrics.go @@ -1,6 +1,6 @@ package tidb -import "github.com/bilibili/kratos/pkg/stat/metric" +import "github.com/go-kratos/kratos/pkg/stat/metric" const namespace = "tidb_client" diff --git a/pkg/database/tidb/node_proc.go b/pkg/database/tidb/node_proc.go index 74f5159ac..0b72acdc5 100644 --- a/pkg/database/tidb/node_proc.go +++ b/pkg/database/tidb/node_proc.go @@ -3,7 +3,7 @@ package tidb import ( "time" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/log" ) func (db *DB) nodeproc(e <-chan struct{}) { diff --git a/pkg/database/tidb/sql.go b/pkg/database/tidb/sql.go index d82dcb12a..ee932940e 100644 --- a/pkg/database/tidb/sql.go +++ b/pkg/database/tidb/sql.go @@ -8,10 +8,10 @@ import ( "sync/atomic" "time" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/naming" - "github.com/bilibili/kratos/pkg/net/netutil/breaker" - "github.com/bilibili/kratos/pkg/net/trace" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/naming" + "github.com/go-kratos/kratos/pkg/net/netutil/breaker" + "github.com/go-kratos/kratos/pkg/net/trace" "github.com/go-sql-driver/mysql" "github.com/pkg/errors" diff --git a/pkg/database/tidb/tidb.go b/pkg/database/tidb/tidb.go index 5a520ce84..02fbe8731 100644 --- a/pkg/database/tidb/tidb.go +++ b/pkg/database/tidb/tidb.go @@ -1,9 +1,9 @@ package tidb import ( - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/net/netutil/breaker" - "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/net/netutil/breaker" + "github.com/go-kratos/kratos/pkg/time" // database driver _ "github.com/go-sql-driver/mysql" diff --git a/pkg/ecode/status.go b/pkg/ecode/status.go index 8268f26ef..78fdf1e3d 100644 --- a/pkg/ecode/status.go +++ b/pkg/ecode/status.go @@ -4,7 +4,7 @@ import ( "fmt" "strconv" - "github.com/bilibili/kratos/pkg/ecode/types" + "github.com/go-kratos/kratos/pkg/ecode/types" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" diff --git a/pkg/ecode/status_test.go b/pkg/ecode/status_test.go index 78bf6c158..5778ac4be 100644 --- a/pkg/ecode/status_test.go +++ b/pkg/ecode/status_test.go @@ -7,7 +7,7 @@ import ( "github.com/golang/protobuf/ptypes/timestamp" "github.com/stretchr/testify/assert" - "github.com/bilibili/kratos/pkg/ecode/types" + "github.com/go-kratos/kratos/pkg/ecode/types" ) func TestEqual(t *testing.T) { diff --git a/pkg/ecode/types/status.pb.go b/pkg/ecode/types/status.pb.go index caecf9fbd..8fe2c79c6 100644 --- a/pkg/ecode/types/status.pb.go +++ b/pkg/ecode/types/status.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: internal/types/status.proto -package types // import "github.com/bilibili/kratos/pkg/ecode/types" +package types // import "github.com/go-kratos/kratos/pkg/ecode/types" import proto "github.com/golang/protobuf/proto" import fmt "fmt" diff --git a/pkg/ecode/types/status.proto b/pkg/ecode/types/status.proto index d1310cb6d..86101fc1d 100644 --- a/pkg/ecode/types/status.proto +++ b/pkg/ecode/types/status.proto @@ -4,7 +4,7 @@ package bilibili.rpc; import "google/protobuf/any.proto"; -option go_package = "github.com/bilibili/Kratos/pkg/ecode/types;types"; +option go_package = "github.com/go-kratos/kratos/pkg/ecode/types;types"; option java_multiple_files = true; option java_outer_classname = "StatusProto"; option java_package = "com.bilibili.rpc"; diff --git a/pkg/log/field.go b/pkg/log/field.go index 144af2fd3..3feecb8a6 100644 --- a/pkg/log/field.go +++ b/pkg/log/field.go @@ -4,7 +4,7 @@ import ( "math" "time" - "github.com/bilibili/kratos/pkg/log/internal/core" + "github.com/go-kratos/kratos/pkg/log/internal/core" ) // D represents a map of entry level data used for structured logging. diff --git a/pkg/log/file.go b/pkg/log/file.go index a99a8515d..1a8d4e4cf 100644 --- a/pkg/log/file.go +++ b/pkg/log/file.go @@ -6,7 +6,7 @@ import ( "path/filepath" "time" - "github.com/bilibili/kratos/pkg/log/internal/filewriter" + "github.com/go-kratos/kratos/pkg/log/internal/filewriter" ) // level idx diff --git a/pkg/log/internal/core/field.go b/pkg/log/internal/core/field.go index 99c78325b..66d1c5992 100644 --- a/pkg/log/internal/core/field.go +++ b/pkg/log/internal/core/field.go @@ -5,7 +5,7 @@ import ( "math" "time" - xtime "github.com/bilibili/kratos/pkg/time" + xtime "github.com/go-kratos/kratos/pkg/time" ) // FieldType represent D value type diff --git a/pkg/log/log.go b/pkg/log/log.go index 706ed3e64..1778f93a7 100644 --- a/pkg/log/log.go +++ b/pkg/log/log.go @@ -8,8 +8,8 @@ import ( "os" "strconv" - "github.com/bilibili/kratos/pkg/conf/env" - "github.com/bilibili/kratos/pkg/stat/metric" + "github.com/go-kratos/kratos/pkg/conf/env" + "github.com/go-kratos/kratos/pkg/stat/metric" ) // Config log config. diff --git a/pkg/log/log_test.go b/pkg/log/log_test.go index 87c720699..1a938bad5 100644 --- a/pkg/log/log_test.go +++ b/pkg/log/log_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/bilibili/kratos/pkg/net/metadata" + "github.com/go-kratos/kratos/pkg/net/metadata" "github.com/stretchr/testify/assert" ) diff --git a/pkg/log/util.go b/pkg/log/util.go index b44f8cac8..4d21fec48 100644 --- a/pkg/log/util.go +++ b/pkg/log/util.go @@ -7,10 +7,10 @@ import ( "strconv" "time" - "github.com/bilibili/kratos/pkg/conf/env" - "github.com/bilibili/kratos/pkg/log/internal/core" - "github.com/bilibili/kratos/pkg/net/metadata" - "github.com/bilibili/kratos/pkg/net/trace" + "github.com/go-kratos/kratos/pkg/conf/env" + "github.com/go-kratos/kratos/pkg/log/internal/core" + "github.com/go-kratos/kratos/pkg/net/metadata" + "github.com/go-kratos/kratos/pkg/net/trace" ) func addExtraField(ctx context.Context, fields map[string]interface{}) { diff --git a/pkg/naming/discovery/discovery.go b/pkg/naming/discovery/discovery.go index 324f0c100..6e837b0fc 100644 --- a/pkg/naming/discovery/discovery.go +++ b/pkg/naming/discovery/discovery.go @@ -13,12 +13,12 @@ import ( "sync/atomic" "time" - "github.com/bilibili/kratos/pkg/conf/env" - "github.com/bilibili/kratos/pkg/ecode" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/naming" - http "github.com/bilibili/kratos/pkg/net/http/blademaster" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/conf/env" + "github.com/go-kratos/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/naming" + http "github.com/go-kratos/kratos/pkg/net/http/blademaster" + xtime "github.com/go-kratos/kratos/pkg/time" ) const ( diff --git a/pkg/naming/etcd/etcd.go b/pkg/naming/etcd/etcd.go index a946a0d6d..b61061aa1 100644 --- a/pkg/naming/etcd/etcd.go +++ b/pkg/naming/etcd/etcd.go @@ -12,8 +12,8 @@ import ( "sync/atomic" "time" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/naming" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/naming" "go.etcd.io/etcd/clientv3" "go.etcd.io/etcd/mvcc/mvccpb" "google.golang.org/grpc" diff --git a/pkg/naming/etcd/etcd_test.go b/pkg/naming/etcd/etcd_test.go index 5dfd2e539..eddf77764 100644 --- a/pkg/naming/etcd/etcd_test.go +++ b/pkg/naming/etcd/etcd_test.go @@ -3,7 +3,7 @@ package etcd import ( "context" "fmt" - "github.com/bilibili/kratos/pkg/naming" + "github.com/go-kratos/kratos/pkg/naming" "go.etcd.io/etcd/clientv3" "google.golang.org/grpc" "testing" diff --git a/pkg/naming/opt.go b/pkg/naming/opt.go index e49c9f01a..ac585cb42 100644 --- a/pkg/naming/opt.go +++ b/pkg/naming/opt.go @@ -8,8 +8,8 @@ import ( "os" "sort" - "github.com/bilibili/kratos/pkg/conf/env" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/conf/env" + "github.com/go-kratos/kratos/pkg/log" "github.com/dgryski/go-farm" ) diff --git a/pkg/naming/zookeeper/zookeeper.go b/pkg/naming/zookeeper/zookeeper.go index aaba3cb6a..e953ed957 100644 --- a/pkg/naming/zookeeper/zookeeper.go +++ b/pkg/naming/zookeeper/zookeeper.go @@ -12,9 +12,9 @@ import ( "sync/atomic" "time" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/naming" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/naming" + xtime "github.com/go-kratos/kratos/pkg/time" "github.com/go-zookeeper/zk" ) diff --git a/pkg/naming/zookeeper/zookeeper_test.go b/pkg/naming/zookeeper/zookeeper_test.go index 0539d8f2a..d311ca10c 100644 --- a/pkg/naming/zookeeper/zookeeper_test.go +++ b/pkg/naming/zookeeper/zookeeper_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/bilibili/kratos/pkg/naming" + "github.com/go-kratos/kratos/pkg/naming" ) var ( diff --git a/pkg/net/http/blademaster/client.go b/pkg/net/http/blademaster/client.go index a5ad62443..68d0ea6a1 100644 --- a/pkg/net/http/blademaster/client.go +++ b/pkg/net/http/blademaster/client.go @@ -17,10 +17,10 @@ import ( "sync" "time" - "github.com/bilibili/kratos/pkg/conf/env" - "github.com/bilibili/kratos/pkg/net/metadata" - "github.com/bilibili/kratos/pkg/net/netutil/breaker" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/conf/env" + "github.com/go-kratos/kratos/pkg/net/metadata" + "github.com/go-kratos/kratos/pkg/net/netutil/breaker" + xtime "github.com/go-kratos/kratos/pkg/time" "github.com/gogo/protobuf/proto" pkgerr "github.com/pkg/errors" diff --git a/pkg/net/http/blademaster/context.go b/pkg/net/http/blademaster/context.go index d660ecac9..19e4443fe 100644 --- a/pkg/net/http/blademaster/context.go +++ b/pkg/net/http/blademaster/context.go @@ -7,9 +7,9 @@ import ( "strconv" "text/template" - "github.com/bilibili/kratos/pkg/ecode" - "github.com/bilibili/kratos/pkg/net/http/blademaster/binding" - "github.com/bilibili/kratos/pkg/net/http/blademaster/render" + "github.com/go-kratos/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/net/http/blademaster/binding" + "github.com/go-kratos/kratos/pkg/net/http/blademaster/render" "github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/types" diff --git a/pkg/net/http/blademaster/cors.go b/pkg/net/http/blademaster/cors.go index 78a6a91c0..8192e0871 100644 --- a/pkg/net/http/blademaster/cors.go +++ b/pkg/net/http/blademaster/cors.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/log" "github.com/pkg/errors" ) diff --git a/pkg/net/http/blademaster/criticality.go b/pkg/net/http/blademaster/criticality.go index d14c7afda..0705ff0e7 100644 --- a/pkg/net/http/blademaster/criticality.go +++ b/pkg/net/http/blademaster/criticality.go @@ -1,8 +1,8 @@ package blademaster import ( - criticalityPkg "github.com/bilibili/kratos/pkg/net/criticality" - "github.com/bilibili/kratos/pkg/net/metadata" + criticalityPkg "github.com/go-kratos/kratos/pkg/net/criticality" + "github.com/go-kratos/kratos/pkg/net/metadata" "github.com/pkg/errors" ) diff --git a/pkg/net/http/blademaster/csrf.go b/pkg/net/http/blademaster/csrf.go index 9f7d1be0d..25482f5d7 100644 --- a/pkg/net/http/blademaster/csrf.go +++ b/pkg/net/http/blademaster/csrf.go @@ -5,7 +5,7 @@ import ( "regexp" "strings" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/log" ) func matchHostSuffix(suffix string) func(*url.URL) bool { diff --git a/pkg/net/http/blademaster/logger.go b/pkg/net/http/blademaster/logger.go index 6a440cdd4..ca6d9ad38 100644 --- a/pkg/net/http/blademaster/logger.go +++ b/pkg/net/http/blademaster/logger.go @@ -5,9 +5,9 @@ import ( "strconv" "time" - "github.com/bilibili/kratos/pkg/ecode" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/net/metadata" + "github.com/go-kratos/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/net/metadata" ) // Logger is logger middleware diff --git a/pkg/net/http/blademaster/metadata.go b/pkg/net/http/blademaster/metadata.go index 24139dc35..fc294a3d3 100644 --- a/pkg/net/http/blademaster/metadata.go +++ b/pkg/net/http/blademaster/metadata.go @@ -7,10 +7,10 @@ import ( "strings" "time" - "github.com/bilibili/kratos/pkg/conf/env" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/net/criticality" - "github.com/bilibili/kratos/pkg/net/metadata" + "github.com/go-kratos/kratos/pkg/conf/env" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/net/criticality" + "github.com/go-kratos/kratos/pkg/net/metadata" "github.com/pkg/errors" ) diff --git a/pkg/net/http/blademaster/metrics.go b/pkg/net/http/blademaster/metrics.go index 1625090fc..87ee59167 100644 --- a/pkg/net/http/blademaster/metrics.go +++ b/pkg/net/http/blademaster/metrics.go @@ -1,6 +1,6 @@ package blademaster -import "github.com/bilibili/kratos/pkg/stat/metric" +import "github.com/go-kratos/kratos/pkg/stat/metric" const ( clientNamespace = "http_client" diff --git a/pkg/net/http/blademaster/perf.go b/pkg/net/http/blademaster/perf.go index ad6c1cbb9..a15c5aac0 100644 --- a/pkg/net/http/blademaster/perf.go +++ b/pkg/net/http/blademaster/perf.go @@ -7,7 +7,7 @@ import ( "os" "sync" - "github.com/bilibili/kratos/pkg/conf/dsn" + "github.com/go-kratos/kratos/pkg/conf/dsn" "github.com/pkg/errors" ) diff --git a/pkg/net/http/blademaster/ratelimit.go b/pkg/net/http/blademaster/ratelimit.go index cacc47b85..e2347a46d 100644 --- a/pkg/net/http/blademaster/ratelimit.go +++ b/pkg/net/http/blademaster/ratelimit.go @@ -5,9 +5,9 @@ import ( "sync/atomic" "time" - "github.com/bilibili/kratos/pkg/log" - limit "github.com/bilibili/kratos/pkg/ratelimit" - "github.com/bilibili/kratos/pkg/ratelimit/bbr" + "github.com/go-kratos/kratos/pkg/log" + limit "github.com/go-kratos/kratos/pkg/ratelimit" + "github.com/go-kratos/kratos/pkg/ratelimit/bbr" ) // RateLimiter bbr middleware. diff --git a/pkg/net/http/blademaster/recovery.go b/pkg/net/http/blademaster/recovery.go index ce2c83dbc..239d496bb 100644 --- a/pkg/net/http/blademaster/recovery.go +++ b/pkg/net/http/blademaster/recovery.go @@ -6,7 +6,7 @@ import ( "os" "runtime" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/log" ) // Recovery returns a middleware that recovers from any panics and writes a 500 if there was one. diff --git a/pkg/net/http/blademaster/server.go b/pkg/net/http/blademaster/server.go index 82cbb92c3..7ad34c027 100644 --- a/pkg/net/http/blademaster/server.go +++ b/pkg/net/http/blademaster/server.go @@ -13,12 +13,12 @@ import ( "sync/atomic" "time" - "github.com/bilibili/kratos/pkg/conf/dsn" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/net/criticality" - "github.com/bilibili/kratos/pkg/net/ip" - "github.com/bilibili/kratos/pkg/net/metadata" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/conf/dsn" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/net/criticality" + "github.com/go-kratos/kratos/pkg/net/ip" + "github.com/go-kratos/kratos/pkg/net/metadata" + xtime "github.com/go-kratos/kratos/pkg/time" "github.com/pkg/errors" ) diff --git a/pkg/net/http/blademaster/server_test.go b/pkg/net/http/blademaster/server_test.go index 16c166980..60343a52d 100644 --- a/pkg/net/http/blademaster/server_test.go +++ b/pkg/net/http/blademaster/server_test.go @@ -10,9 +10,9 @@ import ( "testing" "time" - criticalityPkg "github.com/bilibili/kratos/pkg/net/criticality" - "github.com/bilibili/kratos/pkg/net/metadata" - xtime "github.com/bilibili/kratos/pkg/time" + criticalityPkg "github.com/go-kratos/kratos/pkg/net/criticality" + "github.com/go-kratos/kratos/pkg/net/metadata" + xtime "github.com/go-kratos/kratos/pkg/time" "github.com/stretchr/testify/assert" ) diff --git a/pkg/net/http/blademaster/trace.go b/pkg/net/http/blademaster/trace.go index fcdd6952e..b4625dadb 100644 --- a/pkg/net/http/blademaster/trace.go +++ b/pkg/net/http/blademaster/trace.go @@ -6,8 +6,8 @@ import ( "net/http/httptrace" "strconv" - "github.com/bilibili/kratos/pkg/net/metadata" - "github.com/bilibili/kratos/pkg/net/trace" + "github.com/go-kratos/kratos/pkg/net/metadata" + "github.com/go-kratos/kratos/pkg/net/trace" ) const _defaultComponentName = "net/http" diff --git a/pkg/net/netutil/breaker/breaker.go b/pkg/net/netutil/breaker/breaker.go index 2d4d6ecbd..c8aa87564 100644 --- a/pkg/net/netutil/breaker/breaker.go +++ b/pkg/net/netutil/breaker/breaker.go @@ -4,7 +4,7 @@ import ( "sync" "time" - xtime "github.com/bilibili/kratos/pkg/time" + xtime "github.com/go-kratos/kratos/pkg/time" ) // Config broker config. diff --git a/pkg/net/netutil/breaker/breaker_test.go b/pkg/net/netutil/breaker/breaker_test.go index 6f4b2fc43..28bc2870d 100644 --- a/pkg/net/netutil/breaker/breaker_test.go +++ b/pkg/net/netutil/breaker/breaker_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - xtime "github.com/bilibili/kratos/pkg/time" + xtime "github.com/go-kratos/kratos/pkg/time" ) func TestGroup(t *testing.T) { diff --git a/pkg/net/netutil/breaker/example_test.go b/pkg/net/netutil/breaker/example_test.go index 9afe49d30..d02943d07 100644 --- a/pkg/net/netutil/breaker/example_test.go +++ b/pkg/net/netutil/breaker/example_test.go @@ -4,8 +4,8 @@ import ( "fmt" "time" - "github.com/bilibili/kratos/pkg/net/netutil/breaker" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/net/netutil/breaker" + xtime "github.com/go-kratos/kratos/pkg/time" ) // ExampleGroup show group usage. diff --git a/pkg/net/netutil/breaker/sre_breaker.go b/pkg/net/netutil/breaker/sre_breaker.go index 44ccb4b71..0caa057db 100644 --- a/pkg/net/netutil/breaker/sre_breaker.go +++ b/pkg/net/netutil/breaker/sre_breaker.go @@ -7,9 +7,9 @@ import ( "sync/atomic" "time" - "github.com/bilibili/kratos/pkg/ecode" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/stat/metric" + "github.com/go-kratos/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/stat/metric" ) // sreBreaker is a sre CircuitBreaker pattern. diff --git a/pkg/net/netutil/breaker/sre_breaker_test.go b/pkg/net/netutil/breaker/sre_breaker_test.go index 9df374736..1f54cfd4b 100644 --- a/pkg/net/netutil/breaker/sre_breaker_test.go +++ b/pkg/net/netutil/breaker/sre_breaker_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/stat/metric" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/stat/metric" + xtime "github.com/go-kratos/kratos/pkg/time" "github.com/stretchr/testify/assert" ) diff --git a/pkg/net/rpc/warden/balancer/p2c/p2c.go b/pkg/net/rpc/warden/balancer/p2c/p2c.go index cdb455523..a679ceeea 100644 --- a/pkg/net/rpc/warden/balancer/p2c/p2c.go +++ b/pkg/net/rpc/warden/balancer/p2c/p2c.go @@ -9,11 +9,11 @@ import ( "sync/atomic" "time" - "github.com/bilibili/kratos/pkg/conf/env" + "github.com/go-kratos/kratos/pkg/conf/env" - "github.com/bilibili/kratos/pkg/log" - nmd "github.com/bilibili/kratos/pkg/net/metadata" - wmd "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/metadata" + "github.com/go-kratos/kratos/pkg/log" + nmd "github.com/go-kratos/kratos/pkg/net/metadata" + wmd "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/metadata" "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/base" diff --git a/pkg/net/rpc/warden/balancer/p2c/p2c_test.go b/pkg/net/rpc/warden/balancer/p2c/p2c_test.go index 45385262a..5bb68b441 100644 --- a/pkg/net/rpc/warden/balancer/p2c/p2c_test.go +++ b/pkg/net/rpc/warden/balancer/p2c/p2c_test.go @@ -10,10 +10,10 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/conf/env" + "github.com/go-kratos/kratos/pkg/conf/env" - nmd "github.com/bilibili/kratos/pkg/net/metadata" - wmeta "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/metadata" + nmd "github.com/go-kratos/kratos/pkg/net/metadata" + wmeta "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/metadata" "google.golang.org/grpc/balancer" "google.golang.org/grpc/codes" diff --git a/pkg/net/rpc/warden/balancer/wrr/wrr.go b/pkg/net/rpc/warden/balancer/wrr/wrr.go index 20db27349..b4a98fa04 100644 --- a/pkg/net/rpc/warden/balancer/wrr/wrr.go +++ b/pkg/net/rpc/warden/balancer/wrr/wrr.go @@ -8,11 +8,11 @@ import ( "sync/atomic" "time" - "github.com/bilibili/kratos/pkg/conf/env" - "github.com/bilibili/kratos/pkg/log" - nmd "github.com/bilibili/kratos/pkg/net/metadata" - wmeta "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/metadata" - "github.com/bilibili/kratos/pkg/stat/metric" + "github.com/go-kratos/kratos/pkg/conf/env" + "github.com/go-kratos/kratos/pkg/log" + nmd "github.com/go-kratos/kratos/pkg/net/metadata" + wmeta "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/metadata" + "github.com/go-kratos/kratos/pkg/stat/metric" "google.golang.org/grpc" "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/base" diff --git a/pkg/net/rpc/warden/balancer/wrr/wrr_test.go b/pkg/net/rpc/warden/balancer/wrr/wrr_test.go index c0b26262f..c0126ed5c 100644 --- a/pkg/net/rpc/warden/balancer/wrr/wrr_test.go +++ b/pkg/net/rpc/warden/balancer/wrr/wrr_test.go @@ -8,10 +8,10 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/conf/env" - nmd "github.com/bilibili/kratos/pkg/net/metadata" - wmeta "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/metadata" - "github.com/bilibili/kratos/pkg/stat/metric" + "github.com/go-kratos/kratos/pkg/conf/env" + nmd "github.com/go-kratos/kratos/pkg/net/metadata" + wmeta "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/metadata" + "github.com/go-kratos/kratos/pkg/stat/metric" "github.com/stretchr/testify/assert" "google.golang.org/grpc/balancer" diff --git a/pkg/net/rpc/warden/client.go b/pkg/net/rpc/warden/client.go index adcb49504..ece217314 100644 --- a/pkg/net/rpc/warden/client.go +++ b/pkg/net/rpc/warden/client.go @@ -10,19 +10,19 @@ import ( "sync" "time" - "github.com/bilibili/kratos/pkg/net/rpc/warden/resolver" - "github.com/bilibili/kratos/pkg/net/rpc/warden/resolver/direct" - - "github.com/bilibili/kratos/pkg/conf/env" - "github.com/bilibili/kratos/pkg/conf/flagvar" - "github.com/bilibili/kratos/pkg/ecode" - "github.com/bilibili/kratos/pkg/naming" - nmd "github.com/bilibili/kratos/pkg/net/metadata" - "github.com/bilibili/kratos/pkg/net/netutil/breaker" - "github.com/bilibili/kratos/pkg/net/rpc/warden/balancer/p2c" - "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/status" - "github.com/bilibili/kratos/pkg/net/trace" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/net/rpc/warden/resolver" + "github.com/go-kratos/kratos/pkg/net/rpc/warden/resolver/direct" + + "github.com/go-kratos/kratos/pkg/conf/env" + "github.com/go-kratos/kratos/pkg/conf/flagvar" + "github.com/go-kratos/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/naming" + nmd "github.com/go-kratos/kratos/pkg/net/metadata" + "github.com/go-kratos/kratos/pkg/net/netutil/breaker" + "github.com/go-kratos/kratos/pkg/net/rpc/warden/balancer/p2c" + "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/status" + "github.com/go-kratos/kratos/pkg/net/trace" + xtime "github.com/go-kratos/kratos/pkg/time" "github.com/pkg/errors" "google.golang.org/grpc" diff --git a/pkg/net/rpc/warden/exapmle_test.go b/pkg/net/rpc/warden/exapmle_test.go index 10c037958..d34d038ec 100644 --- a/pkg/net/rpc/warden/exapmle_test.go +++ b/pkg/net/rpc/warden/exapmle_test.go @@ -6,11 +6,11 @@ import ( "io" "time" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/net/netutil/breaker" - "github.com/bilibili/kratos/pkg/net/rpc/warden" - pb "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/proto/testproto" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/net/netutil/breaker" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" + pb "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/proto/testproto" + xtime "github.com/go-kratos/kratos/pkg/time" "google.golang.org/grpc" ) diff --git a/pkg/net/rpc/warden/internal/benchmark/bench/client/client.go b/pkg/net/rpc/warden/internal/benchmark/bench/client/client.go index 62710092a..3691b3580 100644 --- a/pkg/net/rpc/warden/internal/benchmark/bench/client/client.go +++ b/pkg/net/rpc/warden/internal/benchmark/bench/client/client.go @@ -8,10 +8,10 @@ import ( "sync/atomic" "time" - "github.com/bilibili/kratos/pkg/net/netutil/breaker" - "github.com/bilibili/kratos/pkg/net/rpc/warden" - "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/benchmark/bench/proto" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/net/netutil/breaker" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" + "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/benchmark/bench/proto" + xtime "github.com/go-kratos/kratos/pkg/time" goproto "github.com/gogo/protobuf/proto" "github.com/montanaflynn/stats" diff --git a/pkg/net/rpc/warden/internal/benchmark/bench/server/server.go b/pkg/net/rpc/warden/internal/benchmark/bench/server/server.go index 10ae0d39a..755718eed 100644 --- a/pkg/net/rpc/warden/internal/benchmark/bench/server/server.go +++ b/pkg/net/rpc/warden/internal/benchmark/bench/server/server.go @@ -10,9 +10,9 @@ import ( "sync/atomic" "time" - "github.com/bilibili/kratos/pkg/net/rpc/warden" - "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/benchmark/bench/proto" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" + "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/benchmark/bench/proto" + xtime "github.com/go-kratos/kratos/pkg/time" "github.com/prometheus/client_golang/prometheus/promhttp" "google.golang.org/grpc" diff --git a/pkg/net/rpc/warden/internal/benchmark/helloworld/client/greeter_client.go b/pkg/net/rpc/warden/internal/benchmark/helloworld/client/greeter_client.go index d47c50e43..7609ec08a 100644 --- a/pkg/net/rpc/warden/internal/benchmark/helloworld/client/greeter_client.go +++ b/pkg/net/rpc/warden/internal/benchmark/helloworld/client/greeter_client.go @@ -9,10 +9,10 @@ import ( "sync/atomic" "time" - "github.com/bilibili/kratos/pkg/net/netutil/breaker" - "github.com/bilibili/kratos/pkg/net/rpc/warden" - pb "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/proto/testproto" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/net/netutil/breaker" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" + pb "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/proto/testproto" + xtime "github.com/go-kratos/kratos/pkg/time" ) var ( diff --git a/pkg/net/rpc/warden/internal/benchmark/helloworld/server/greeter_server.go b/pkg/net/rpc/warden/internal/benchmark/helloworld/server/greeter_server.go index d9ee56ca6..eb5764cee 100644 --- a/pkg/net/rpc/warden/internal/benchmark/helloworld/server/greeter_server.go +++ b/pkg/net/rpc/warden/internal/benchmark/helloworld/server/greeter_server.go @@ -5,9 +5,9 @@ import ( "net/http" "time" - "github.com/bilibili/kratos/pkg/net/rpc/warden" - pb "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/proto/testproto" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" + pb "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/proto/testproto" + xtime "github.com/go-kratos/kratos/pkg/time" "github.com/prometheus/client_golang/prometheus/promhttp" ) diff --git a/pkg/net/rpc/warden/internal/examples/client/client.go b/pkg/net/rpc/warden/internal/examples/client/client.go index bc22b3a2f..54bd46b37 100644 --- a/pkg/net/rpc/warden/internal/examples/client/client.go +++ b/pkg/net/rpc/warden/internal/examples/client/client.go @@ -5,9 +5,9 @@ import ( "flag" "fmt" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/net/rpc/warden" - pb "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/proto/testproto" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" + pb "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/proto/testproto" ) // usage: ./client -grpc.target=test.service=127.0.0.1:9000 diff --git a/pkg/net/rpc/warden/internal/examples/server/main.go b/pkg/net/rpc/warden/internal/examples/server/main.go index 667e1819b..3c37abdb8 100644 --- a/pkg/net/rpc/warden/internal/examples/server/main.go +++ b/pkg/net/rpc/warden/internal/examples/server/main.go @@ -9,11 +9,11 @@ import ( "syscall" "time" - "github.com/bilibili/kratos/pkg/ecode" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/net/rpc/warden" - pb "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/proto/testproto" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" + pb "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/proto/testproto" + xtime "github.com/go-kratos/kratos/pkg/time" "google.golang.org/grpc" ) diff --git a/pkg/net/rpc/warden/internal/status/status.go b/pkg/net/rpc/warden/internal/status/status.go index e5ceeb241..3e3b02b1e 100644 --- a/pkg/net/rpc/warden/internal/status/status.go +++ b/pkg/net/rpc/warden/internal/status/status.go @@ -4,7 +4,7 @@ import ( "context" "strconv" - "github.com/bilibili/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/ecode" "github.com/golang/protobuf/proto" "github.com/pkg/errors" diff --git a/pkg/net/rpc/warden/internal/status/status_test.go b/pkg/net/rpc/warden/internal/status/status_test.go index 918673630..7998b89fd 100644 --- a/pkg/net/rpc/warden/internal/status/status_test.go +++ b/pkg/net/rpc/warden/internal/status/status_test.go @@ -13,7 +13,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/bilibili/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/ecode" ) func TestCodeConvert(t *testing.T) { diff --git a/pkg/net/rpc/warden/logging.go b/pkg/net/rpc/warden/logging.go index 4cc4a36ad..5c93aea5c 100644 --- a/pkg/net/rpc/warden/logging.go +++ b/pkg/net/rpc/warden/logging.go @@ -9,9 +9,9 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/peer" - "github.com/bilibili/kratos/pkg/ecode" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/net/metadata" + "github.com/go-kratos/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/net/metadata" ) // Warden Log Flag diff --git a/pkg/net/rpc/warden/logging_test.go b/pkg/net/rpc/warden/logging_test.go index c8c829f7b..74ba602df 100644 --- a/pkg/net/rpc/warden/logging_test.go +++ b/pkg/net/rpc/warden/logging_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "google.golang.org/grpc" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/log" ) func Test_logFn(t *testing.T) { diff --git a/pkg/net/rpc/warden/metrics.go b/pkg/net/rpc/warden/metrics.go index c08749bf6..3fd09bb3e 100644 --- a/pkg/net/rpc/warden/metrics.go +++ b/pkg/net/rpc/warden/metrics.go @@ -1,6 +1,6 @@ package warden -import "github.com/bilibili/kratos/pkg/stat/metric" +import "github.com/go-kratos/kratos/pkg/stat/metric" const ( clientNamespace = "grpc_client" diff --git a/pkg/net/rpc/warden/ratelimiter/ratelimiter.go b/pkg/net/rpc/warden/ratelimiter/ratelimiter.go index 297608ff3..3d3c0f756 100644 --- a/pkg/net/rpc/warden/ratelimiter/ratelimiter.go +++ b/pkg/net/rpc/warden/ratelimiter/ratelimiter.go @@ -5,10 +5,10 @@ import ( "sync/atomic" "time" - "github.com/bilibili/kratos/pkg/log" - limit "github.com/bilibili/kratos/pkg/ratelimit" - "github.com/bilibili/kratos/pkg/ratelimit/bbr" - "github.com/bilibili/kratos/pkg/stat/metric" + "github.com/go-kratos/kratos/pkg/log" + limit "github.com/go-kratos/kratos/pkg/ratelimit" + "github.com/go-kratos/kratos/pkg/ratelimit/bbr" + "github.com/go-kratos/kratos/pkg/stat/metric" "google.golang.org/grpc" ) diff --git a/pkg/net/rpc/warden/recovery.go b/pkg/net/rpc/warden/recovery.go index c844a849a..477026aa1 100644 --- a/pkg/net/rpc/warden/recovery.go +++ b/pkg/net/rpc/warden/recovery.go @@ -6,8 +6,8 @@ import ( "os" "runtime" - "github.com/bilibili/kratos/pkg/ecode" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/log" "google.golang.org/grpc" "google.golang.org/grpc/codes" diff --git a/pkg/net/rpc/warden/resolver/direct/direct.go b/pkg/net/rpc/warden/resolver/direct/direct.go index 0445b978a..6a544f366 100644 --- a/pkg/net/rpc/warden/resolver/direct/direct.go +++ b/pkg/net/rpc/warden/resolver/direct/direct.go @@ -5,9 +5,9 @@ import ( "fmt" "strings" - "github.com/bilibili/kratos/pkg/conf/env" - "github.com/bilibili/kratos/pkg/naming" - "github.com/bilibili/kratos/pkg/net/rpc/warden/resolver" + "github.com/go-kratos/kratos/pkg/conf/env" + "github.com/go-kratos/kratos/pkg/naming" + "github.com/go-kratos/kratos/pkg/net/rpc/warden/resolver" ) const ( diff --git a/pkg/net/rpc/warden/resolver/direct/test/direct_test.go b/pkg/net/rpc/warden/resolver/direct/test/direct_test.go index cc3b65112..690f3415a 100644 --- a/pkg/net/rpc/warden/resolver/direct/test/direct_test.go +++ b/pkg/net/rpc/warden/resolver/direct/test/direct_test.go @@ -7,12 +7,12 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/net/netutil/breaker" - "github.com/bilibili/kratos/pkg/net/rpc/warden" - pb "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/proto/testproto" - "github.com/bilibili/kratos/pkg/net/rpc/warden/resolver" - "github.com/bilibili/kratos/pkg/net/rpc/warden/resolver/direct" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/net/netutil/breaker" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" + pb "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/proto/testproto" + "github.com/go-kratos/kratos/pkg/net/rpc/warden/resolver" + "github.com/go-kratos/kratos/pkg/net/rpc/warden/resolver/direct" + xtime "github.com/go-kratos/kratos/pkg/time" ) type testServer struct { diff --git a/pkg/net/rpc/warden/resolver/resolver.go b/pkg/net/rpc/warden/resolver/resolver.go index 1b5f51141..c238d8cad 100644 --- a/pkg/net/rpc/warden/resolver/resolver.go +++ b/pkg/net/rpc/warden/resolver/resolver.go @@ -7,10 +7,10 @@ import ( "strings" "sync" - "github.com/bilibili/kratos/pkg/conf/env" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/naming" - wmeta "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/metadata" + "github.com/go-kratos/kratos/pkg/conf/env" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/naming" + wmeta "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/metadata" "github.com/pkg/errors" "google.golang.org/grpc/resolver" diff --git a/pkg/net/rpc/warden/resolver/test/mockdiscovery.go b/pkg/net/rpc/warden/resolver/test/mockdiscovery.go index edf6fd75e..586913049 100644 --- a/pkg/net/rpc/warden/resolver/test/mockdiscovery.go +++ b/pkg/net/rpc/warden/resolver/test/mockdiscovery.go @@ -3,8 +3,8 @@ package resolver import ( "context" - "github.com/bilibili/kratos/pkg/conf/env" - "github.com/bilibili/kratos/pkg/naming" + "github.com/go-kratos/kratos/pkg/conf/env" + "github.com/go-kratos/kratos/pkg/naming" ) type mockDiscoveryBuilder struct { diff --git a/pkg/net/rpc/warden/resolver/test/resovler_test.go b/pkg/net/rpc/warden/resolver/test/resovler_test.go index 7af8873a0..9d763a653 100644 --- a/pkg/net/rpc/warden/resolver/test/resovler_test.go +++ b/pkg/net/rpc/warden/resolver/test/resovler_test.go @@ -7,13 +7,13 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/conf/env" - "github.com/bilibili/kratos/pkg/naming" - "github.com/bilibili/kratos/pkg/net/netutil/breaker" - "github.com/bilibili/kratos/pkg/net/rpc/warden" - pb "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/proto/testproto" - "github.com/bilibili/kratos/pkg/net/rpc/warden/resolver" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/conf/env" + "github.com/go-kratos/kratos/pkg/naming" + "github.com/go-kratos/kratos/pkg/net/netutil/breaker" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" + pb "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/proto/testproto" + "github.com/go-kratos/kratos/pkg/net/rpc/warden/resolver" + xtime "github.com/go-kratos/kratos/pkg/time" "github.com/stretchr/testify/assert" ) diff --git a/pkg/net/rpc/warden/server.go b/pkg/net/rpc/warden/server.go index 4cf74bba9..5edc558d3 100644 --- a/pkg/net/rpc/warden/server.go +++ b/pkg/net/rpc/warden/server.go @@ -10,16 +10,16 @@ import ( "sync" "time" - "github.com/bilibili/kratos/pkg/conf/dsn" - "github.com/bilibili/kratos/pkg/log" - nmd "github.com/bilibili/kratos/pkg/net/metadata" - "github.com/bilibili/kratos/pkg/net/rpc/warden/ratelimiter" - "github.com/bilibili/kratos/pkg/net/trace" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/conf/dsn" + "github.com/go-kratos/kratos/pkg/log" + nmd "github.com/go-kratos/kratos/pkg/net/metadata" + "github.com/go-kratos/kratos/pkg/net/rpc/warden/ratelimiter" + "github.com/go-kratos/kratos/pkg/net/trace" + xtime "github.com/go-kratos/kratos/pkg/time" //this package is for json format response - _ "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/encoding/json" - "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/status" + _ "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/encoding/json" + "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/status" "github.com/pkg/errors" "google.golang.org/grpc" diff --git a/pkg/net/rpc/warden/server_test.go b/pkg/net/rpc/warden/server_test.go index 18c508685..307b98554 100644 --- a/pkg/net/rpc/warden/server_test.go +++ b/pkg/net/rpc/warden/server_test.go @@ -13,13 +13,13 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/ecode" - "github.com/bilibili/kratos/pkg/log" - nmd "github.com/bilibili/kratos/pkg/net/metadata" - "github.com/bilibili/kratos/pkg/net/netutil/breaker" - pb "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/proto/testproto" - xtrace "github.com/bilibili/kratos/pkg/net/trace" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/log" + nmd "github.com/go-kratos/kratos/pkg/net/metadata" + "github.com/go-kratos/kratos/pkg/net/netutil/breaker" + pb "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/proto/testproto" + xtrace "github.com/go-kratos/kratos/pkg/net/trace" + xtime "github.com/go-kratos/kratos/pkg/time" "github.com/pkg/errors" "github.com/stretchr/testify/assert" diff --git a/pkg/net/rpc/warden/stats.go b/pkg/net/rpc/warden/stats.go index 22ea8fef7..924ba51f5 100644 --- a/pkg/net/rpc/warden/stats.go +++ b/pkg/net/rpc/warden/stats.go @@ -4,8 +4,8 @@ import ( "context" "strconv" - nmd "github.com/bilibili/kratos/pkg/net/rpc/warden/internal/metadata" - "github.com/bilibili/kratos/pkg/stat/sys/cpu" + nmd "github.com/go-kratos/kratos/pkg/net/rpc/warden/internal/metadata" + "github.com/go-kratos/kratos/pkg/stat/sys/cpu" "google.golang.org/grpc" gmd "google.golang.org/grpc/metadata" diff --git a/pkg/net/rpc/warden/validate.go b/pkg/net/rpc/warden/validate.go index 00af9ef8e..f9444fca0 100644 --- a/pkg/net/rpc/warden/validate.go +++ b/pkg/net/rpc/warden/validate.go @@ -3,7 +3,7 @@ package warden import ( "context" - "github.com/bilibili/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/ecode" "google.golang.org/grpc" "gopkg.in/go-playground/validator.v9" diff --git a/pkg/net/trace/config.go b/pkg/net/trace/config.go index 7741dc147..3f46cf9cc 100644 --- a/pkg/net/trace/config.go +++ b/pkg/net/trace/config.go @@ -8,9 +8,9 @@ import ( "github.com/pkg/errors" - "github.com/bilibili/kratos/pkg/conf/dsn" - "github.com/bilibili/kratos/pkg/conf/env" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/conf/dsn" + "github.com/go-kratos/kratos/pkg/conf/env" + xtime "github.com/go-kratos/kratos/pkg/time" ) var _traceDSN = "unixgram:///var/run/dapper-collect/dapper-collect.sock" diff --git a/pkg/net/trace/marshal.go b/pkg/net/trace/marshal.go index 5553bdf84..d92c484da 100644 --- a/pkg/net/trace/marshal.go +++ b/pkg/net/trace/marshal.go @@ -11,7 +11,7 @@ import ( "github.com/golang/protobuf/ptypes/duration" "github.com/golang/protobuf/ptypes/timestamp" - protogen "github.com/bilibili/kratos/pkg/net/trace/proto" + protogen "github.com/go-kratos/kratos/pkg/net/trace/proto" ) const protoVersion1 int32 = 1 diff --git a/pkg/net/trace/mocktrace/mocktrace.go b/pkg/net/trace/mocktrace/mocktrace.go index e04fcf8cf..4fcf2c561 100644 --- a/pkg/net/trace/mocktrace/mocktrace.go +++ b/pkg/net/trace/mocktrace/mocktrace.go @@ -1,7 +1,7 @@ package mocktrace import ( - "github.com/bilibili/kratos/pkg/net/trace" + "github.com/go-kratos/kratos/pkg/net/trace" ) // MockTrace . diff --git a/pkg/net/trace/span.go b/pkg/net/trace/span.go index ef349beff..fd6699abd 100644 --- a/pkg/net/trace/span.go +++ b/pkg/net/trace/span.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - protogen "github.com/bilibili/kratos/pkg/net/trace/proto" + protogen "github.com/go-kratos/kratos/pkg/net/trace/proto" ) const ( diff --git a/pkg/net/trace/util.go b/pkg/net/trace/util.go index a786a3619..358cb0dc2 100644 --- a/pkg/net/trace/util.go +++ b/pkg/net/trace/util.go @@ -6,8 +6,8 @@ import ( "math/rand" "time" - "github.com/bilibili/kratos/pkg/conf/env" - "github.com/bilibili/kratos/pkg/net/ip" + "github.com/go-kratos/kratos/pkg/conf/env" + "github.com/go-kratos/kratos/pkg/net/ip" "github.com/pkg/errors" ) diff --git a/pkg/net/trace/zipkin/config.go b/pkg/net/trace/zipkin/config.go index 37e3037e8..31d89371b 100644 --- a/pkg/net/trace/zipkin/config.go +++ b/pkg/net/trace/zipkin/config.go @@ -3,9 +3,9 @@ package zipkin import ( "time" - "github.com/bilibili/kratos/pkg/conf/env" - "github.com/bilibili/kratos/pkg/net/trace" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/conf/env" + "github.com/go-kratos/kratos/pkg/net/trace" + xtime "github.com/go-kratos/kratos/pkg/time" ) // Config config. diff --git a/pkg/net/trace/zipkin/zipkin.go b/pkg/net/trace/zipkin/zipkin.go index e53069a84..747bae4c5 100644 --- a/pkg/net/trace/zipkin/zipkin.go +++ b/pkg/net/trace/zipkin/zipkin.go @@ -2,10 +2,10 @@ package zipkin import ( "fmt" - protogen "github.com/bilibili/kratos/pkg/net/trace/proto" + protogen "github.com/go-kratos/kratos/pkg/net/trace/proto" "time" - "github.com/bilibili/kratos/pkg/net/trace" + "github.com/go-kratos/kratos/pkg/net/trace" "github.com/openzipkin/zipkin-go/model" "github.com/openzipkin/zipkin-go/reporter" "github.com/openzipkin/zipkin-go/reporter/http" diff --git a/pkg/net/trace/zipkin/zipkin_test.go b/pkg/net/trace/zipkin/zipkin_test.go index c65dd5888..394a74a64 100644 --- a/pkg/net/trace/zipkin/zipkin_test.go +++ b/pkg/net/trace/zipkin/zipkin_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/net/trace" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/net/trace" + xtime "github.com/go-kratos/kratos/pkg/time" ) func TestZipkin(t *testing.T) { diff --git a/pkg/ratelimit/bbr/bbr.go b/pkg/ratelimit/bbr/bbr.go index 98a9d648e..7bc898b3c 100644 --- a/pkg/ratelimit/bbr/bbr.go +++ b/pkg/ratelimit/bbr/bbr.go @@ -6,13 +6,13 @@ import ( "sync/atomic" "time" - "github.com/bilibili/kratos/pkg/container/group" - "github.com/bilibili/kratos/pkg/ecode" - "github.com/bilibili/kratos/pkg/log" - limit "github.com/bilibili/kratos/pkg/ratelimit" - "github.com/bilibili/kratos/pkg/stat/metric" + "github.com/go-kratos/kratos/pkg/container/group" + "github.com/go-kratos/kratos/pkg/ecode" + "github.com/go-kratos/kratos/pkg/log" + limit "github.com/go-kratos/kratos/pkg/ratelimit" + "github.com/go-kratos/kratos/pkg/stat/metric" - cpustat "github.com/bilibili/kratos/pkg/stat/sys/cpu" + cpustat "github.com/go-kratos/kratos/pkg/stat/sys/cpu" ) var ( diff --git a/pkg/ratelimit/bbr/bbr_test.go b/pkg/ratelimit/bbr/bbr_test.go index aff053af8..2d78493ee 100644 --- a/pkg/ratelimit/bbr/bbr_test.go +++ b/pkg/ratelimit/bbr/bbr_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/ratelimit" - "github.com/bilibili/kratos/pkg/stat/metric" + "github.com/go-kratos/kratos/pkg/ratelimit" + "github.com/go-kratos/kratos/pkg/stat/metric" "github.com/stretchr/testify/assert" ) diff --git a/pkg/sync/pipeline/fanout/fanout.go b/pkg/sync/pipeline/fanout/fanout.go index 8636f4a7e..2253395ce 100644 --- a/pkg/sync/pipeline/fanout/fanout.go +++ b/pkg/sync/pipeline/fanout/fanout.go @@ -6,9 +6,9 @@ import ( "runtime" "sync" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/net/metadata" - "github.com/bilibili/kratos/pkg/net/trace" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/net/metadata" + "github.com/go-kratos/kratos/pkg/net/trace" ) var ( diff --git a/pkg/sync/pipeline/fanout/metrics.go b/pkg/sync/pipeline/fanout/metrics.go index 0f0d9fef5..6a7207326 100644 --- a/pkg/sync/pipeline/fanout/metrics.go +++ b/pkg/sync/pipeline/fanout/metrics.go @@ -1,7 +1,7 @@ package fanout import ( - "github.com/bilibili/kratos/pkg/stat/metric" + "github.com/go-kratos/kratos/pkg/stat/metric" ) const ( diff --git a/pkg/sync/pipeline/pipeline.go b/pkg/sync/pipeline/pipeline.go index 9b65824d6..22221c6f6 100644 --- a/pkg/sync/pipeline/pipeline.go +++ b/pkg/sync/pipeline/pipeline.go @@ -7,9 +7,9 @@ import ( "sync" "time" - "github.com/bilibili/kratos/pkg/net/metadata" - "github.com/bilibili/kratos/pkg/stat/metric" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/net/metadata" + "github.com/go-kratos/kratos/pkg/stat/metric" + xtime "github.com/go-kratos/kratos/pkg/time" ) // ErrFull channel full error diff --git a/pkg/sync/pipeline/pipeline_test.go b/pkg/sync/pipeline/pipeline_test.go index 79aa27762..ea9d61838 100644 --- a/pkg/sync/pipeline/pipeline_test.go +++ b/pkg/sync/pipeline/pipeline_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "github.com/bilibili/kratos/pkg/net/metadata" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/net/metadata" + xtime "github.com/go-kratos/kratos/pkg/time" ) func TestPipeline(t *testing.T) { diff --git a/pkg/testing/lich/README.md b/pkg/testing/lich/README.md index 180224fb5..11260fa8d 100644 --- a/pkg/testing/lich/README.md +++ b/pkg/testing/lich/README.md @@ -1,4 +1,4 @@ ## testing/lich 运行环境构建 基于 docker-compose 实现跨平台跨语言环境的容器依赖管理方案,以解决运行ut场景下的 (mysql, redis, mc)容器依赖问题。 -使用说明参见:https://github.com/bilibili/kratos/tree/master/tool/testcli/README.md \ No newline at end of file +使用说明参见:https://github.com/go-kratos/kratos/tree/master/tool/testcli/README.md \ No newline at end of file diff --git a/pkg/testing/lich/composer.go b/pkg/testing/lich/composer.go index 4ed28278f..21ac82d07 100644 --- a/pkg/testing/lich/composer.go +++ b/pkg/testing/lich/composer.go @@ -12,7 +12,7 @@ import ( "runtime" "time" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/log" ) var ( diff --git a/pkg/testing/lich/healthcheck.go b/pkg/testing/lich/healthcheck.go index 9e5fa1958..68bc758ee 100644 --- a/pkg/testing/lich/healthcheck.go +++ b/pkg/testing/lich/healthcheck.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/log" // Register go-sql-driver stuff _ "github.com/go-sql-driver/mysql" ) diff --git a/tool/kratos-gen-bts/header_template.go b/tool/kratos-gen-bts/header_template.go index 5d130b132..613e886b7 100644 --- a/tool/kratos-gen-bts/header_template.go +++ b/tool/kratos-gen-bts/header_template.go @@ -17,8 +17,8 @@ import ( "context" {{if .EnableBatch }}"sync"{{end}} NEWLINE - "github.com/bilibili/kratos/pkg/cache" - {{if .EnableBatch }}"github.com/bilibili/kratos/pkg/sync/errgroup"{{end}} + "github.com/go-kratos/kratos/pkg/cache" + {{if .EnableBatch }}"github.com/go-kratos/kratos/pkg/sync/errgroup"{{end}} {{.ImportPackage}} NEWLINE {{if .EnableSingleFlight}} "golang.org/x/sync/singleflight" {{end}} diff --git a/tool/kratos-gen-bts/main.go b/tool/kratos-gen-bts/main.go index 415999da4..f33e074ac 100644 --- a/tool/kratos-gen-bts/main.go +++ b/tool/kratos-gen-bts/main.go @@ -15,7 +15,7 @@ import ( "strings" "text/template" - "github.com/bilibili/kratos/tool/pkg" + "github.com/go-kratos/kratos/tool/pkg" ) var ( diff --git a/tool/kratos-gen-bts/testdata/dao.bts.go b/tool/kratos-gen-bts/testdata/dao.bts.go index ced05553b..cba448576 100644 --- a/tool/kratos-gen-bts/testdata/dao.bts.go +++ b/tool/kratos-gen-bts/testdata/dao.bts.go @@ -23,8 +23,8 @@ import ( "context" "sync" - "github.com/bilibili/kratos/pkg/cache" - "github.com/bilibili/kratos/pkg/sync/errgroup" + "github.com/go-kratos/kratos/pkg/cache" + "github.com/go-kratos/kratos/pkg/sync/errgroup" ) var _ _bts diff --git a/tool/kratos-gen-bts/testdata/dao.go b/tool/kratos-gen-bts/testdata/dao.go index e3e68edfc..1958f8424 100644 --- a/tool/kratos-gen-bts/testdata/dao.go +++ b/tool/kratos-gen-bts/testdata/dao.go @@ -3,7 +3,7 @@ package testdata import ( "context" - "github.com/bilibili/kratos/pkg/sync/pipeline/fanout" + "github.com/go-kratos/kratos/pkg/sync/pipeline/fanout" ) // Demo test struct diff --git a/tool/kratos-gen-mc/header_template.go b/tool/kratos-gen-mc/header_template.go index ad53e8a17..5c6cf763e 100644 --- a/tool/kratos-gen-mc/header_template.go +++ b/tool/kratos-gen-mc/header_template.go @@ -19,9 +19,9 @@ import ( {{if .UseStrConv}}"strconv"{{end}} {{if .EnableBatch }}"sync"{{end}} NEWLINE - {{if .UseMemcached }}"github.com/bilibili/kratos/pkg/cache/memcache"{{end}} - {{if .EnableBatch }}"github.com/bilibili/kratos/pkg/sync/errgroup"{{end}} - "github.com/bilibili/kratos/pkg/log" + {{if .UseMemcached }}"github.com/go-kratos/kratos/pkg/cache/memcache"{{end}} + {{if .EnableBatch }}"github.com/go-kratos/kratos/pkg/sync/errgroup"{{end}} + "github.com/go-kratos/kratos/pkg/log" {{.ImportPackage}} ) diff --git a/tool/kratos-gen-mc/main.go b/tool/kratos-gen-mc/main.go index 1e8bd39b3..156510b69 100644 --- a/tool/kratos-gen-mc/main.go +++ b/tool/kratos-gen-mc/main.go @@ -14,7 +14,7 @@ import ( "strings" "text/template" - common "github.com/bilibili/kratos/tool/pkg" + common "github.com/go-kratos/kratos/tool/pkg" ) var ( diff --git a/tool/kratos-gen-mc/testdata/dao.go b/tool/kratos-gen-mc/testdata/dao.go index 069e34f78..a9a0e9d8e 100644 --- a/tool/kratos-gen-mc/testdata/dao.go +++ b/tool/kratos-gen-mc/testdata/dao.go @@ -5,9 +5,9 @@ import ( "fmt" "time" - "github.com/bilibili/kratos/pkg/cache/memcache" - "github.com/bilibili/kratos/pkg/container/pool" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/cache/memcache" + "github.com/go-kratos/kratos/pkg/container/pool" + xtime "github.com/go-kratos/kratos/pkg/time" ) // Dao . diff --git a/tool/kratos-gen-mc/testdata/mc.cache.go b/tool/kratos-gen-mc/testdata/mc.cache.go index ff058c509..bfde3c273 100644 --- a/tool/kratos-gen-mc/testdata/mc.cache.go +++ b/tool/kratos-gen-mc/testdata/mc.cache.go @@ -46,8 +46,8 @@ import ( "context" "fmt" - "github.com/bilibili/kratos/pkg/cache/memcache" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/cache/memcache" + "github.com/go-kratos/kratos/pkg/log" ) var ( diff --git a/tool/kratos-gen-project/main-packr.go b/tool/kratos-gen-project/main-packr.go index 7fbe0329b..6766d9531 100644 --- a/tool/kratos-gen-project/main-packr.go +++ b/tool/kratos-gen-project/main-packr.go @@ -5,4 +5,4 @@ // and any other packr generated files. package main -import _ "github.com/bilibili/kratos/tool/kratos-gen-project/packrd" +import _ "github.com/go-kratos/kratos/tool/kratos-gen-project/packrd" diff --git a/tool/kratos-gen-project/new.go b/tool/kratos-gen-project/new.go index cb6b0c489..cbe3280ba 100644 --- a/tool/kratos-gen-project/new.go +++ b/tool/kratos-gen-project/new.go @@ -7,7 +7,7 @@ import ( "path/filepath" "strings" - common "github.com/bilibili/kratos/tool/pkg" + common "github.com/go-kratos/kratos/tool/pkg" "github.com/urfave/cli/v2" ) diff --git a/tool/kratos-gen-project/templates/all/api/client.go.tmpl b/tool/kratos-gen-project/templates/all/api/client.go.tmpl index 2b0875e89..f3a3b2083 100644 --- a/tool/kratos-gen-project/templates/all/api/client.go.tmpl +++ b/tool/kratos-gen-project/templates/all/api/client.go.tmpl @@ -3,7 +3,7 @@ import ( "context" "fmt" - "github.com/bilibili/kratos/pkg/net/rpc/warden" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" "google.golang.org/grpc" ) diff --git a/tool/kratos-gen-project/templates/all/cmd/main.go.tmpl b/tool/kratos-gen-project/templates/all/cmd/main.go.tmpl index ed688073d..de1aefec2 100644 --- a/tool/kratos-gen-project/templates/all/cmd/main.go.tmpl +++ b/tool/kratos-gen-project/templates/all/cmd/main.go.tmpl @@ -8,8 +8,8 @@ import ( "time" "{{.ModPrefix}}{{.Name}}/internal/di" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/log" ) func main() { diff --git a/tool/kratos-gen-project/templates/all/go.mod.tmpl b/tool/kratos-gen-project/templates/all/go.mod.tmpl index 9688cabc4..e9345c5be 100644 --- a/tool/kratos-gen-project/templates/all/go.mod.tmpl +++ b/tool/kratos-gen-project/templates/all/go.mod.tmpl @@ -3,7 +3,7 @@ module {{.Name}} go 1.13 require ( - github.com/bilibili/kratos master + github.com/go-kratos/kratos master github.com/gogo/protobuf v1.2.1 github.com/golang/protobuf v1.3.2 golang.org/x/net v0.0.0-20190628185345-da137c7871d7 diff --git a/tool/kratos-gen-project/templates/all/internal/dao/dao.go.tmpl b/tool/kratos-gen-project/templates/all/internal/dao/dao.go.tmpl index b4dcd724b..a67d0a8e4 100644 --- a/tool/kratos-gen-project/templates/all/internal/dao/dao.go.tmpl +++ b/tool/kratos-gen-project/templates/all/internal/dao/dao.go.tmpl @@ -5,12 +5,12 @@ import ( "time" "{{.ModPrefix}}{{.Name}}/internal/model" - "github.com/bilibili/kratos/pkg/cache/memcache" - "github.com/bilibili/kratos/pkg/cache/redis" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/database/sql" - "github.com/bilibili/kratos/pkg/sync/pipeline/fanout" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/cache/memcache" + "github.com/go-kratos/kratos/pkg/cache/redis" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/database/sql" + "github.com/go-kratos/kratos/pkg/sync/pipeline/fanout" + xtime "github.com/go-kratos/kratos/pkg/time" "github.com/google/wire" ) diff --git a/tool/kratos-gen-project/templates/all/internal/dao/dao_test.go.tmpl b/tool/kratos-gen-project/templates/all/internal/dao/dao_test.go.tmpl index 5386b18b0..90849e012 100644 --- a/tool/kratos-gen-project/templates/all/internal/dao/dao_test.go.tmpl +++ b/tool/kratos-gen-project/templates/all/internal/dao/dao_test.go.tmpl @@ -6,8 +6,8 @@ import ( "os" "testing" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/testing/lich" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/testing/lich" ) var d *dao diff --git a/tool/kratos-gen-project/templates/all/internal/dao/db.go.tmpl b/tool/kratos-gen-project/templates/all/internal/dao/db.go.tmpl index bc105f7e5..b3bde3064 100644 --- a/tool/kratos-gen-project/templates/all/internal/dao/db.go.tmpl +++ b/tool/kratos-gen-project/templates/all/internal/dao/db.go.tmpl @@ -4,8 +4,8 @@ import ( "context" "{{.ModPrefix}}{{.Name}}/internal/model" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/database/sql" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/database/sql" ) func NewDB() (db *sql.DB, cf func(), err error) { diff --git a/tool/kratos-gen-project/templates/all/internal/dao/mc.go.tmpl b/tool/kratos-gen-project/templates/all/internal/dao/mc.go.tmpl index a9cd1651a..44cfdf13b 100644 --- a/tool/kratos-gen-project/templates/all/internal/dao/mc.go.tmpl +++ b/tool/kratos-gen-project/templates/all/internal/dao/mc.go.tmpl @@ -5,9 +5,9 @@ import ( "fmt" "{{.ModPrefix}}{{.Name}}/internal/model" - "github.com/bilibili/kratos/pkg/cache/memcache" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/cache/memcache" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/log" ) //go:generate kratos tool genmc diff --git a/tool/kratos-gen-project/templates/all/internal/dao/redis.go.tmpl b/tool/kratos-gen-project/templates/all/internal/dao/redis.go.tmpl index 009d207e1..e3c962eee 100644 --- a/tool/kratos-gen-project/templates/all/internal/dao/redis.go.tmpl +++ b/tool/kratos-gen-project/templates/all/internal/dao/redis.go.tmpl @@ -3,9 +3,9 @@ package dao import ( "context" - "github.com/bilibili/kratos/pkg/cache/redis" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/cache/redis" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/log" ) func NewRedis() (r *redis.Redis, cf func(), err error) { diff --git a/tool/kratos-gen-project/templates/all/internal/di/app.go.tmpl b/tool/kratos-gen-project/templates/all/internal/di/app.go.tmpl index b7fb28f1a..14e2d2a71 100644 --- a/tool/kratos-gen-project/templates/all/internal/di/app.go.tmpl +++ b/tool/kratos-gen-project/templates/all/internal/di/app.go.tmpl @@ -6,9 +6,9 @@ import ( "{{.ModPrefix}}{{.Name}}/internal/service" - "github.com/bilibili/kratos/pkg/log" - bm "github.com/bilibili/kratos/pkg/net/http/blademaster" - "github.com/bilibili/kratos/pkg/net/rpc/warden" + "github.com/go-kratos/kratos/pkg/log" + bm "github.com/go-kratos/kratos/pkg/net/http/blademaster" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" ) //go:generate kratos tool wire diff --git a/tool/kratos-gen-project/templates/all/internal/server/grpc/server.go.tmpl b/tool/kratos-gen-project/templates/all/internal/server/grpc/server.go.tmpl index 2968e719a..4db767635 100644 --- a/tool/kratos-gen-project/templates/all/internal/server/grpc/server.go.tmpl +++ b/tool/kratos-gen-project/templates/all/internal/server/grpc/server.go.tmpl @@ -3,8 +3,8 @@ package grpc import ( pb "{{.ModPrefix}}{{.Name}}/api" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/net/rpc/warden" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" ) // New new a grpc server. diff --git a/tool/kratos-gen-project/templates/all/internal/server/http/server.go.tmpl b/tool/kratos-gen-project/templates/all/internal/server/http/server.go.tmpl index 2f6d4ab5c..3bec93a28 100644 --- a/tool/kratos-gen-project/templates/all/internal/server/http/server.go.tmpl +++ b/tool/kratos-gen-project/templates/all/internal/server/http/server.go.tmpl @@ -5,9 +5,9 @@ import ( pb "{{.ModPrefix}}{{.Name}}/api" "{{.ModPrefix}}{{.Name}}/internal/model" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/log" - bm "github.com/bilibili/kratos/pkg/net/http/blademaster" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/log" + bm "github.com/go-kratos/kratos/pkg/net/http/blademaster" ) var svc pb.DemoServer diff --git a/tool/kratos-gen-project/templates/all/internal/service/service.go.tmpl b/tool/kratos-gen-project/templates/all/internal/service/service.go.tmpl index 63461cd1e..f3750cc69 100644 --- a/tool/kratos-gen-project/templates/all/internal/service/service.go.tmpl +++ b/tool/kratos-gen-project/templates/all/internal/service/service.go.tmpl @@ -6,7 +6,7 @@ import ( pb "{{.ModPrefix}}{{.Name}}/api" "{{.ModPrefix}}{{.Name}}/internal/dao" - "github.com/bilibili/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/conf/paladin" "github.com/golang/protobuf/ptypes/empty" "github.com/google/wire" diff --git a/tool/kratos-gen-project/templates/grpc/api/client.go.tmpl b/tool/kratos-gen-project/templates/grpc/api/client.go.tmpl index b738a7a0c..854cc383a 100644 --- a/tool/kratos-gen-project/templates/grpc/api/client.go.tmpl +++ b/tool/kratos-gen-project/templates/grpc/api/client.go.tmpl @@ -3,7 +3,7 @@ import ( "context" "fmt" - "github.com/bilibili/kratos/pkg/net/rpc/warden" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" "google.golang.org/grpc" ) diff --git a/tool/kratos-gen-project/templates/grpc/cmd/main.go.tmpl b/tool/kratos-gen-project/templates/grpc/cmd/main.go.tmpl index ed688073d..de1aefec2 100644 --- a/tool/kratos-gen-project/templates/grpc/cmd/main.go.tmpl +++ b/tool/kratos-gen-project/templates/grpc/cmd/main.go.tmpl @@ -8,8 +8,8 @@ import ( "time" "{{.ModPrefix}}{{.Name}}/internal/di" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/log" ) func main() { diff --git a/tool/kratos-gen-project/templates/grpc/go.mod.tmpl b/tool/kratos-gen-project/templates/grpc/go.mod.tmpl index 9688cabc4..e9345c5be 100644 --- a/tool/kratos-gen-project/templates/grpc/go.mod.tmpl +++ b/tool/kratos-gen-project/templates/grpc/go.mod.tmpl @@ -3,7 +3,7 @@ module {{.Name}} go 1.13 require ( - github.com/bilibili/kratos master + github.com/go-kratos/kratos master github.com/gogo/protobuf v1.2.1 github.com/golang/protobuf v1.3.2 golang.org/x/net v0.0.0-20190628185345-da137c7871d7 diff --git a/tool/kratos-gen-project/templates/grpc/internal/dao/dao.go.tmpl b/tool/kratos-gen-project/templates/grpc/internal/dao/dao.go.tmpl index b4dcd724b..a67d0a8e4 100644 --- a/tool/kratos-gen-project/templates/grpc/internal/dao/dao.go.tmpl +++ b/tool/kratos-gen-project/templates/grpc/internal/dao/dao.go.tmpl @@ -5,12 +5,12 @@ import ( "time" "{{.ModPrefix}}{{.Name}}/internal/model" - "github.com/bilibili/kratos/pkg/cache/memcache" - "github.com/bilibili/kratos/pkg/cache/redis" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/database/sql" - "github.com/bilibili/kratos/pkg/sync/pipeline/fanout" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/cache/memcache" + "github.com/go-kratos/kratos/pkg/cache/redis" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/database/sql" + "github.com/go-kratos/kratos/pkg/sync/pipeline/fanout" + xtime "github.com/go-kratos/kratos/pkg/time" "github.com/google/wire" ) diff --git a/tool/kratos-gen-project/templates/grpc/internal/dao/dao_test.go.tmpl b/tool/kratos-gen-project/templates/grpc/internal/dao/dao_test.go.tmpl index 5386b18b0..90849e012 100644 --- a/tool/kratos-gen-project/templates/grpc/internal/dao/dao_test.go.tmpl +++ b/tool/kratos-gen-project/templates/grpc/internal/dao/dao_test.go.tmpl @@ -6,8 +6,8 @@ import ( "os" "testing" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/testing/lich" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/testing/lich" ) var d *dao diff --git a/tool/kratos-gen-project/templates/grpc/internal/dao/db.go.tmpl b/tool/kratos-gen-project/templates/grpc/internal/dao/db.go.tmpl index bc105f7e5..b3bde3064 100644 --- a/tool/kratos-gen-project/templates/grpc/internal/dao/db.go.tmpl +++ b/tool/kratos-gen-project/templates/grpc/internal/dao/db.go.tmpl @@ -4,8 +4,8 @@ import ( "context" "{{.ModPrefix}}{{.Name}}/internal/model" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/database/sql" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/database/sql" ) func NewDB() (db *sql.DB, cf func(), err error) { diff --git a/tool/kratos-gen-project/templates/grpc/internal/dao/mc.go.tmpl b/tool/kratos-gen-project/templates/grpc/internal/dao/mc.go.tmpl index a9cd1651a..44cfdf13b 100644 --- a/tool/kratos-gen-project/templates/grpc/internal/dao/mc.go.tmpl +++ b/tool/kratos-gen-project/templates/grpc/internal/dao/mc.go.tmpl @@ -5,9 +5,9 @@ import ( "fmt" "{{.ModPrefix}}{{.Name}}/internal/model" - "github.com/bilibili/kratos/pkg/cache/memcache" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/cache/memcache" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/log" ) //go:generate kratos tool genmc diff --git a/tool/kratos-gen-project/templates/grpc/internal/dao/redis.go.tmpl b/tool/kratos-gen-project/templates/grpc/internal/dao/redis.go.tmpl index 009d207e1..e3c962eee 100644 --- a/tool/kratos-gen-project/templates/grpc/internal/dao/redis.go.tmpl +++ b/tool/kratos-gen-project/templates/grpc/internal/dao/redis.go.tmpl @@ -3,9 +3,9 @@ package dao import ( "context" - "github.com/bilibili/kratos/pkg/cache/redis" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/cache/redis" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/log" ) func NewRedis() (r *redis.Redis, cf func(), err error) { diff --git a/tool/kratos-gen-project/templates/grpc/internal/di/app.go.tmpl b/tool/kratos-gen-project/templates/grpc/internal/di/app.go.tmpl index 3dfadc168..f660e4f15 100644 --- a/tool/kratos-gen-project/templates/grpc/internal/di/app.go.tmpl +++ b/tool/kratos-gen-project/templates/grpc/internal/di/app.go.tmpl @@ -6,8 +6,8 @@ import ( "{{.ModPrefix}}{{.Name}}/internal/service" - "github.com/bilibili/kratos/pkg/log" - "github.com/bilibili/kratos/pkg/net/rpc/warden" + "github.com/go-kratos/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" ) //go:generate kratos tool wire diff --git a/tool/kratos-gen-project/templates/grpc/internal/server/grpc/server.go.tmpl b/tool/kratos-gen-project/templates/grpc/internal/server/grpc/server.go.tmpl index 2968e719a..4db767635 100644 --- a/tool/kratos-gen-project/templates/grpc/internal/server/grpc/server.go.tmpl +++ b/tool/kratos-gen-project/templates/grpc/internal/server/grpc/server.go.tmpl @@ -3,8 +3,8 @@ package grpc import ( pb "{{.ModPrefix}}{{.Name}}/api" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/net/rpc/warden" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" ) // New new a grpc server. diff --git a/tool/kratos-gen-project/templates/grpc/internal/service/service.go.tmpl b/tool/kratos-gen-project/templates/grpc/internal/service/service.go.tmpl index 63461cd1e..f3750cc69 100644 --- a/tool/kratos-gen-project/templates/grpc/internal/service/service.go.tmpl +++ b/tool/kratos-gen-project/templates/grpc/internal/service/service.go.tmpl @@ -6,7 +6,7 @@ import ( pb "{{.ModPrefix}}{{.Name}}/api" "{{.ModPrefix}}{{.Name}}/internal/dao" - "github.com/bilibili/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/conf/paladin" "github.com/golang/protobuf/ptypes/empty" "github.com/google/wire" diff --git a/tool/kratos-gen-project/templates/http/api/client.go.tmpl b/tool/kratos-gen-project/templates/http/api/client.go.tmpl index 2b0875e89..f3a3b2083 100644 --- a/tool/kratos-gen-project/templates/http/api/client.go.tmpl +++ b/tool/kratos-gen-project/templates/http/api/client.go.tmpl @@ -3,7 +3,7 @@ import ( "context" "fmt" - "github.com/bilibili/kratos/pkg/net/rpc/warden" + "github.com/go-kratos/kratos/pkg/net/rpc/warden" "google.golang.org/grpc" ) diff --git a/tool/kratos-gen-project/templates/http/cmd/main.go.tmpl b/tool/kratos-gen-project/templates/http/cmd/main.go.tmpl index ed688073d..de1aefec2 100644 --- a/tool/kratos-gen-project/templates/http/cmd/main.go.tmpl +++ b/tool/kratos-gen-project/templates/http/cmd/main.go.tmpl @@ -8,8 +8,8 @@ import ( "time" "{{.ModPrefix}}{{.Name}}/internal/di" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/log" ) func main() { diff --git a/tool/kratos-gen-project/templates/http/go.mod.tmpl b/tool/kratos-gen-project/templates/http/go.mod.tmpl index 9688cabc4..e9345c5be 100644 --- a/tool/kratos-gen-project/templates/http/go.mod.tmpl +++ b/tool/kratos-gen-project/templates/http/go.mod.tmpl @@ -3,7 +3,7 @@ module {{.Name}} go 1.13 require ( - github.com/bilibili/kratos master + github.com/go-kratos/kratos master github.com/gogo/protobuf v1.2.1 github.com/golang/protobuf v1.3.2 golang.org/x/net v0.0.0-20190628185345-da137c7871d7 diff --git a/tool/kratos-gen-project/templates/http/internal/dao/dao.go.tmpl b/tool/kratos-gen-project/templates/http/internal/dao/dao.go.tmpl index b4dcd724b..a67d0a8e4 100644 --- a/tool/kratos-gen-project/templates/http/internal/dao/dao.go.tmpl +++ b/tool/kratos-gen-project/templates/http/internal/dao/dao.go.tmpl @@ -5,12 +5,12 @@ import ( "time" "{{.ModPrefix}}{{.Name}}/internal/model" - "github.com/bilibili/kratos/pkg/cache/memcache" - "github.com/bilibili/kratos/pkg/cache/redis" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/database/sql" - "github.com/bilibili/kratos/pkg/sync/pipeline/fanout" - xtime "github.com/bilibili/kratos/pkg/time" + "github.com/go-kratos/kratos/pkg/cache/memcache" + "github.com/go-kratos/kratos/pkg/cache/redis" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/database/sql" + "github.com/go-kratos/kratos/pkg/sync/pipeline/fanout" + xtime "github.com/go-kratos/kratos/pkg/time" "github.com/google/wire" ) diff --git a/tool/kratos-gen-project/templates/http/internal/dao/dao_test.go.tmpl b/tool/kratos-gen-project/templates/http/internal/dao/dao_test.go.tmpl index 5386b18b0..90849e012 100644 --- a/tool/kratos-gen-project/templates/http/internal/dao/dao_test.go.tmpl +++ b/tool/kratos-gen-project/templates/http/internal/dao/dao_test.go.tmpl @@ -6,8 +6,8 @@ import ( "os" "testing" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/testing/lich" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/testing/lich" ) var d *dao diff --git a/tool/kratos-gen-project/templates/http/internal/dao/db.go.tmpl b/tool/kratos-gen-project/templates/http/internal/dao/db.go.tmpl index bc105f7e5..b3bde3064 100644 --- a/tool/kratos-gen-project/templates/http/internal/dao/db.go.tmpl +++ b/tool/kratos-gen-project/templates/http/internal/dao/db.go.tmpl @@ -4,8 +4,8 @@ import ( "context" "{{.ModPrefix}}{{.Name}}/internal/model" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/database/sql" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/database/sql" ) func NewDB() (db *sql.DB, cf func(), err error) { diff --git a/tool/kratos-gen-project/templates/http/internal/dao/mc.go.tmpl b/tool/kratos-gen-project/templates/http/internal/dao/mc.go.tmpl index a9cd1651a..44cfdf13b 100644 --- a/tool/kratos-gen-project/templates/http/internal/dao/mc.go.tmpl +++ b/tool/kratos-gen-project/templates/http/internal/dao/mc.go.tmpl @@ -5,9 +5,9 @@ import ( "fmt" "{{.ModPrefix}}{{.Name}}/internal/model" - "github.com/bilibili/kratos/pkg/cache/memcache" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/cache/memcache" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/log" ) //go:generate kratos tool genmc diff --git a/tool/kratos-gen-project/templates/http/internal/dao/redis.go.tmpl b/tool/kratos-gen-project/templates/http/internal/dao/redis.go.tmpl index 009d207e1..e3c962eee 100644 --- a/tool/kratos-gen-project/templates/http/internal/dao/redis.go.tmpl +++ b/tool/kratos-gen-project/templates/http/internal/dao/redis.go.tmpl @@ -3,9 +3,9 @@ package dao import ( "context" - "github.com/bilibili/kratos/pkg/cache/redis" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/log" + "github.com/go-kratos/kratos/pkg/cache/redis" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/log" ) func NewRedis() (r *redis.Redis, cf func(), err error) { diff --git a/tool/kratos-gen-project/templates/http/internal/di/app.go.tmpl b/tool/kratos-gen-project/templates/http/internal/di/app.go.tmpl index eee52c089..b78ce0d37 100644 --- a/tool/kratos-gen-project/templates/http/internal/di/app.go.tmpl +++ b/tool/kratos-gen-project/templates/http/internal/di/app.go.tmpl @@ -6,8 +6,8 @@ import ( "{{.ModPrefix}}{{.Name}}/internal/service" - "github.com/bilibili/kratos/pkg/log" - bm "github.com/bilibili/kratos/pkg/net/http/blademaster" + "github.com/go-kratos/kratos/pkg/log" + bm "github.com/go-kratos/kratos/pkg/net/http/blademaster" ) //go:generate kratos tool wire diff --git a/tool/kratos-gen-project/templates/http/internal/server/http/server.go.tmpl b/tool/kratos-gen-project/templates/http/internal/server/http/server.go.tmpl index 2f6d4ab5c..3bec93a28 100644 --- a/tool/kratos-gen-project/templates/http/internal/server/http/server.go.tmpl +++ b/tool/kratos-gen-project/templates/http/internal/server/http/server.go.tmpl @@ -5,9 +5,9 @@ import ( pb "{{.ModPrefix}}{{.Name}}/api" "{{.ModPrefix}}{{.Name}}/internal/model" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/log" - bm "github.com/bilibili/kratos/pkg/net/http/blademaster" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/log" + bm "github.com/go-kratos/kratos/pkg/net/http/blademaster" ) var svc pb.DemoServer diff --git a/tool/kratos-gen-project/templates/http/internal/service/service.go.tmpl b/tool/kratos-gen-project/templates/http/internal/service/service.go.tmpl index 63461cd1e..f3750cc69 100644 --- a/tool/kratos-gen-project/templates/http/internal/service/service.go.tmpl +++ b/tool/kratos-gen-project/templates/http/internal/service/service.go.tmpl @@ -6,7 +6,7 @@ import ( pb "{{.ModPrefix}}{{.Name}}/api" "{{.ModPrefix}}{{.Name}}/internal/dao" - "github.com/bilibili/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/conf/paladin" "github.com/golang/protobuf/ptypes/empty" "github.com/google/wire" diff --git a/tool/kratos-protoc/bm.go b/tool/kratos-protoc/bm.go index 5f88e00dd..cc553d8a7 100644 --- a/tool/kratos-protoc/bm.go +++ b/tool/kratos-protoc/bm.go @@ -5,7 +5,7 @@ import ( ) const ( - _getBMGen = "go get -u github.com/bilibili/kratos/tool/protobuf/protoc-gen-bm" + _getBMGen = "go get -u github.com/go-kratos/kratos/tool/protobuf/protoc-gen-bm" _bmProtoc = "protoc --proto_path=%s --proto_path=%s --proto_path=%s --bm_out=:." ) diff --git a/tool/kratos-protoc/ecode.go b/tool/kratos-protoc/ecode.go index 48da9ca9f..2f6a3f932 100644 --- a/tool/kratos-protoc/ecode.go +++ b/tool/kratos-protoc/ecode.go @@ -5,7 +5,7 @@ import ( ) const ( - _getEcodeGen = "go get -u github.com/bilibili/kratos/tool/protobuf/protoc-gen-ecode" + _getEcodeGen = "go get -u github.com/go-kratos/kratos/tool/protobuf/protoc-gen-ecode" _ecodeProtoc = "protoc --proto_path=%s --proto_path=%s --proto_path=%s --ecode_out=:." ) diff --git a/tool/kratos-protoc/protoc.go b/tool/kratos-protoc/protoc.go index ed2ba5f5c..7ee051766 100644 --- a/tool/kratos-protoc/protoc.go +++ b/tool/kratos-protoc/protoc.go @@ -130,7 +130,7 @@ func goget(url string) error { func latestKratos() (string, error) { gopath := gopath() - ext := path.Join(gopath, "src/github.com/bilibili/kratos/third_party") + ext := path.Join(gopath, "src/github.com/go-kratos/kratos/third_party") if _, err := os.Stat(ext); !os.IsNotExist(err) { return ext, nil } diff --git a/tool/kratos-protoc/swagger.go b/tool/kratos-protoc/swagger.go index be89670a7..7d61e6b28 100644 --- a/tool/kratos-protoc/swagger.go +++ b/tool/kratos-protoc/swagger.go @@ -5,7 +5,7 @@ import ( ) const ( - _getSwaggerGen = "go get -u github.com/bilibili/kratos/tool/protobuf/protoc-gen-bswagger" + _getSwaggerGen = "go get -u github.com/go-kratos/kratos/tool/protobuf/protoc-gen-bswagger" _swaggerProtoc = "protoc --proto_path=%s --proto_path=%s --proto_path=%s --bswagger_out=:." ) diff --git a/tool/kratos/README.MD b/tool/kratos/README.MD index 333786be2..b5e6da240 100644 --- a/tool/kratos/README.MD +++ b/tool/kratos/README.MD @@ -5,7 +5,7 @@ kratos 工具 ## 安装 -`go get -u github.com/bilibili/kratos/tool/kratos` +`go get -u github.com/go-kratos/kratos/tool/kratos` ## 使用说明 diff --git a/tool/kratos/tool.go b/tool/kratos/tool.go index 45cf8a969..b6b42f6c8 100644 --- a/tool/kratos/tool.go +++ b/tool/kratos/tool.go @@ -17,7 +17,7 @@ import ( ) const ( - toolDoc = "https://github.com/bilibili/kratos/blob/master/doc/wiki-cn/kratos-tool.md" + toolDoc = "https://github.com/go-kratos/kratos/blob/master/doc/wiki-cn/kratos-tool.md" ) type Tool struct { diff --git a/tool/kratos/tool_index.go b/tool/kratos/tool_index.go index f48b02097..8252e64c5 100644 --- a/tool/kratos/tool_index.go +++ b/tool/kratos/tool_index.go @@ -7,7 +7,7 @@ var toolIndexs = []*Tool{ Name: "kratos", Alias: "kratos", BuildTime: time.Date(2019, 6, 21, 0, 0, 0, 0, time.Local), - Install: "go get -u github.com/bilibili/kratos/tool/kratos", + Install: "go get -u github.com/go-kratos/kratos/tool/kratos", Summary: "Kratos工具集本体", Platform: []string{"darwin", "linux", "windows"}, Author: "kratos", @@ -17,7 +17,7 @@ var toolIndexs = []*Tool{ Name: "protoc", Alias: "kratos-protoc", BuildTime: time.Date(2019, 10, 31, 0, 0, 0, 0, time.Local), - Install: "go get -u github.com/bilibili/kratos/tool/kratos-protoc", + Install: "go get -u github.com/go-kratos/kratos/tool/kratos-protoc", Summary: "快速方便生成pb.go的protoc封装,windows、Linux请先安装protoc工具", Platform: []string{"darwin", "linux", "windows"}, Author: "kratos", @@ -35,7 +35,7 @@ var toolIndexs = []*Tool{ Name: "genbts", Alias: "kratos-gen-bts", BuildTime: time.Date(2019, 10, 31, 0, 0, 0, 0, time.Local), - Install: "go get -u github.com/bilibili/kratos/tool/kratos-gen-bts", + Install: "go get -u github.com/go-kratos/kratos/tool/kratos-gen-bts", Summary: "缓存回源逻辑代码生成器", Platform: []string{"darwin", "linux", "windows"}, Author: "kratos", @@ -44,7 +44,7 @@ var toolIndexs = []*Tool{ Name: "genmc", Alias: "kratos-gen-mc", BuildTime: time.Date(2019, 7, 23, 0, 0, 0, 0, time.Local), - Install: "go get -u github.com/bilibili/kratos/tool/kratos-gen-mc", + Install: "go get -u github.com/go-kratos/kratos/tool/kratos-gen-mc", Summary: "mc缓存代码生成", Platform: []string{"darwin", "linux", "windows"}, Author: "kratos", @@ -60,7 +60,7 @@ var toolIndexs = []*Tool{ { Name: "genproject", Alias: "kratos-gen-project", - Install: "go get -u github.com/bilibili/kratos/tool/kratos-gen-project", + Install: "go get -u github.com/go-kratos/kratos/tool/kratos-gen-project", BuildTime: time.Date(2019, 12, 22, 0, 0, 0, 0, time.Local), Platform: []string{"darwin", "linux", "windows"}, Hidden: true, @@ -70,7 +70,7 @@ var toolIndexs = []*Tool{ Name: "testgen", Alias: "testgen", BuildTime: time.Date(2020, 1, 20, 22, 33, 0, 0, time.Local), - Install: "go get -u github.com/bilibili/kratos/tool/testgen", + Install: "go get -u github.com/go-kratos/kratos/tool/testgen", Summary: "测试代码生成", Platform: []string{"darwin", "linux", "windows"}, Author: "kratos", @@ -79,7 +79,7 @@ var toolIndexs = []*Tool{ Name: "testcli", Alias: "testcli", BuildTime: time.Date(2020, 1, 20, 22, 33, 0, 0, time.Local), - Install: "go get -u github.com/bilibili/kratos/tool/testcli", + Install: "go get -u github.com/go-kratos/kratos/tool/testcli", Summary: "测试代码运行", Platform: []string{"darwin", "linux", "windows"}, Author: "kratos", diff --git a/tool/protobuf/pkg/extensions/gogoproto/gogo.pb.go b/tool/protobuf/pkg/extensions/gogoproto/gogo.pb.go index 935c23ca8..7819be39d 100644 --- a/tool/protobuf/pkg/extensions/gogoproto/gogo.pb.go +++ b/tool/protobuf/pkg/extensions/gogoproto/gogo.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: gogo.proto -package gogoproto // import "github.com/bilibili/kratos/tool/protobuf/pkg/extensions/gogoproto" +package gogoproto // import "github.com/go-kratos/kratos/tool/protobuf/pkg/extensions/gogoproto" import proto "github.com/golang/protobuf/proto" import fmt "fmt" diff --git a/tool/protobuf/pkg/extensions/gogoproto/gogo.proto b/tool/protobuf/pkg/extensions/gogoproto/gogo.proto index a9b8f96a3..d7a8b3709 100644 --- a/tool/protobuf/pkg/extensions/gogoproto/gogo.proto +++ b/tool/protobuf/pkg/extensions/gogoproto/gogo.proto @@ -33,7 +33,7 @@ import "google/protobuf/descriptor.proto"; option java_package = "com.google.protobuf"; option java_outer_classname = "GoGoProtos"; -option go_package = "github.com/bilibili/kratos/tool/protobuf/pkg/extensions/gogoproto"; +option go_package = "github.com/go-kratos/kratos/tool/protobuf/pkg/extensions/gogoproto"; extend google.protobuf.EnumOptions { optional bool goproto_enum_prefix = 62001; diff --git a/tool/protobuf/pkg/generator/generator.go b/tool/protobuf/pkg/generator/generator.go index e9884b790..f26f6abb8 100644 --- a/tool/protobuf/pkg/generator/generator.go +++ b/tool/protobuf/pkg/generator/generator.go @@ -11,10 +11,10 @@ import ( "strconv" "strings" - "github.com/bilibili/kratos/tool/protobuf/pkg/gen" - "github.com/bilibili/kratos/tool/protobuf/pkg/naming" - "github.com/bilibili/kratos/tool/protobuf/pkg/typemap" - "github.com/bilibili/kratos/tool/protobuf/pkg/utils" + "github.com/go-kratos/kratos/tool/protobuf/pkg/gen" + "github.com/go-kratos/kratos/tool/protobuf/pkg/naming" + "github.com/go-kratos/kratos/tool/protobuf/pkg/typemap" + "github.com/go-kratos/kratos/tool/protobuf/pkg/utils" "github.com/golang/protobuf/protoc-gen-go/descriptor" plugin "github.com/golang/protobuf/protoc-gen-go/plugin" "github.com/pkg/errors" @@ -22,8 +22,8 @@ import ( const Version = "v0.1" -var GoModuleImportPath = "github.com/bilibili/kratos" -var GoModuleDirName = "github.com/bilibili/kratos" +var GoModuleImportPath = "github.com/go-kratos/kratos" +var GoModuleDirName = "github.com/go-kratos/kratos" type Base struct { Reg *typemap.Registry diff --git a/tool/protobuf/pkg/generator/helper.go b/tool/protobuf/pkg/generator/helper.go index 6bdc5bdf1..5fbe990d9 100644 --- a/tool/protobuf/pkg/generator/helper.go +++ b/tool/protobuf/pkg/generator/helper.go @@ -4,9 +4,9 @@ import ( "reflect" "strings" - "github.com/bilibili/kratos/tool/protobuf/pkg/extensions/gogoproto" - "github.com/bilibili/kratos/tool/protobuf/pkg/tag" - "github.com/bilibili/kratos/tool/protobuf/pkg/typemap" + "github.com/go-kratos/kratos/tool/protobuf/pkg/extensions/gogoproto" + "github.com/go-kratos/kratos/tool/protobuf/pkg/tag" + "github.com/go-kratos/kratos/tool/protobuf/pkg/typemap" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/protoc-gen-go/descriptor" ) diff --git a/tool/protobuf/pkg/generator/http.go b/tool/protobuf/pkg/generator/http.go index d51357793..bf8549bf5 100644 --- a/tool/protobuf/pkg/generator/http.go +++ b/tool/protobuf/pkg/generator/http.go @@ -5,8 +5,8 @@ import ( "net/http" "strings" - "github.com/bilibili/kratos/tool/protobuf/pkg/tag" - "github.com/bilibili/kratos/tool/protobuf/pkg/typemap" + "github.com/go-kratos/kratos/tool/protobuf/pkg/tag" + "github.com/go-kratos/kratos/tool/protobuf/pkg/typemap" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/protoc-gen-go/descriptor" "google.golang.org/genproto/googleapis/api/annotations" diff --git a/tool/protobuf/pkg/naming/naming.go b/tool/protobuf/pkg/naming/naming.go index 37176116f..46322b7b2 100644 --- a/tool/protobuf/pkg/naming/naming.go +++ b/tool/protobuf/pkg/naming/naming.go @@ -6,7 +6,7 @@ import ( "path/filepath" "strings" - "github.com/bilibili/kratos/tool/protobuf/pkg/utils" + "github.com/go-kratos/kratos/tool/protobuf/pkg/utils" "github.com/golang/protobuf/protoc-gen-go/descriptor" "github.com/pkg/errors" "github.com/siddontang/go/ioutil2" diff --git a/tool/protobuf/pkg/project/project.go b/tool/protobuf/pkg/project/project.go index 69afdb87f..1fb7eb885 100644 --- a/tool/protobuf/pkg/project/project.go +++ b/tool/protobuf/pkg/project/project.go @@ -5,7 +5,7 @@ import ( "path/filepath" "strings" - "github.com/bilibili/kratos/tool/protobuf/pkg/utils" + "github.com/go-kratos/kratos/tool/protobuf/pkg/utils" "github.com/pkg/errors" "github.com/siddontang/go/ioutil2" ) diff --git a/tool/protobuf/pkg/tag/ext_tags.go b/tool/protobuf/pkg/tag/ext_tags.go index b8b641d63..4b15463be 100644 --- a/tool/protobuf/pkg/tag/ext_tags.go +++ b/tool/protobuf/pkg/tag/ext_tags.go @@ -1,7 +1,7 @@ package tag import ( - "github.com/bilibili/kratos/tool/protobuf/pkg/extensions/gogoproto" + "github.com/go-kratos/kratos/tool/protobuf/pkg/extensions/gogoproto" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/protoc-gen-go/descriptor" ) diff --git a/tool/protobuf/protoc-gen-bm/generator/generator.go b/tool/protobuf/protoc-gen-bm/generator/generator.go index 19c325bfe..b413aa4b6 100644 --- a/tool/protobuf/protoc-gen-bm/generator/generator.go +++ b/tool/protobuf/protoc-gen-bm/generator/generator.go @@ -6,11 +6,11 @@ import ( "sort" "strings" - "github.com/bilibili/kratos/tool/protobuf/pkg/generator" - "github.com/bilibili/kratos/tool/protobuf/pkg/naming" - "github.com/bilibili/kratos/tool/protobuf/pkg/tag" - "github.com/bilibili/kratos/tool/protobuf/pkg/typemap" - "github.com/bilibili/kratos/tool/protobuf/pkg/utils" + "github.com/go-kratos/kratos/tool/protobuf/pkg/generator" + "github.com/go-kratos/kratos/tool/protobuf/pkg/naming" + "github.com/go-kratos/kratos/tool/protobuf/pkg/tag" + "github.com/go-kratos/kratos/tool/protobuf/pkg/typemap" + "github.com/go-kratos/kratos/tool/protobuf/pkg/utils" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/protoc-gen-go/descriptor" plugin "github.com/golang/protobuf/protoc-gen-go/plugin" @@ -115,8 +115,8 @@ func (t *bm) generateImports(file *descriptor.FileDescriptorProto) { //t.P(` `,t.pkgs["context"], ` "context"`) t.P(` "context"`) t.P() - t.P(` bm "github.com/bilibili/kratos/pkg/net/http/blademaster"`) - t.P(` "github.com/bilibili/kratos/pkg/net/http/blademaster/binding"`) + t.P(` bm "github.com/go-kratos/kratos/pkg/net/http/blademaster"`) + t.P(` "github.com/go-kratos/kratos/pkg/net/http/blademaster/binding"`) t.P(`)`) // It's legal to import a message and use it as an input or output for a diff --git a/tool/protobuf/protoc-gen-bm/main.go b/tool/protobuf/protoc-gen-bm/main.go index 38589534c..95e8c3927 100644 --- a/tool/protobuf/protoc-gen-bm/main.go +++ b/tool/protobuf/protoc-gen-bm/main.go @@ -5,9 +5,9 @@ import ( "fmt" "os" - "github.com/bilibili/kratos/tool/protobuf/pkg/gen" - "github.com/bilibili/kratos/tool/protobuf/pkg/generator" - bmgen "github.com/bilibili/kratos/tool/protobuf/protoc-gen-bm/generator" + "github.com/go-kratos/kratos/tool/protobuf/pkg/gen" + "github.com/go-kratos/kratos/tool/protobuf/pkg/generator" + bmgen "github.com/go-kratos/kratos/tool/protobuf/protoc-gen-bm/generator" ) func main() { diff --git a/tool/protobuf/protoc-gen-bswagger/generator.go b/tool/protobuf/protoc-gen-bswagger/generator.go index d90d9bf48..0d03d7c16 100644 --- a/tool/protobuf/protoc-gen-bswagger/generator.go +++ b/tool/protobuf/protoc-gen-bswagger/generator.go @@ -7,11 +7,11 @@ import ( "regexp" "strings" - "github.com/bilibili/kratos/tool/protobuf/pkg/gen" - "github.com/bilibili/kratos/tool/protobuf/pkg/generator" - "github.com/bilibili/kratos/tool/protobuf/pkg/naming" - "github.com/bilibili/kratos/tool/protobuf/pkg/tag" - "github.com/bilibili/kratos/tool/protobuf/pkg/typemap" + "github.com/go-kratos/kratos/tool/protobuf/pkg/gen" + "github.com/go-kratos/kratos/tool/protobuf/pkg/generator" + "github.com/go-kratos/kratos/tool/protobuf/pkg/naming" + "github.com/go-kratos/kratos/tool/protobuf/pkg/tag" + "github.com/go-kratos/kratos/tool/protobuf/pkg/typemap" "github.com/golang/protobuf/protoc-gen-go/descriptor" plugin "github.com/golang/protobuf/protoc-gen-go/plugin" ) diff --git a/tool/protobuf/protoc-gen-bswagger/main.go b/tool/protobuf/protoc-gen-bswagger/main.go index 6bedb7993..45b68dec5 100644 --- a/tool/protobuf/protoc-gen-bswagger/main.go +++ b/tool/protobuf/protoc-gen-bswagger/main.go @@ -5,8 +5,8 @@ import ( "fmt" "os" - "github.com/bilibili/kratos/tool/protobuf/pkg/gen" - "github.com/bilibili/kratos/tool/protobuf/pkg/generator" + "github.com/go-kratos/kratos/tool/protobuf/pkg/gen" + "github.com/go-kratos/kratos/tool/protobuf/pkg/generator" ) func main() { diff --git a/tool/protobuf/protoc-gen-ecode/generator/generator.go b/tool/protobuf/protoc-gen-ecode/generator/generator.go index 0aa88cab1..73c39e05d 100644 --- a/tool/protobuf/protoc-gen-ecode/generator/generator.go +++ b/tool/protobuf/protoc-gen-ecode/generator/generator.go @@ -4,8 +4,8 @@ import ( "strconv" "strings" - "github.com/bilibili/kratos/tool/protobuf/pkg/generator" - "github.com/bilibili/kratos/tool/protobuf/pkg/naming" + "github.com/go-kratos/kratos/tool/protobuf/pkg/generator" + "github.com/go-kratos/kratos/tool/protobuf/pkg/naming" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/protoc-gen-go/descriptor" plugin "github.com/golang/protobuf/protoc-gen-go/plugin" @@ -94,7 +94,7 @@ func (t *ecode) generateFileHeader(file *descriptor.FileDescriptorProto, pkgName func (t *ecode) generateImports(file *descriptor.FileDescriptorProto) { t.P(`import (`) - t.P(` "github.com/bilibili/kratos/pkg/ecode"`) + t.P(` "github.com/go-kratos/kratos/pkg/ecode"`) t.P(`)`) t.P() t.P(`// to suppressed 'imported but not used warning'`) diff --git a/tool/protobuf/protoc-gen-ecode/main.go b/tool/protobuf/protoc-gen-ecode/main.go index 0ce35e37a..7c408bed9 100644 --- a/tool/protobuf/protoc-gen-ecode/main.go +++ b/tool/protobuf/protoc-gen-ecode/main.go @@ -5,9 +5,9 @@ import ( "fmt" "os" - "github.com/bilibili/kratos/tool/protobuf/pkg/gen" - "github.com/bilibili/kratos/tool/protobuf/pkg/generator" - ecodegen "github.com/bilibili/kratos/tool/protobuf/protoc-gen-ecode/generator" + "github.com/go-kratos/kratos/tool/protobuf/pkg/gen" + "github.com/go-kratos/kratos/tool/protobuf/pkg/generator" + ecodegen "github.com/go-kratos/kratos/tool/protobuf/protoc-gen-ecode/generator" ) func main() { diff --git a/tool/testcli/README.MD b/tool/testcli/README.MD index f17e3d281..7be62e3b9 100644 --- a/tool/testcli/README.MD +++ b/tool/testcli/README.MD @@ -1,7 +1,7 @@ ## testcli UT运行环境构建工具 基于 docker-compose 实现跨平台跨语言环境的容器依赖管理方案,以解决运行ut场景下的 (mysql, redis, mc)容器依赖问题。 -*这个是testing/lich的二进制工具版本(Go请直接使用库版本:github.com/bilibili/kratos/pkg/testing/lich)* +*这个是testing/lich的二进制工具版本(Go请直接使用库版本:github.com/go-kratos/kratos/pkg/testing/lich)* ### 功能和特性 - 自动读取 test 目录下的 yaml 并启动依赖 @@ -14,18 +14,18 @@ #### Method 1. With go get ```shell -go get -u github.com/bilibili/kratos/tool/testcli +go get -u github.com/go-kratos/kratos/tool/testcli $GOPATH/bin/testcli -h ``` #### Method 2. Build with Go ```shell -cd github.com/bilibili/kratos/tool/testcli +cd github.com/go-kratos/kratos/tool/testcli go build -o $GOPATH/bin/testcli $GOPATH/bin/testcli -h ``` #### Method 3. Import with Kratos pkg ```Go -import "github.com/bilibili/kratos/pkg/testing/lich" +import "github.com/go-kratos/kratos/pkg/testing/lich" ``` ### 构建数据 @@ -105,7 +105,7 @@ example: testcli -f ../../test/docker-compose.yaml run go test -v ./ ``` #### Method 2. Import with Kratos pkg -- Step1. 在 Dao|Service 层中的 TestMain 单测主入口中,import "github.com/bilibili/kratos/pkg/testing/lich" 引入testcli工具的go库版本。 +- Step1. 在 Dao|Service 层中的 TestMain 单测主入口中,import "github.com/go-kratos/kratos/pkg/testing/lich" 引入testcli工具的go库版本。 - Step2. 使用 flag.Set("f", "../../test/docker-compose.yaml") 指定 docker-compose.yaml 文件的路径。 - Step3. 在 flag.Parse() 后即可使用 lich.Setup() 安装依赖&初始化数据(注意测试用例执行结束后 lich.Teardown() 回收下~) - Step4. 运行 `go test -v ./ `看看效果吧~ @@ -121,8 +121,8 @@ import ( "strings" "testing" - "github.com/bilibili/kratos/pkg/conf/paladin" - "github.com/bilibili/kratos/pkg/testing/lich" + "github.com/go-kratos/kratos/pkg/conf/paladin" + "github.com/go-kratos/kratos/pkg/testing/lich" ) var ( diff --git a/tool/testcli/main.go b/tool/testcli/main.go index 563a9d132..7efde6ca5 100644 --- a/tool/testcli/main.go +++ b/tool/testcli/main.go @@ -6,7 +6,7 @@ import ( "os/exec" "strings" - "github.com/bilibili/kratos/pkg/testing/lich" + "github.com/go-kratos/kratos/pkg/testing/lich" ) func parseArgs() (flags map[string]string) { diff --git a/tool/testgen/README.md b/tool/testgen/README.md index 3ec686e7f..890992ae8 100644 --- a/tool/testgen/README.md +++ b/tool/testgen/README.md @@ -12,12 +12,12 @@ ### 编译安装 #### Method 1. With go get ```shell -go get -u github.com/bilibili/kratos/tool/testgen +go get -u github.com/go-kratos/kratos/tool/testgen $GOPATH/bin/testgen -h ``` #### Method 2. Build with Go ```shell -cd github.com/bilibili/kratos/tool/testgen +cd github.com/go-kratos/kratos/tool/testgen go build -o $GOPATH/bin/testgen $GOPATH/bin/testgen -h ```