diff --git a/go.mod b/go.mod index 7d6c86f2b..9ef1caa6b 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/bilibili/Kratos +module github.com/bilibili/kratos require ( github.com/BurntSushi/toml v0.3.1 @@ -19,3 +19,5 @@ require ( gopkg.in/go-playground/assert.v1 v1.2.1 // indirect gopkg.in/go-playground/validator.v9 v9.26.0 ) + +go 1.12 diff --git a/pkg/conf/dsn/dsn_test.go b/pkg/conf/dsn/dsn_test.go index 815ead818..01573be51 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/bilibili/kratos/pkg/time" ) type config struct { diff --git a/pkg/conf/dsn/example_test.go b/pkg/conf/dsn/example_test.go index ed81e4204..51d075d96 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/bilibili/kratos/pkg/conf/dsn" + xtime "github.com/bilibili/kratos/pkg/time" ) // Config struct diff --git a/pkg/conf/dsn/query_test.go b/pkg/conf/dsn/query_test.go index 0f7ea15c1..3bac1f9eb 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/bilibili/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/bilibili/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/bilibili/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/bilibili/kratos/pkg/time", args: args{ query: url.Values{}, v: &cfg4{}, diff --git a/pkg/conf/paladin/default.go b/pkg/conf/paladin/default.go index bd7dfb88a..498ca919a 100644 --- a/pkg/conf/paladin/default.go +++ b/pkg/conf/paladin/default.go @@ -4,7 +4,7 @@ import ( "context" "flag" - "github.com/bilibili/Kratos/pkg/log" + "github.com/bilibili/kratos/pkg/log" ) var ( diff --git a/pkg/conf/paladin/example_test.go b/pkg/conf/paladin/example_test.go index 3969bf505..d3d365457 100644 --- a/pkg/conf/paladin/example_test.go +++ b/pkg/conf/paladin/example_test.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/bilibili/Kratos/pkg/conf/paladin" + "github.com/bilibili/kratos/pkg/conf/paladin" "github.com/BurntSushi/toml" ) diff --git a/pkg/conf/paladin/map_test.go b/pkg/conf/paladin/map_test.go index 6d98ea8a7..99bef1990 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/bilibili/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 0d088ed2c..7181d4dc7 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/bilibili/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 421e22771..2c9091591 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/bilibili/kratos/pkg/time" "github.com/stretchr/testify/assert" ) diff --git a/pkg/container/pool/pool.go b/pkg/container/pool/pool.go index 13ad43e6f..7e273241e 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/bilibili/kratos/pkg/time" ) var ( diff --git a/pkg/container/pool/slice_test.go b/pkg/container/pool/slice_test.go index 4fa19930d..104d20ff5 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/bilibili/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 4f0866251..df32fade0 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/bilibili/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 5857108a3..1edef0f70 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/bilibili/kratos/pkg/ecode" ) var testConf = &Config{ diff --git a/pkg/log/field.go b/pkg/log/field.go index fe2609b95..144af2fd3 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/bilibili/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 fd08caebd..3fcc906e9 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/bilibili/kratos/pkg/log/internal/filewriter" ) // level idx diff --git a/pkg/log/internal/core/field.go b/pkg/log/internal/core/field.go index 7c7e30ca8..99c78325b 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/bilibili/kratos/pkg/time" ) // FieldType represent D value type diff --git a/pkg/log/log.go b/pkg/log/log.go index 1c3e4c283..d26f58f38 100644 --- a/pkg/log/log.go +++ b/pkg/log/log.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/bilibili/Kratos/pkg/conf/env" + "github.com/bilibili/kratos/pkg/conf/env" ) // Config log config. diff --git a/pkg/log/log_test.go b/pkg/log/log_test.go index 4b15c1b7e..2933d42f2 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/bilibili/kratos/pkg/net/metadata" "github.com/stretchr/testify/assert" ) diff --git a/pkg/log/util.go b/pkg/log/util.go index 648664b0a..3f9ef10eb 100644 --- a/pkg/log/util.go +++ b/pkg/log/util.go @@ -6,9 +6,9 @@ import ( "runtime" "strconv" - "github.com/bilibili/Kratos/pkg/conf/env" - "github.com/bilibili/Kratos/pkg/net/metadata" - "github.com/bilibili/Kratos/pkg/net/trace" + "github.com/bilibili/kratos/pkg/conf/env" + "github.com/bilibili/kratos/pkg/net/metadata" + "github.com/bilibili/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 a773ac3cb..3548e7fca 100644 --- a/pkg/naming/discovery/discovery.go +++ b/pkg/naming/discovery/discovery.go @@ -14,15 +14,15 @@ 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" - bm "github.com/bilibili/Kratos/pkg/net/http/blademaster" - "github.com/bilibili/Kratos/pkg/net/netutil" - "github.com/bilibili/Kratos/pkg/net/netutil/breaker" - xstr "github.com/bilibili/Kratos/pkg/str" - xtime "github.com/bilibili/Kratos/pkg/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" + bm "github.com/bilibili/kratos/pkg/net/http/blademaster" + "github.com/bilibili/kratos/pkg/net/netutil" + "github.com/bilibili/kratos/pkg/net/netutil/breaker" + xstr "github.com/bilibili/kratos/pkg/str" + xtime "github.com/bilibili/kratos/pkg/time" ) const ( diff --git a/pkg/net/http/blademaster/client.go b/pkg/net/http/blademaster/client.go index eacdaa5f9..86fc45f84 100644 --- a/pkg/net/http/blademaster/client.go +++ b/pkg/net/http/blademaster/client.go @@ -17,11 +17,11 @@ 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" - "github.com/bilibili/Kratos/pkg/stat" - xtime "github.com/bilibili/Kratos/pkg/time" + "github.com/bilibili/kratos/pkg/conf/env" + "github.com/bilibili/kratos/pkg/net/metadata" + "github.com/bilibili/kratos/pkg/net/netutil/breaker" + "github.com/bilibili/kratos/pkg/stat" + xtime "github.com/bilibili/kratos/pkg/time" "github.com/gogo/protobuf/proto" pkgerr "github.com/pkg/errors" diff --git a/pkg/net/http/blademaster/metadata.go b/pkg/net/http/blademaster/metadata.go index a868f4305..da62512ef 100644 --- a/pkg/net/http/blademaster/metadata.go +++ b/pkg/net/http/blademaster/metadata.go @@ -6,8 +6,8 @@ import ( "strings" "time" - "github.com/bilibili/Kratos/pkg/conf/env" - "github.com/bilibili/Kratos/pkg/log" + "github.com/bilibili/kratos/pkg/conf/env" + "github.com/bilibili/kratos/pkg/log" "github.com/pkg/errors" ) diff --git a/pkg/net/http/blademaster/trace.go b/pkg/net/http/blademaster/trace.go index b792246bb..2200ac982 100644 --- a/pkg/net/http/blademaster/trace.go +++ b/pkg/net/http/blademaster/trace.go @@ -5,7 +5,7 @@ import ( "net/http" "net/http/httptrace" - "github.com/bilibili/Kratos/pkg/net/trace" + "github.com/bilibili/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 6fe45e7e6..f7b681ac3 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/bilibili/kratos/pkg/time" ) // Config broker config. diff --git a/pkg/net/netutil/breaker/sre_breaker.go b/pkg/net/netutil/breaker/sre_breaker.go index d713dfe4f..d175d0b2e 100644 --- a/pkg/net/netutil/breaker/sre_breaker.go +++ b/pkg/net/netutil/breaker/sre_breaker.go @@ -6,9 +6,9 @@ import ( "sync/atomic" "time" - "github.com/bilibili/Kratos/pkg/ecode" - "github.com/bilibili/Kratos/pkg/log" - "github.com/bilibili/Kratos/pkg/stat/summary" + "github.com/bilibili/kratos/pkg/ecode" + "github.com/bilibili/kratos/pkg/log" + "github.com/bilibili/kratos/pkg/stat/summary" ) // sreBreaker is a sre CircuitBreaker pattern. diff --git a/pkg/net/trace/config.go b/pkg/net/trace/config.go index d6f918acd..c43e09e71 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/bilibili/kratos/pkg/conf/dsn" + "github.com/bilibili/kratos/pkg/conf/env" + xtime "github.com/bilibili/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 414dfb59c..6324694e0 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/bilibili/kratos/pkg/net/trace/proto" ) const protoVersion1 int32 = 1 diff --git a/pkg/net/trace/span.go b/pkg/net/trace/span.go index 1cd2eb101..6d852213b 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/bilibili/kratos/pkg/net/trace/proto" ) const ( diff --git a/pkg/net/trace/util.go b/pkg/net/trace/util.go index 8345e4c54..216f9bccc 100644 --- a/pkg/net/trace/util.go +++ b/pkg/net/trace/util.go @@ -6,9 +6,9 @@ import ( "math/rand" "time" - "github.com/bilibili/Kratos/pkg/conf/env" - "github.com/bilibili/Kratos/pkg/net/ip" - "github.com/bilibili/Kratos/pkg/net/metadata" + "github.com/bilibili/kratos/pkg/conf/env" + "github.com/bilibili/kratos/pkg/net/ip" + "github.com/bilibili/kratos/pkg/net/metadata" "github.com/pkg/errors" ) @@ -45,7 +45,7 @@ type stackTracer interface { type ctxKey string -var _ctxkey ctxKey = "Kratos/pkg/net/trace.trace" +var _ctxkey ctxKey = "kratos/pkg/net/trace.trace" // FromContext returns the trace bound to the context, if any. func FromContext(ctx context.Context) (t Trace, ok bool) { diff --git a/pkg/stat/stat.go b/pkg/stat/stat.go index 7f8c98fb7..7d9c6343b 100644 --- a/pkg/stat/stat.go +++ b/pkg/stat/stat.go @@ -1,7 +1,7 @@ package stat import ( - "github.com/bilibili/Kratos/pkg/stat/prom" + "github.com/bilibili/kratos/pkg/stat/prom" ) // Stat interface. diff --git a/tool/kratos/template.go b/tool/kratos/template.go index 781d4ed76..a31d2c725 100644 --- a/tool/kratos/template.go +++ b/tool/kratos/template.go @@ -75,8 +75,8 @@ import ( "{{.Name}}/internal/server/grpc" "{{.Name}}/internal/server/http" "{{.Name}}/internal/service" - "github.com/bilibili/Kratos/pkg/conf/paladin" - "github.com/bilibili/Kratos/pkg/log" + "github.com/bilibili/kratos/pkg/conf/paladin" + "github.com/bilibili/kratos/pkg/log" ) func main() { @@ -126,12 +126,12 @@ import ( "context" "time" - "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/log" - xtime "github.com/bilibili/Kratos/pkg/time" + "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/log" + xtime "github.com/bilibili/kratos/pkg/time" ) // Dao dao. @@ -233,7 +233,7 @@ import ( "context" "{{.Name}}/internal/dao" - "github.com/bilibili/Kratos/pkg/conf/paladin" + "github.com/bilibili/kratos/pkg/conf/paladin" ) // Service service. @@ -274,7 +274,7 @@ import ( pb "{{.Name}}/api" "{{.Name}}/internal/dao" - "github.com/bilibili/Kratos/pkg/conf/paladin" + "github.com/bilibili/kratos/pkg/conf/paladin" "github.com/golang/protobuf/ptypes/empty" ) @@ -321,10 +321,10 @@ import ( "net/http" "{{.Name}}/internal/service" - "github.com/bilibili/Kratos/pkg/conf/paladin" - "github.com/bilibili/Kratos/pkg/log" - bm "github.com/bilibili/Kratos/pkg/net/http/blademaster" - "github.com/bilibili/Kratos/pkg/net/http/blademaster/middleware/verify" + "github.com/bilibili/kratos/pkg/conf/paladin" + "github.com/bilibili/kratos/pkg/log" + bm "github.com/bilibili/kratos/pkg/net/http/blademaster" + "github.com/bilibili/kratos/pkg/net/http/blademaster/middleware/verify" ) var ( @@ -425,8 +425,8 @@ message HelloReq { import ( pb "{{.Name}}/api" "{{.Name}}/internal/service" - "github.com/bilibili/Kratos/pkg/conf/paladin" - "github.com/bilibili/Kratos/pkg/net/rpc/warden" + "github.com/bilibili/kratos/pkg/conf/paladin" + "github.com/bilibili/kratos/pkg/net/rpc/warden" ) // New new a grpc server. diff --git a/tool/kratos/tool_index.go b/tool/kratos/tool_index.go index f420fd3d1..7de142492 100644 --- a/tool/kratos/tool_index.go +++ b/tool/kratos/tool_index.go @@ -6,7 +6,7 @@ var toolIndexs = []*Tool{ &Tool{ Name: "kratos", BuildTime: time.Date(2019, 4, 2, 0, 0, 0, 0, time.Local), - Install: "go get -u github.com/bilibili/Kratos/tool/kratos", + Install: "go get -u github.com/bilibili/kratos/tool/kratos", Summary: "Kratos工具集本体", Platform: []string{"darwin", "linux", "windows"}, Author: "kratos",