From c407afc81d44e5ca10434427d8b6ee6da24057e7 Mon Sep 17 00:00:00 2001 From: shifengbin Date: Tue, 9 Aug 2022 12:00:10 +0800 Subject: [PATCH 01/71] fix: in case url or form bind param error should return BadRequest (#2256) * fix: binding url or form convert type error should be return BadRequest * golint --- transport/http/binding/bind.go | 12 ++++++-- transport/http/binding/bind_test.go | 44 +++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/transport/http/binding/bind.go b/transport/http/binding/bind.go index 3155d61e7..100073673 100644 --- a/transport/http/binding/bind.go +++ b/transport/http/binding/bind.go @@ -4,13 +4,18 @@ import ( "net/http" "net/url" + "github.com/go-kratos/kratos/v2/errors" + "github.com/go-kratos/kratos/v2/encoding" "github.com/go-kratos/kratos/v2/encoding/form" ) // BindQuery bind vars parameters to target. func BindQuery(vars url.Values, target interface{}) error { - return encoding.GetCodec(form.Name).Unmarshal([]byte(vars.Encode()), target) + if err := encoding.GetCodec(form.Name).Unmarshal([]byte(vars.Encode()), target); err != nil { + return errors.BadRequest("CODEC", err.Error()) + } + return nil } // BindForm bind form parameters to target. @@ -18,5 +23,8 @@ func BindForm(req *http.Request, target interface{}) error { if err := req.ParseForm(); err != nil { return err } - return encoding.GetCodec(form.Name).Unmarshal([]byte(req.Form.Encode()), target) + if err := encoding.GetCodec(form.Name).Unmarshal([]byte(req.Form.Encode()), target); err != nil { + return errors.BadRequest("CODEC", err.Error()) + } + return nil } diff --git a/transport/http/binding/bind_test.go b/transport/http/binding/bind_test.go index 5e2552f90..20aadba7f 100644 --- a/transport/http/binding/bind_test.go +++ b/transport/http/binding/bind_test.go @@ -7,6 +7,8 @@ import ( "reflect" "strings" "testing" + + "github.com/go-kratos/kratos/v2/errors" ) func TestBindQuery(t *testing.T) { @@ -14,7 +16,12 @@ func TestBindQuery(t *testing.T) { Name string `json:"name"` URL string `json:"url"` } + + type TestBind2 struct { + Age int `json:"age"` + } p1 := TestBind{} + p2 := TestBind2{} type args struct { vars url.Values target interface{} @@ -34,11 +41,31 @@ func TestBindQuery(t *testing.T) { wantErr: false, want: &TestBind{"kratos", "https://go-kratos.dev/"}, }, + { + name: "test1", + args: args{ + vars: map[string][]string{"age": {"kratos"}, "url": {"https://go-kratos.dev/"}}, + target: &p2, + }, + wantErr: true, + want: errors.BadRequest("CODEC", ""), + }, + { + name: "test2", + args: args{ + vars: map[string][]string{"age": {"1"}, "url": {"https://go-kratos.dev/"}}, + target: &TestBind2{}, + }, + wantErr: false, + want: &TestBind2{Age: 1}, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if err := BindQuery(tt.args.vars, tt.args.target); (err != nil) != tt.wantErr { t.Errorf("BindQuery() error = %v, wantErr %v", err, tt.wantErr) + } else { + t.Log(err) } if !tt.wantErr && !reflect.DeepEqual(tt.args.target, tt.want) { t.Errorf("BindQuery() target = %v, want %v", tt.args.target, tt.want) @@ -52,6 +79,9 @@ func TestBindForm(t *testing.T) { Name string `json:"name"` URL string `json:"url"` } + type TestBind2 struct { + Age int `json:"age"` + } p1 := TestBind{} type args struct { req *http.Request @@ -85,6 +115,19 @@ func TestBindForm(t *testing.T) { wantErr: false, want: &TestBind{"kratos", "https://go-kratos.dev/"}, }, + { + name: "error BadRequest", + args: args{ + req: &http.Request{ + Method: "POST", + Header: http.Header{"Content-Type": {"application/x-www-form-urlencoded; param=value"}}, + Body: io.NopCloser(strings.NewReader("age=a")), + }, + target: &TestBind2{}, + }, + wantErr: true, + want: nil, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -92,6 +135,7 @@ func TestBindForm(t *testing.T) { if (err != nil) != tt.wantErr { t.Errorf("BindForm() error = %v, wantErr %v", err, tt.wantErr) } + t.Log(err) if !tt.wantErr && !reflect.DeepEqual(tt.args.target, tt.want) { t.Errorf("BindForm() target = %v, want %v", tt.args.target, tt.want) } From 0aa9719e3a4ae9e412594a7f14e6b93d581b238d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Aug 2022 21:07:06 +0800 Subject: [PATCH 02/71] build(deps): bump google.golang.org/protobuf in /contrib/log/aliyun (#2249) Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.28.0 to 1.28.1. - [Release notes](https://github.com/protocolbuffers/protobuf-go/releases) - [Changelog](https://github.com/protocolbuffers/protobuf-go/blob/master/release.bash) - [Commits](https://github.com/protocolbuffers/protobuf-go/compare/v1.28.0...v1.28.1) --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- contrib/log/aliyun/go.mod | 2 +- contrib/log/aliyun/go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/log/aliyun/go.mod b/contrib/log/aliyun/go.mod index 8f0908edf..83b139ea5 100644 --- a/contrib/log/aliyun/go.mod +++ b/contrib/log/aliyun/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/aliyun/aliyun-log-go-sdk v0.1.37 github.com/go-kratos/kratos/v2 v2.4.1 - google.golang.org/protobuf v1.28.0 + google.golang.org/protobuf v1.28.1 ) replace ( diff --git a/contrib/log/aliyun/go.sum b/contrib/log/aliyun/go.sum index 91f02aeaa..6fde63449 100644 --- a/contrib/log/aliyun/go.sum +++ b/contrib/log/aliyun/go.sum @@ -462,8 +462,9 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From e4d73db5236d046acff0b092f6ff30a2b3609c53 Mon Sep 17 00:00:00 2001 From: Kagaya Date: Wed, 10 Aug 2022 17:04:07 +0800 Subject: [PATCH 03/71] fix lint error (#2266) --- contrib/log/fluent/fluent.go | 5 +- contrib/registry/discovery/impl_registrar.go | 2 +- contrib/registry/kubernetes/registry.go | 62 ++++++++++---------- transport/grpc/resolver/direct/builder.go | 3 +- transport/grpc/server.go | 3 +- transport/http/server.go | 5 +- 6 files changed, 42 insertions(+), 38 deletions(-) diff --git a/contrib/log/fluent/fluent.go b/contrib/log/fluent/fluent.go index 8f385b594..07a15b869 100644 --- a/contrib/log/fluent/fluent.go +++ b/contrib/log/fluent/fluent.go @@ -99,8 +99,9 @@ type Logger struct { // NewLogger new a std logger with options. // target: -// tcp://127.0.0.1:24224 -// unix://var/run/fluent/fluent.sock +// +// tcp://127.0.0.1:24224 +// unix://var/run/fluent/fluent.sock func NewLogger(addr string, opts ...Option) (*Logger, error) { option := options{} for _, o := range opts { diff --git a/contrib/registry/discovery/impl_registrar.go b/contrib/registry/discovery/impl_registrar.go index c5590f57f..bb580cc14 100644 --- a/contrib/registry/discovery/impl_registrar.go +++ b/contrib/registry/discovery/impl_registrar.go @@ -62,7 +62,7 @@ func (d *Discovery) Register(ctx context.Context, service *registry.ServiceInsta return } -// register an instance with Discovery +// register an instance with Discovery func (d *Discovery) register(ctx context.Context, ins *discoveryInstance) (err error) { d.mutex.RLock() c := d.config diff --git a/contrib/registry/kubernetes/registry.go b/contrib/registry/kubernetes/registry.go index bd752bc13..6f08157d0 100644 --- a/contrib/registry/kubernetes/registry.go +++ b/contrib/registry/kubernetes/registry.go @@ -32,37 +32,37 @@ import ( // kratos-service-protocols: define the protocols of the service // // Example Deployment: -// -// apiVersion: apps/v1 -// kind: Deployment -// metadata: -// name: nginx -// labels: -// app: nginx -// spec: -// replicas: 5 -// selector: -// matchLabels: -// app: nginx -// template: -// metadata: -// labels: -// app: nginx -// kratos-service-id: "56991810-c77f-4a95-8190-393efa9c1a61" -// kratos-service-app: "nginx" -// kratos-service-version: "v3.5.0" -// annotations: -// kratos-service-protocols: | -// {"80": "http"} -// kratos-service-metadata: | -// {"region": "sh", "zone": "sh001", "cluster": "pd"} -// spec: -// containers: -// - name: nginx -// image: nginx:1.7.9 -// ports: -// - containerPort: 80 -// +/* +apiVersion: apps/v1 +kind: Deployment +metadata: +name: nginx +labels: + app: nginx +spec: +replicas: 5 +selector: + matchLabels: + app: nginx +template: + metadata: + labels: + app: nginx + kratos-service-id: "56991810-c77f-4a95-8190-393efa9c1a61" + kratos-service-app: "nginx" + kratos-service-version: "v3.5.0" + annotations: + kratos-service-protocols: | + {"80": "http"} + kratos-service-metadata: | + {"region": "sh", "zone": "sh001", "cluster": "pd"} + spec: + containers: + - name: nginx + image: nginx:1.7.9 + ports: + - containerPort: 80 +*/ const ( // LabelsKeyServiceID is used to define the ID of the service LabelsKeyServiceID = "kratos-service-id" diff --git a/transport/grpc/resolver/direct/builder.go b/transport/grpc/resolver/direct/builder.go index 1eb821649..6035e2d5f 100644 --- a/transport/grpc/resolver/direct/builder.go +++ b/transport/grpc/resolver/direct/builder.go @@ -14,7 +14,8 @@ type directBuilder struct{} // NewBuilder creates a directBuilder which is used to factory direct resolvers. // example: -// direct:///127.0.0.1:9000,127.0.0.2:9000 +// +// direct:///127.0.0.1:9000,127.0.0.2:9000 func NewBuilder() resolver.Builder { return &directBuilder{} } diff --git a/transport/grpc/server.go b/transport/grpc/server.go index b66ba932d..9e5ff17fd 100644 --- a/transport/grpc/server.go +++ b/transport/grpc/server.go @@ -176,7 +176,8 @@ func (s *Server) Use(selector string, m ...middleware.Middleware) { // Endpoint return a real address to registry endpoint. // examples: -// grpc://127.0.0.1:9000?isSecure=false +// +// grpc://127.0.0.1:9000?isSecure=false func (s *Server) Endpoint() (*url.URL, error) { if err := s.listenAndEndpoint(); err != nil { return nil, s.err diff --git a/transport/http/server.go b/transport/http/server.go index 4767e79b4..db7d0a723 100644 --- a/transport/http/server.go +++ b/transport/http/server.go @@ -256,8 +256,9 @@ func (s *Server) filter() mux.MiddlewareFunc { // Endpoint return a real address to registry endpoint. // examples: -// https://127.0.0.1:8000 -// Legacy: http://127.0.0.1:8000?isSecure=false +// +// https://127.0.0.1:8000 +// Legacy: http://127.0.0.1:8000?isSecure=false func (s *Server) Endpoint() (*url.URL, error) { if err := s.listenAndEndpoint(); err != nil { return nil, err From 57dee517e57451662bc06ed2fd2fe936c80c843b Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Wed, 10 Aug 2022 22:34:25 +0800 Subject: [PATCH 04/71] fix(chore): set nacos-server v2.1.0 and consul v1.12.3 (#2268) * fix(chore): set nacos-server v2.1.0 Signed-off-by: Weizhen Wang * improve(chore): set consul 1.12.3 Signed-off-by: Weizhen Wang --- .github/workflows/go.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 16bb0a9fb..b1c2ca11a 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -25,11 +25,11 @@ jobs: ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379 ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379 consul: - image: consul:latest + image: consul:1.12.3 ports: - 8500:8500 nacos: - image: nacos/nacos-server:latest + image: nacos/nacos-server:v2.1.0 env: MODE: standalone ports: From f0c2a6ed90d1eca00a0adbc667249c401a029cae Mon Sep 17 00:00:00 2001 From: realityone Date: Thu, 11 Aug 2022 11:32:10 +0800 Subject: [PATCH 05/71] Global logger (#2265) * global logger * return global logger appliance instead of inner logger * fix lint issues * global logger test --- log/global.go | 6 +++--- log/global_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/log/global.go b/log/global.go index f75b07e64..624fccb39 100644 --- a/log/global.go +++ b/log/global.go @@ -27,8 +27,8 @@ func (a *loggerAppliance) SetLogger(in Logger) { a.Logger = in } -func (a *loggerAppliance) GetLogger() Logger { - return a.Logger +func (a *loggerAppliance) Log(level Level, keyvals ...interface{}) error { + return a.Logger.Log(level, keyvals...) } // SetLogger should be called before any other log call. @@ -39,7 +39,7 @@ func SetLogger(logger Logger) { // GetLogger returns global logger appliance as logger in current process. func GetLogger() Logger { - return global.GetLogger() + return global } // Log Print log by level and keyvals. diff --git a/log/global_test.go b/log/global_test.go index 04bb19c51..16aa67738 100644 --- a/log/global_test.go +++ b/log/global_test.go @@ -14,7 +14,7 @@ func TestGlobalLog(t *testing.T) { logger := NewStdLogger(buffer) SetLogger(logger) - if GetLogger() != logger { + if global.Logger != logger { t.Error("GetLogger() is not equal to logger") } From b9b7888d51074dd5c7779023da2de6720699b261 Mon Sep 17 00:00:00 2001 From: SeniorPlayer <12043634+SeniorPlayer@users.noreply.github.com> Date: Sat, 13 Aug 2022 13:00:02 +0800 Subject: [PATCH 06/71] fix(log): DefaultCaller doesn't returns "pkg/file:line", it returns "file:line" now. For example, both biz/user.go and data/user.go are printed as user.go in logger. It's not clear. (#2274) Co-authored-by: SeniorPlayer --- log/value.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/log/value.go b/log/value.go index 5aceffeb5..66f0b81c0 100644 --- a/log/value.go +++ b/log/value.go @@ -32,6 +32,10 @@ func Caller(depth int) Valuer { return func(context.Context) interface{} { _, file, line, _ := runtime.Caller(depth) idx := strings.LastIndexByte(file, '/') + if idx == -1 { + return file[idx+1:] + ":" + strconv.Itoa(line) + } + idx = strings.LastIndexByte(file[:idx], '/') return file[idx+1:] + ":" + strconv.Itoa(line) } } From 84235462b728d41318f82f84eb2cf11a8812f12d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=85=E5=AD=90?= Date: Sat, 13 Aug 2022 13:00:17 +0800 Subject: [PATCH 07/71] feat(registry): consul get service support remote (#2275) * feat(registry): consul get service support remote acces * fix lint --- contrib/registry/consul/registry.go | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/contrib/registry/consul/registry.go b/contrib/registry/consul/registry.go index 7e454ea24..9da95d77b 100644 --- a/contrib/registry/consul/registry.go +++ b/contrib/registry/consul/registry.go @@ -100,19 +100,33 @@ func (r *Registry) Deregister(ctx context.Context, svc *registry.ServiceInstance } // GetService return service by name -func (r *Registry) GetService(ctx context.Context, name string) (services []*registry.ServiceInstance, err error) { +func (r *Registry) GetService(ctx context.Context, name string) ([]*registry.ServiceInstance, error) { r.lock.RLock() defer r.lock.RUnlock() set := r.registry[name] + + getRemote := func() []*registry.ServiceInstance { + services, _, err := r.cli.Service(ctx, name, 0, true) + if err == nil && len(services) > 0 { + return services + } + return nil + } + if set == nil { + if s := getRemote(); len(s) > 0 { + return s, nil + } return nil, fmt.Errorf("service %s not resolved in registry", name) } ss, _ := set.services.Load().([]*registry.ServiceInstance) if ss == nil { + if s := getRemote(); len(s) > 0 { + return s, nil + } return nil, fmt.Errorf("service %s not found in registry", name) } - services = append(services, ss...) - return + return ss, nil } // ListServices return service list. From 6d665c0ce640cd1b35e72f68d5009af09825d65c Mon Sep 17 00:00:00 2001 From: Haibo Date: Sat, 13 Aug 2022 13:00:43 +0800 Subject: [PATCH 08/71] fix: wrong order of Logger prefix kvs (#2273) --- log/log.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log/log.go b/log/log.go index c1fad7703..bbaf94dae 100644 --- a/log/log.go +++ b/log/log.go @@ -40,8 +40,8 @@ func With(l Logger, kv ...interface{}) Logger { return &logger{logger: l, prefix: kv, hasValuer: containsValuer(kv), ctx: context.Background()} } kvs := make([]interface{}, 0, len(c.prefix)+len(kv)) - kvs = append(kvs, kv...) kvs = append(kvs, c.prefix...) + kvs = append(kvs, kv...) return &logger{ logger: c.logger, prefix: kvs, From d11c6892b41e65d7081fe2917fd973cbdaaece2f Mon Sep 17 00:00:00 2001 From: kkf1 <46839758+kkf1@users.noreply.github.com> Date: Mon, 15 Aug 2022 22:09:48 +0800 Subject: [PATCH 09/71] feat: add servicecomb registry (#2114) * add servicecomb registry --- contrib/registry/servicecomb/README.md | 67 ++ contrib/registry/servicecomb/go.mod | 15 + contrib/registry/servicecomb/go.sum | 737 ++++++++++++++++++ contrib/registry/servicecomb/registry.go | 174 +++++ contrib/registry/servicecomb/registry_test.go | 128 +++ contrib/registry/servicecomb/watcher.go | 63 ++ 6 files changed, 1184 insertions(+) create mode 100644 contrib/registry/servicecomb/README.md create mode 100644 contrib/registry/servicecomb/go.mod create mode 100644 contrib/registry/servicecomb/go.sum create mode 100644 contrib/registry/servicecomb/registry.go create mode 100644 contrib/registry/servicecomb/registry_test.go create mode 100644 contrib/registry/servicecomb/watcher.go diff --git a/contrib/registry/servicecomb/README.md b/contrib/registry/servicecomb/README.md new file mode 100644 index 000000000..ea48cb930 --- /dev/null +++ b/contrib/registry/servicecomb/README.md @@ -0,0 +1,67 @@ +# Servicecomb Registry + +## example +### server +```go +package main + +import ( + "log" + + "github.com/go-chassis/sc-client" + "github.com/go-kratos/kratos/contrib/registry/servicecomb/v2" + "github.com/go-kratos/kratos/v2" +) + +func main() { + c, err := sc.NewClient(sc.Options{ + Endpoints: []string{"127.0.0.1:30100"}, + }) + if err != nil { + log.Panic(err) + } + r := servicecomb.NewRegistry(c) + app := kratos.New( + kratos.Name("helloServicecomb"), + kratos.Registrar(r), + ) + if err := app.Run(); err != nil { + log.Fatal(err) + } +} + +``` +### client +```go +package main + +import ( + "context" + "log" + + "github.com/go-chassis/sc-client" + "github.com/go-kratos/kratos/contrib/registry/servicecomb/v2" + "github.com/go-kratos/kratos/v2/transport/grpc" +) + +func main() { + c, err := sc.NewClient(sc.Options{ + Endpoints: []string{"127.0.0.1:30100"}, + }) + if err != nil { + log.Panic(err) + } + r := servicecomb.NewRegistry(c) + ctx := context.Background() + conn, err := grpc.DialInsecure( + ctx, + grpc.WithEndpoint("discovery:///helloServicecomb"), + grpc.WithDiscovery(r), + ) + if err != nil { + return + } + defer conn.Close() +} + +``` \ No newline at end of file diff --git a/contrib/registry/servicecomb/go.mod b/contrib/registry/servicecomb/go.mod new file mode 100644 index 000000000..43661281a --- /dev/null +++ b/contrib/registry/servicecomb/go.mod @@ -0,0 +1,15 @@ +module github.com/go-kratos/kratos/contrib/registry/servicecomb/v2 + +go 1.16 + +require ( + github.com/go-chassis/cari v0.6.0 + github.com/go-chassis/sc-client v0.6.1-0.20210615014358-a45e9090c751 + github.com/go-kratos/kratos/v2 v2.3.1 + github.com/gofrs/uuid v4.2.0+incompatible +) + +require ( + github.com/stretchr/testify v1.7.1 + golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 +) diff --git a/contrib/registry/servicecomb/go.sum b/contrib/registry/servicecomb/go.sum new file mode 100644 index 000000000..738943dbe --- /dev/null +++ b/contrib/registry/servicecomb/go.sum @@ -0,0 +1,737 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/Shonminh/apollo-client v0.4.0/go.mod h1:Jk6K99uIGxQm7Uyy1gCQTvM/kc1YLp4Qo9/jtGkEXvI= +github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= +github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/cenkalti/backoff v2.0.0+incompatible h1:5IIPUHhlnUZbcHQsQou5k1Tn58nJkeJL9U+ig5CHJbY= +github.com/cenkalti/backoff v2.0.0+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= +github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= +github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= +github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= +github.com/coocood/freecache v1.0.1/go.mod h1:ePwxCDzOYvARfHdr1pByNct1at3CoKnsipOHwKlNbzI= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.12.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= +github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= +github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= +github.com/go-chassis/cari v0.0.0-20201210041921-7b6fbef2df11/go.mod h1:MgtsEI0AM4Ush6Lyw27z9Gk4nQ/8GWTSXrFzupawWDM= +github.com/go-chassis/cari v0.4.0/go.mod h1:av/19fqwEP4eOC8unL/z67AAbFDwXUCko6SKa4Avrd8= +github.com/go-chassis/cari v0.5.0/go.mod h1:av/19fqwEP4eOC8unL/z67AAbFDwXUCko6SKa4Avrd8= +github.com/go-chassis/cari v0.6.0 h1:cwBchwt9L8JOyO6QkzXFAsseMJ10zVSiVK8eDLD0HkA= +github.com/go-chassis/cari v0.6.0/go.mod h1:mSDRCOQXGmlD69A6NG0hsv0UP1xbVPtL6HCGI6X1tqs= +github.com/go-chassis/foundation v0.2.2-0.20201210043510-9f6d3de40234/go.mod h1:2PjwqpVwYEVaAldl5A58a08viH8p27pNeYaiE3ZxOBA= +github.com/go-chassis/foundation v0.2.2/go.mod h1:2PjwqpVwYEVaAldl5A58a08viH8p27pNeYaiE3ZxOBA= +github.com/go-chassis/foundation v0.3.0/go.mod h1:2PjwqpVwYEVaAldl5A58a08viH8p27pNeYaiE3ZxOBA= +github.com/go-chassis/foundation v0.4.0 h1:z0xETnSxF+vRXWjoIhOdzt6rywjZ4sB++utEl4YgWEY= +github.com/go-chassis/foundation v0.4.0/go.mod h1:6NsIUaHghTFRGfCBcZN011zl196F6OR5QvD9N+P4oWU= +github.com/go-chassis/go-archaius v1.5.1/go.mod h1:QPwvvtBxvwiC48rmydoAqxopqOr93RCQ6syWsIkXPXQ= +github.com/go-chassis/go-chassis/v2 v2.3.0/go.mod h1:iyJ2DWSkqfnCmad/0Il9nXWHaob7RcwPGlIDRNxccH0= +github.com/go-chassis/go-restful-swagger20 v1.0.3/go.mod h1:eW62fYuzlNFDvIacB6AV8bhUDCTy4myfTCv0bT9Gbb0= +github.com/go-chassis/kie-client v0.0.0-20201210060018-938c7680a9ab/go.mod h1:UTdbtyN5ge/v9DmQzdVRxQP7z51Q4z6hyl+W6ZpUHFM= +github.com/go-chassis/openlog v1.1.2/go.mod h1:+eYCADVxWyJkwsFMUBrMxyQlNqW+UUsCxvR2LrYZUaA= +github.com/go-chassis/openlog v1.1.3 h1:XqIOvZ8YPJ9o9lLtLBskQNNWolK5kC6a4Sv7r4s9sZ4= +github.com/go-chassis/openlog v1.1.3/go.mod h1:+eYCADVxWyJkwsFMUBrMxyQlNqW+UUsCxvR2LrYZUaA= +github.com/go-chassis/sc-client v0.6.1-0.20210615014358-a45e9090c751 h1:hpWN/MZBMsnJqXdMkW7v0wsC+4rYulPsBFMrHCmZMQc= +github.com/go-chassis/sc-client v0.6.1-0.20210615014358-a45e9090c751/go.mod h1:TBS9g7OaIeu1OR/9tVPJEl6BgHFcYEdbuJlgVDQczbc= +github.com/go-chassis/seclog v1.3.0/go.mod h1:a/zGvX5BRiwtq/O0fRqS6VWjrBaXYtqFJBx3EX9xzSE= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kratos/aegis v0.1.2/go.mod h1:jYeSQ3Gesba478zEnujOiG5QdsyF3Xk/8owFUeKcHxw= +github.com/go-kratos/kratos/v2 v2.3.1 h1:Qfx3JSEIrfZl0f8mXvbeGv3tRIZ2L/ArhcKwxAr3uMo= +github.com/go-kratos/kratos/v2 v2.3.1/go.mod h1:5acyLj4EgY428AJnZl2EwCrMV1OVlttQFBum+SghMiA= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= +github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= +github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/form/v4 v4.2.0 h1:N1wh+Goz61e6w66vo8vJkQt+uwZSoLz50kZPJWR8eic= +github.com/go-playground/form/v4 v4.2.0/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator v9.31.0+incompatible/go.mod h1:yrEkQXlcI+PugkyDjY2bRrL/UBU4f3rvrgkN3V8JEig= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= +github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= +github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.4.3-0.20210424162022-e8629af678b7 h1:L89uC9ATI61/V2eNgZYtQHyjjyjEplemB+aky4HdyzQ= +github.com/gorilla/websocket v1.4.3-0.20210424162022-e8629af678b7/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/karlseguin/ccache/v2 v2.0.8/go.mod h1:2BDThcfQMf/c0jnZowt16eW405XIqZPavt+HoYEtcxQ= +github.com/karlseguin/expect v1.0.2-0.20190806010014-778a5f0c6003/go.mod h1:zNBxMY8P21owkeogJELCLeHIt+voOSduHYTFUbwRAV8= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/little-cui/etcdadpt v0.3.2/go.mod h1:HnRRpIrVEVNWobkiCvG2EHLWKKZ+L047EcI29ma2zA4= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shirou/gopsutil/v3 v3.21.8/go.mod h1:YWp/H8Qs5fVmf17v7JNZzA0mPJ+mS2e9JdiUF9LlKzQ= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= +github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0/go.mod h1:IXCdmsXIht47RaVFLEdVnh1t+pgYtTAhQGj73kz+2DM= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= +go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= +go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= +go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= +go.mongodb.org/mongo-driver v1.5.1/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= +go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= +go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= +go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= +go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= +go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= +go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= +go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= +go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= +go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= +go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= +go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/ratelimit v0.1.0/go.mod h1:2X8KaoNd1J0lZV+PxJk/5+DGbO/tpwLR1m++a7FnB/Y= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 h1:w8s32wxx3sY+OjLlv9qltkLU5yvJzxjjgiHWLjdIcw4= +golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd h1:e0TwkXOdbnH/1x5rc5MZ/VYyiZ4v+RdVfrGMqEwT68I= +google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2 h1:u+MLGgVf7vRdjEYZ8wDFhAVNmhkbJ5hmrA1LMWK1CAQ= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= +gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI= +k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= +k8s.io/client-go v0.17.0/go.mod h1:TYgR6EUHs6k45hb6KWjVD6jFZvJV4gHDikv/It0xz+k= +k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= +k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/contrib/registry/servicecomb/registry.go b/contrib/registry/servicecomb/registry.go new file mode 100644 index 000000000..7dd388c9b --- /dev/null +++ b/contrib/registry/servicecomb/registry.go @@ -0,0 +1,174 @@ +package servicecomb + +import ( + "context" + "encoding/json" + "os" + "time" + + "github.com/go-chassis/cari/discovery" + pb "github.com/go-chassis/cari/discovery" + "github.com/go-chassis/cari/pkg/errsvc" + "github.com/go-chassis/sc-client" + + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" + "github.com/gofrs/uuid" +) + +func init() { + appID = os.Getenv(appIDVar) + if appID == "" { + appID = "default" + } + env = os.Getenv(envVar) +} + +var ( + _ registry.Registrar = (*Registry)(nil) + _ registry.Discovery = (*Registry)(nil) +) + +var ( + curServiceID string + appID string + env string +) + +const ( + appIDKey = "appId" + envKey = "environment" + envVar = "CAS_ENVIRONMENT_ID" + appIDVar = "CAS_APPLICATION_NAME" + frameWorkName = "kratos" + frameWorkVersion = "v2" +) + +type RegistryClient interface { + GetMicroServiceID(appID, microServiceName, version, env string, opts ...sc.CallOption) (string, error) + FindMicroServiceInstances(consumerID, appID, microServiceName, versionRule string, opts ...sc.CallOption) ([]*discovery.MicroServiceInstance, error) + RegisterService(microService *discovery.MicroService) (string, error) + RegisterMicroServiceInstance(microServiceInstance *discovery.MicroServiceInstance) (string, error) + Heartbeat(microServiceID, microServiceInstanceID string) (bool, error) + UnregisterMicroServiceInstance(microServiceID, microServiceInstanceID string) (bool, error) + WatchMicroService(microServiceID string, callback func(*sc.MicroServiceInstanceChangedEvent)) error +} + +// Registry is servicecomb registry. +type Registry struct { + cli RegistryClient +} + +func NewRegistry(client RegistryClient) *Registry { + r := &Registry{ + cli: client, + } + return r +} + +func (r *Registry) GetService(_ context.Context, serviceName string) ([]*registry.ServiceInstance, error) { + instances, err := r.cli.FindMicroServiceInstances("", appID, serviceName, "") + if err != nil { + return nil, err + } + svcInstances := make([]*registry.ServiceInstance, 0, len(instances)) + for _, instance := range instances { + svcInstances = append(svcInstances, ®istry.ServiceInstance{ + ID: instance.InstanceId, + Name: serviceName, + Metadata: instance.Properties, + Endpoints: instance.Endpoints, + Version: instance.ServiceId, + }) + } + return svcInstances, nil +} + +func (r *Registry) Watch(ctx context.Context, serviceName string) (registry.Watcher, error) { + return newWatcher(ctx, r.cli, serviceName) +} + +func (r *Registry) Register(_ context.Context, svcIns *registry.ServiceInstance) error { + fw := &discovery.FrameWork{ + Name: frameWorkName, + Version: frameWorkVersion, + } + ms := &discovery.MicroService{ + ServiceName: svcIns.Name, + AppId: appID, + Version: svcIns.Version, + Environment: env, + Framework: fw, + } + // 先尝试创建微服务 + sid, err := r.cli.RegisterService(ms) + // 若失败,说明服务可能已注册 + if err != nil { + registryException, ok := err.(*sc.RegistryException) + if !ok { + return err + } + var svcErr errsvc.Error + parseErr := json.Unmarshal([]byte(registryException.Message), &svcErr) + if parseErr != nil { + return parseErr + } + // 若错误码显示服务未注册,直接返回 + if svcErr.Code != pb.ErrServiceAlreadyExists { + return err + } + sid, err = r.cli.GetMicroServiceID(appID, ms.ServiceName, ms.Version, ms.Environment) + if err != nil { + return err + } + } else { + // 保存当前版本微服务对应的sid + curServiceID = sid + } + props := make(map[string]string) + props[appIDKey] = appID + props[envKey] = env + if svcIns.ID == "" { + var id uuid.UUID + id, err = uuid.NewV4() + if err != nil { + return err + } + svcIns.ID = id.String() + } + _, err = r.cli.RegisterMicroServiceInstance(&discovery.MicroServiceInstance{ + InstanceId: svcIns.ID, + ServiceId: sid, + Endpoints: svcIns.Endpoints, + HostName: svcIns.ID, + Properties: props, + Version: svcIns.Version, + }) + if err != nil { + return err + } + ticker := time.NewTicker(30 * time.Second) + go func() { + for { + <-ticker.C + _, err = r.cli.Heartbeat(sid, svcIns.ID) + if err != nil { + log.Errorf("failed to send heartbeat: %v", err) + continue + } + } + }() + return nil +} + +func (r *Registry) Deregister(_ context.Context, svcIns *registry.ServiceInstance) error { + sid, err := r.cli.GetMicroServiceID(appID, svcIns.Name, svcIns.Version, env) + if err != nil { + return err + } + _, err = r.cli.UnregisterMicroServiceInstance(sid, svcIns.ID) + if err != nil { + return err + } + return nil +} diff --git a/contrib/registry/servicecomb/registry_test.go b/contrib/registry/servicecomb/registry_test.go new file mode 100644 index 000000000..d100c68a1 --- /dev/null +++ b/contrib/registry/servicecomb/registry_test.go @@ -0,0 +1,128 @@ +package servicecomb + +import ( + "context" + "testing" + + pb "github.com/go-chassis/cari/discovery" + "github.com/go-chassis/sc-client" + + "github.com/go-kratos/kratos/v2/registry" + "github.com/gofrs/uuid" + "github.com/stretchr/testify/assert" +) + +var r *Registry + +func init() { + c := &mockClient{} + r = NewRegistry(c) +} + +type mockClient struct{} + +func (receiver *mockClient) WatchMicroService(microServiceID string, callback func(*sc.MicroServiceInstanceChangedEvent)) error { + return nil +} + +//nolint +func (receiver *mockClient) FindMicroServiceInstances(consumerID, + appID, microServiceName, versionRule string, opts ...sc.CallOption, + +) ([]*pb.MicroServiceInstance, error) { + if microServiceName == "KratosServicecomb" { + return []*pb.MicroServiceInstance{{}}, nil + } + return nil, nil +} + +func (receiver *mockClient) RegisterService(microService *pb.MicroService) (string, error) { + return "", nil +} + +func (receiver *mockClient) RegisterMicroServiceInstance(microServiceInstance *pb.MicroServiceInstance) (string, error) { + return "", nil +} + +func (receiver *mockClient) Heartbeat(microServiceID, microServiceInstanceID string) (bool, error) { + return true, nil +} + +func (receiver *mockClient) UnregisterMicroServiceInstance(microServiceID, microServiceInstanceID string) (bool, error) { + return true, nil +} + +func (receiver *mockClient) GetMicroServiceID(appID, microServiceName, version, env string, opts ...sc.CallOption) (string, error) { + return "", nil +} + +// TestRegistry +func TestRegistry(t *testing.T) { + instanceID, err := uuid.NewV4() + assert.NoError(t, err) + svc := ®istry.ServiceInstance{ + Name: "KratosServicecomb", + Version: "0.0.1", + Metadata: map[string]string{"app": "kratos"}, + Endpoints: []string{"tcp://127.0.0.1:9000?isSecure=false"}, + ID: instanceID.String(), + } + ctx := context.TODO() + t.Run("Register test, expected: success.", func(t *testing.T) { + err = r.Register(ctx, svc) + assert.NoError(t, err) + }) + t.Run("GetService test, expected: success.", func(t *testing.T) { + var insts []*registry.ServiceInstance + insts, err = r.GetService(ctx, svc.Name) + assert.NoError(t, err) + assert.Greater(t, len(insts), 0) + }) + t.Run("Deregister test, expected: success.", func(t *testing.T) { + svc.ID = instanceID.String() + err = r.Deregister(ctx, svc) + assert.NoError(t, err) + }) +} + +func TestWatcher(t *testing.T) { + ctx := context.TODO() + instanceID1, err := uuid.NewV4() + assert.NoError(t, err) + svc1 := ®istry.ServiceInstance{ + Name: "WatcherTest", + Version: "0.0.1", + Metadata: map[string]string{"app": "kratos"}, + Endpoints: []string{"tcp://127.0.0.1:9000?isSecure=false"}, + ID: instanceID1.String(), + } + err = r.Register(ctx, svc1) + assert.NoError(t, err) + w, err := r.Watch(ctx, "WatcherTest") + assert.NoError(t, err) + assert.NotEmpty(t, w) + sbWatcher := w.(*Watcher) + t.Run("Watch register event, expected: success", func(t *testing.T) { + go sbWatcher.Put(svc1) + var instances []*registry.ServiceInstance + instances, err = w.Next() + assert.NoError(t, err) + assert.NotEmpty(t, instances) + assert.Equal(t, instanceID1.String(), instances[0].ID) + }) + t.Run("Watch deregister event, expected: success", func(t *testing.T) { + // Deregister instance1. + err = r.Deregister(ctx, svc1) + assert.NoError(t, err) + go sbWatcher.Put(svc1) + var instances []*registry.ServiceInstance + instances, err = w.Next() + assert.NoError(t, err) + assert.NotEmpty(t, instances) + assert.Equal(t, instanceID1.String(), instances[0].ID) + }) + t.Run("Stop test, expected: success", func(t *testing.T) { + err = w.Stop() + assert.NoError(t, err) + }) +} diff --git a/contrib/registry/servicecomb/watcher.go b/contrib/registry/servicecomb/watcher.go new file mode 100644 index 000000000..2b2117e81 --- /dev/null +++ b/contrib/registry/servicecomb/watcher.go @@ -0,0 +1,63 @@ +package servicecomb + +import ( + "github.com/go-chassis/sc-client" + + "github.com/go-kratos/kratos/v2/registry" + "golang.org/x/net/context" +) + +var _ registry.Watcher = (*Watcher)(nil) + +type Watcher struct { + cli RegistryClient + ch chan *registry.ServiceInstance +} + +func newWatcher(_ context.Context, cli RegistryClient, serviceName string) (*Watcher, error) { + // 构建当前服务与目标服务之间的依赖关系,完成discovery + _, err := cli.FindMicroServiceInstances(curServiceID, appID, serviceName, "") + if err != nil { + return nil, err + } + w := &Watcher{ + cli: cli, + ch: make(chan *registry.ServiceInstance), + } + go func() { + watchErr := w.cli.WatchMicroService(curServiceID, func(event *sc.MicroServiceInstanceChangedEvent) { + if event.Key.ServiceName != serviceName { + return + } + svcIns := ®istry.ServiceInstance{ + ID: event.Instance.InstanceId, + Name: event.Key.ServiceName, + Version: event.Key.Version, + Metadata: event.Instance.Properties, + Endpoints: event.Instance.Endpoints, + } + w.Put(svcIns) + }) + if watchErr != nil { + return + } + }() + return w, nil +} + +// Put only for UT +func (w *Watcher) Put(svcIns *registry.ServiceInstance) { + w.ch <- svcIns +} + +func (w *Watcher) Next() ([]*registry.ServiceInstance, error) { + var svcInstances []*registry.ServiceInstance + svcIns := <-w.ch + svcInstances = append(svcInstances, svcIns) + return svcInstances, nil +} + +func (w *Watcher) Stop() error { + close(w.ch) + return nil +} From 11cd43e3c302fb0583b6fd01a4afedffd0e93665 Mon Sep 17 00:00:00 2001 From: longxboy Date: Tue, 16 Aug 2022 21:21:58 +0800 Subject: [PATCH 10/71] refactor: unify selector filter (#2277) * unify selector Co-authored-by: caoguoliang01 Co-authored-by: chenzhihui --- selector/default_selector.go | 12 ++---- selector/filter.go | 4 +- selector/filter/version.go | 2 +- selector/global.go | 13 +++++++ selector/options.go | 8 ++-- selector/p2c/p2c.go | 12 +----- selector/p2c/p2c_test.go | 8 ++-- selector/random/random.go | 12 +----- selector/random/random_test.go | 4 +- selector/selector.go | 6 +-- selector/selector_test.go | 11 +++--- selector/wrr/wrr.go | 12 +----- selector/wrr/wrr_test.go | 4 +- transport/grpc/balancer.go | 68 +++++++++++++-------------------- transport/grpc/balancer_test.go | 11 +----- transport/grpc/client.go | 33 ++++++++-------- transport/grpc/transport.go | 8 ++-- transport/http/client.go | 24 ++++++++---- transport/http/client_test.go | 15 +++++--- 19 files changed, 116 insertions(+), 151 deletions(-) create mode 100644 selector/global.go diff --git a/selector/default_selector.go b/selector/default_selector.go index 0e99249eb..247af2e92 100644 --- a/selector/default_selector.go +++ b/selector/default_selector.go @@ -9,7 +9,6 @@ import ( type Default struct { NodeBuilder WeightedNodeBuilder Balancer Balancer - Filters []Filter nodes atomic.Value } @@ -27,16 +26,13 @@ func (d *Default) Select(ctx context.Context, opts ...SelectOption) (selected No for _, o := range opts { o(&options) } - if len(d.Filters) > 0 || len(options.Filters) > 0 { + if len(options.NodeFilters) > 0 { newNodes := make([]Node, len(nodes)) for i, wc := range nodes { newNodes[i] = wc } - for _, f := range d.Filters { - newNodes = f(ctx, newNodes) - } - for _, f := range options.Filters { - newNodes = f(ctx, newNodes) + for _, filter := range options.NodeFilters { + newNodes = filter(ctx, newNodes) } candidates = make([]WeightedNode, len(newNodes)) for i, n := range newNodes { @@ -74,7 +70,6 @@ func (d *Default) Apply(nodes []Node) { type DefaultBuilder struct { Node WeightedNodeBuilder Balancer BalancerBuilder - Filters []Filter } // Build create builder @@ -82,6 +77,5 @@ func (db *DefaultBuilder) Build() Selector { return &Default{ NodeBuilder: db.Node, Balancer: db.Balancer.Build(), - Filters: db.Filters, } } diff --git a/selector/filter.go b/selector/filter.go index e88a52daf..c8b630d2b 100644 --- a/selector/filter.go +++ b/selector/filter.go @@ -2,5 +2,5 @@ package selector import "context" -// Filter is select filter. -type Filter func(context.Context, []Node) []Node +// NodeFilter is select filter. +type NodeFilter func(context.Context, []Node) []Node diff --git a/selector/filter/version.go b/selector/filter/version.go index 815d3fb70..41d56fbd3 100644 --- a/selector/filter/version.go +++ b/selector/filter/version.go @@ -7,7 +7,7 @@ import ( ) // Version is version filter. -func Version(version string) selector.Filter { +func Version(version string) selector.NodeFilter { return func(_ context.Context, nodes []selector.Node) []selector.Node { newNodes := nodes[:0] for _, n := range nodes { diff --git a/selector/global.go b/selector/global.go new file mode 100644 index 000000000..2f951212b --- /dev/null +++ b/selector/global.go @@ -0,0 +1,13 @@ +package selector + +var globalSelector Builder + +// GlobalSelector returns global selector builder. +func GlobalSelector() Builder { + return globalSelector +} + +// SetGlobalSelector set global selector builder. +func SetGlobalSelector(builder Builder) { + globalSelector = builder +} diff --git a/selector/options.go b/selector/options.go index c9129fb32..14b441d7b 100644 --- a/selector/options.go +++ b/selector/options.go @@ -2,15 +2,15 @@ package selector // SelectOptions is Select Options. type SelectOptions struct { - Filters []Filter + NodeFilters []NodeFilter } // SelectOption is Selector option. type SelectOption func(*SelectOptions) -// WithFilter with filter options -func WithFilter(fn ...Filter) SelectOption { +// WithNodeFilter with filter options +func WithNodeFilter(fn ...NodeFilter) SelectOption { return func(opts *SelectOptions) { - opts.Filters = fn + opts.NodeFilters = fn } } diff --git a/selector/p2c/p2c.go b/selector/p2c/p2c.go index 21a2199b8..6f8d5a3fa 100644 --- a/selector/p2c/p2c.go +++ b/selector/p2c/p2c.go @@ -19,20 +19,11 @@ const ( var _ selector.Balancer = &Balancer{} -// WithFilter with select filters -func WithFilter(filters ...selector.Filter) Option { - return func(o *options) { - o.filters = filters - } -} - // Option is random builder option. type Option func(o *options) // options is random builder options -type options struct { - filters []selector.Filter -} +type options struct{} // New creates a p2c selector. func New(opts ...Option) selector.Selector { @@ -95,7 +86,6 @@ func NewBuilder(opts ...Option) selector.Builder { opt(&option) } return &selector.DefaultBuilder{ - Filters: option.filters, Balancer: &Builder{}, Node: &ewma.Builder{}, } diff --git a/selector/p2c/p2c_test.go b/selector/p2c/p2c_test.go index 03d549e2c..f23412b71 100644 --- a/selector/p2c/p2c_test.go +++ b/selector/p2c/p2c_test.go @@ -16,7 +16,7 @@ import ( ) func TestWrr3(t *testing.T) { - p2c := New(WithFilter(filter.Version("v2.0.0"))) + p2c := New() var nodes []selector.Node for i := 0; i < 3; i++ { addr := fmt.Sprintf("127.0.0.%d:8080", i) @@ -41,7 +41,7 @@ func TestWrr3(t *testing.T) { d := time.Duration(rand.Intn(500)) * time.Millisecond lk.Unlock() time.Sleep(d) - n, done, err := p2c.Select(context.Background()) + n, done, err := p2c.Select(context.Background(), selector.WithNodeFilter(filter.Version("v2.0.0"))) if err != nil { t.Errorf("expect %v, got %v", nil, err) } @@ -92,7 +92,7 @@ func TestEmpty(t *testing.T) { } func TestOne(t *testing.T) { - p2c := New(WithFilter(filter.Version("v2.0.0"))) + p2c := New() var nodes []selector.Node for i := 0; i < 1; i++ { addr := fmt.Sprintf("127.0.0.%d:8080", i) @@ -106,7 +106,7 @@ func TestOne(t *testing.T) { })) } p2c.Apply(nodes) - n, done, err := p2c.Select(context.Background()) + n, done, err := p2c.Select(context.Background(), selector.WithNodeFilter(filter.Version("v2.0.0"))) if err != nil { t.Errorf("expect %v, got %v", nil, err) } diff --git a/selector/random/random.go b/selector/random/random.go index 824fb8834..cf59534d0 100644 --- a/selector/random/random.go +++ b/selector/random/random.go @@ -15,20 +15,11 @@ const ( var _ selector.Balancer = &Balancer{} // Name is balancer name -// WithFilter with select filters -func WithFilter(filters ...selector.Filter) Option { - return func(o *options) { - o.filters = filters - } -} - // Option is random builder option. type Option func(o *options) // options is random builder options -type options struct { - filters []selector.Filter -} +type options struct{} // Balancer is a random balancer. type Balancer struct{} @@ -56,7 +47,6 @@ func NewBuilder(opts ...Option) selector.Builder { opt(&option) } return &selector.DefaultBuilder{ - Filters: option.filters, Balancer: &Builder{}, Node: &direct.Builder{}, } diff --git a/selector/random/random_test.go b/selector/random/random_test.go index 7e69f3ee6..33e689941 100644 --- a/selector/random/random_test.go +++ b/selector/random/random_test.go @@ -10,7 +10,7 @@ import ( ) func TestWrr(t *testing.T) { - random := New(WithFilter(filter.Version("v2.0.0"))) + random := New() var nodes []selector.Node nodes = append(nodes, selector.NewNode( "http", @@ -31,7 +31,7 @@ func TestWrr(t *testing.T) { random.Apply(nodes) var count1, count2 int for i := 0; i < 200; i++ { - n, done, err := random.Select(context.Background()) + n, done, err := random.Select(context.Background(), selector.WithNodeFilter(filter.Version("v2.0.0"))) if err != nil { t.Errorf("expect no error, got %v", err) } diff --git a/selector/selector.go b/selector/selector.go index 79ecdf786..e346f6c35 100644 --- a/selector/selector.go +++ b/selector/selector.go @@ -57,7 +57,7 @@ type DoneInfo struct { // Response Error Err error // Response Metadata - ReplyMeta ReplyMeta + ReplyMD ReplyMD // BytesSent indicates if any bytes have been sent to the server. BytesSent bool @@ -65,8 +65,8 @@ type DoneInfo struct { BytesReceived bool } -// ReplyMeta is Reply Metadata. -type ReplyMeta interface { +// ReplyMD is Reply Metadata. +type ReplyMD interface { Get(key string) string } diff --git a/selector/selector_test.go b/selector/selector_test.go index 25e70acde..f7c1f1bcf 100644 --- a/selector/selector_test.go +++ b/selector/selector_test.go @@ -49,7 +49,7 @@ func (b *mockWeightedNodeBuilder) Build(n Node) WeightedNode { return &mockWeightedNode{Node: n} } -func mockFilter(version string) Filter { +func mockFilter(version string) NodeFilter { return func(_ context.Context, nodes []Node) []Node { newNodes := nodes[:0] for _, n := range nodes { @@ -83,7 +83,6 @@ func (b *mockBalancer) Pick(ctx context.Context, nodes []WeightedNode) (selected func TestDefault(t *testing.T) { builder := DefaultBuilder{ Node: &mockWeightedNodeBuilder{}, - Filters: []Filter{mockFilter("v2.0.0")}, Balancer: &mockBalancerBuilder{}, } selector := builder.Build() @@ -109,7 +108,7 @@ func TestDefault(t *testing.T) { Metadata: map[string]string{"weight": "10"}, })) selector.Apply(nodes) - n, done, err := selector.Select(context.Background(), WithFilter(mockFilter("v2.0.0"))) + n, done, err := selector.Select(context.Background(), WithNodeFilter(mockFilter("v2.0.0"))) if err != nil { t.Errorf("expect %v, got %v", nil, err) } @@ -137,7 +136,7 @@ func TestDefault(t *testing.T) { done(context.Background(), DoneInfo{}) // no v3.0.0 instance - n, done, err = selector.Select(context.Background(), WithFilter(mockFilter("v3.0.0"))) + n, done, err = selector.Select(context.Background(), WithNodeFilter(mockFilter("v3.0.0"))) if !errors.Is(ErrNoAvailable, err) { t.Errorf("expect %v, got %v", ErrNoAvailable, err) } @@ -150,7 +149,7 @@ func TestDefault(t *testing.T) { // apply zero instance selector.Apply([]Node{}) - n, done, err = selector.Select(context.Background(), WithFilter(mockFilter("v2.0.0"))) + n, done, err = selector.Select(context.Background(), WithNodeFilter(mockFilter("v2.0.0"))) if !errors.Is(ErrNoAvailable, err) { t.Errorf("expect %v, got %v", ErrNoAvailable, err) } @@ -163,7 +162,7 @@ func TestDefault(t *testing.T) { // apply zero instance selector.Apply(nil) - n, done, err = selector.Select(context.Background(), WithFilter(mockFilter("v2.0.0"))) + n, done, err = selector.Select(context.Background(), WithNodeFilter(mockFilter("v2.0.0"))) if !errors.Is(ErrNoAvailable, err) { t.Errorf("expect %v, got %v", ErrNoAvailable, err) } diff --git a/selector/wrr/wrr.go b/selector/wrr/wrr.go index c3405915b..0b95e04fb 100644 --- a/selector/wrr/wrr.go +++ b/selector/wrr/wrr.go @@ -15,20 +15,11 @@ const ( var _ selector.Balancer = &Balancer{} // Name is balancer name -// WithFilter with select filters -func WithFilter(filters ...selector.Filter) Option { - return func(o *options) { - o.filters = filters - } -} - // Option is random builder option. type Option func(o *options) // options is random builder options -type options struct { - filters []selector.Filter -} +type options struct{} // Balancer is a random balancer. type Balancer struct { @@ -77,7 +68,6 @@ func NewBuilder(opts ...Option) selector.Builder { opt(&option) } return &selector.DefaultBuilder{ - Filters: option.filters, Balancer: &Builder{}, Node: &direct.Builder{}, } diff --git a/selector/wrr/wrr_test.go b/selector/wrr/wrr_test.go index e3e96ed45..f1d4b45f5 100644 --- a/selector/wrr/wrr_test.go +++ b/selector/wrr/wrr_test.go @@ -11,7 +11,7 @@ import ( ) func TestWrr(t *testing.T) { - wrr := New(WithFilter(filter.Version("v2.0.0"))) + wrr := New() var nodes []selector.Node nodes = append(nodes, selector.NewNode( "http", @@ -32,7 +32,7 @@ func TestWrr(t *testing.T) { wrr.Apply(nodes) var count1, count2 int for i := 0; i < 90; i++ { - n, done, err := wrr.Select(context.Background()) + n, done, err := wrr.Select(context.Background(), selector.WithNodeFilter(filter.Version("v2.0.0"))) if err != nil { t.Errorf("expect no error, got %v", err) } diff --git a/transport/grpc/balancer.go b/transport/grpc/balancer.go index 2a27c05ad..bd50f0983 100644 --- a/transport/grpc/balancer.go +++ b/transport/grpc/balancer.go @@ -1,59 +1,45 @@ package grpc import ( - "sync" - "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/selector" - "github.com/go-kratos/kratos/v2/selector/p2c" - "github.com/go-kratos/kratos/v2/selector/random" - "github.com/go-kratos/kratos/v2/selector/wrr" "github.com/go-kratos/kratos/v2/transport" - gBalancer "google.golang.org/grpc/balancer" + "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/base" "google.golang.org/grpc/metadata" ) -var ( - _ base.PickerBuilder = &Builder{} - _ gBalancer.Picker = &Picker{} +const ( + balancerName = "selector" +) - mu sync.Mutex +var ( + _ base.PickerBuilder = &balancerBuilder{} + _ balancer.Picker = &balancerPicker{} ) func init() { - // inject global grpc balancer - SetGlobalBalancer(random.Name, random.NewBuilder()) - SetGlobalBalancer(wrr.Name, wrr.NewBuilder()) - SetGlobalBalancer(p2c.Name, p2c.NewBuilder()) -} - -// SetGlobalBalancer set grpc balancer with scheme. -func SetGlobalBalancer(scheme string, builder selector.Builder) { - mu.Lock() - defer mu.Unlock() - b := base.NewBalancerBuilder( - scheme, - &Builder{builder: builder}, + balancerName, + &balancerBuilder{ + builder: selector.GlobalSelector(), + }, base.Config{HealthCheck: true}, ) - gBalancer.Register(b) + balancer.Register(b) } -// Builder is grpc balancer builder. -type Builder struct { +type balancerBuilder struct { builder selector.Builder } // Build creates a grpc Picker. -func (b *Builder) Build(info base.PickerBuildInfo) gBalancer.Picker { +func (b *balancerBuilder) Build(info base.PickerBuildInfo) balancer.Picker { if len(info.ReadySCs) == 0 { // Block the RPC until a new picker is available via UpdateState(). - return base.NewErrPicker(gBalancer.ErrNoSubConnAvailable) + return base.NewErrPicker(balancer.ErrNoSubConnAvailable) } - nodes := make([]selector.Node, 0) for conn, info := range info.ReadySCs { ins, _ := info.Address.Attributes.Value("rawServiceInstance").(*registry.ServiceInstance) @@ -62,40 +48,40 @@ func (b *Builder) Build(info base.PickerBuildInfo) gBalancer.Picker { subConn: conn, }) } - p := &Picker{ + p := &balancerPicker{ selector: b.builder.Build(), } p.selector.Apply(nodes) return p } -// Picker is a grpc picker. -type Picker struct { +// balancerPicker is a grpc picker. +type balancerPicker struct { selector selector.Selector } // Pick pick instances. -func (p *Picker) Pick(info gBalancer.PickInfo) (gBalancer.PickResult, error) { - var filters []selector.Filter +func (p *balancerPicker) Pick(info balancer.PickInfo) (balancer.PickResult, error) { + var filters []selector.NodeFilter if tr, ok := transport.FromClientContext(info.Ctx); ok { if gtr, ok := tr.(*Transport); ok { - filters = gtr.SelectFilters() + filters = gtr.NodeFilters() } } - n, done, err := p.selector.Select(info.Ctx, selector.WithFilter(filters...)) + n, done, err := p.selector.Select(info.Ctx, selector.WithNodeFilter(filters...)) if err != nil { - return gBalancer.PickResult{}, err + return balancer.PickResult{}, err } - return gBalancer.PickResult{ + return balancer.PickResult{ SubConn: n.(*grpcNode).subConn, - Done: func(di gBalancer.DoneInfo) { + Done: func(di balancer.DoneInfo) { done(info.Ctx, selector.DoneInfo{ Err: di.Err, BytesSent: di.BytesSent, BytesReceived: di.BytesReceived, - ReplyMeta: Trailer(di.Trailer), + ReplyMD: Trailer(di.Trailer), }) }, }, nil @@ -115,5 +101,5 @@ func (t Trailer) Get(k string) string { type grpcNode struct { selector.Node - subConn gBalancer.SubConn + subConn balancer.SubConn } diff --git a/transport/grpc/balancer_test.go b/transport/grpc/balancer_test.go index bff519bd3..5b7002643 100644 --- a/transport/grpc/balancer_test.go +++ b/transport/grpc/balancer_test.go @@ -19,19 +19,10 @@ func TestTrailer(t *testing.T) { } } -func TestBalancerName(t *testing.T) { - o := &clientOptions{} - - WithBalancerName("p2c")(o) - if !reflect.DeepEqual("p2c", o.balancerName) { - t.Errorf("expect %v, got %v", "p2c", o.balancerName) - } -} - func TestFilters(t *testing.T) { o := &clientOptions{} - WithFilter(func(_ context.Context, nodes []selector.Node) []selector.Node { + WithNodeFilter(func(_ context.Context, nodes []selector.Node) []selector.Node { return nodes })(o) if !reflect.DeepEqual(1, len(o.filters)) { diff --git a/transport/grpc/client.go b/transport/grpc/client.go index 923e52671..a1424d209 100644 --- a/transport/grpc/client.go +++ b/transport/grpc/client.go @@ -10,7 +10,7 @@ import ( "github.com/go-kratos/kratos/v2/middleware" "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/selector" - "github.com/go-kratos/kratos/v2/selector/wrr" + "github.com/go-kratos/kratos/v2/selector/p2c" "github.com/go-kratos/kratos/v2/transport" "github.com/go-kratos/kratos/v2/transport/grpc/resolver/discovery" @@ -23,6 +23,12 @@ import ( grpcmd "google.golang.org/grpc/metadata" ) +func init() { + if selector.GlobalSelector() == nil { + selector.SetGlobalSelector(p2c.NewBuilder()) + } +} + // ClientOption is gRPC client option. type ClientOption func(o *clientOptions) @@ -75,15 +81,8 @@ func WithOptions(opts ...grpc.DialOption) ClientOption { } } -// WithBalancerName with balancer name -func WithBalancerName(name string) ClientOption { - return func(o *clientOptions) { - o.balancerName = name - } -} - -// WithFilter with select filters -func WithFilter(filters ...selector.Filter) ClientOption { +// WithNodeFilter with select filters +func WithNodeFilter(filters ...selector.NodeFilter) ClientOption { return func(o *clientOptions) { o.filters = filters } @@ -105,7 +104,7 @@ type clientOptions struct { ints []grpc.UnaryClientInterceptor grpcOpts []grpc.DialOption balancerName string - filters []selector.Filter + filters []selector.NodeFilter } // Dial returns a GRPC connection. @@ -121,7 +120,7 @@ func DialInsecure(ctx context.Context, opts ...ClientOption) (*grpc.ClientConn, func dial(ctx context.Context, insecure bool, opts ...ClientOption) (*grpc.ClientConn, error) { options := clientOptions{ timeout: 2000 * time.Millisecond, - balancerName: wrr.Name, + balancerName: balancerName, } for _, o := range opts { o(&options) @@ -156,13 +155,13 @@ func dial(ctx context.Context, insecure bool, opts ...ClientOption) (*grpc.Clien return grpc.DialContext(ctx, options.endpoint, grpcOpts...) } -func unaryClientInterceptor(ms []middleware.Middleware, timeout time.Duration, filters []selector.Filter) grpc.UnaryClientInterceptor { +func unaryClientInterceptor(ms []middleware.Middleware, timeout time.Duration, filters []selector.NodeFilter) grpc.UnaryClientInterceptor { return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { ctx = transport.NewClientContext(ctx, &Transport{ - endpoint: cc.Target(), - operation: method, - reqHeader: headerCarrier{}, - filters: filters, + endpoint: cc.Target(), + operation: method, + reqHeader: headerCarrier{}, + nodeFilters: filters, }) if timeout > 0 { var cancel context.CancelFunc diff --git a/transport/grpc/transport.go b/transport/grpc/transport.go index efa70e74c..a11a271ae 100644 --- a/transport/grpc/transport.go +++ b/transport/grpc/transport.go @@ -14,7 +14,7 @@ type Transport struct { operation string reqHeader headerCarrier replyHeader headerCarrier - filters []selector.Filter + nodeFilters []selector.NodeFilter } // Kind returns the transport kind. @@ -42,9 +42,9 @@ func (tr *Transport) ReplyHeader() transport.Header { return tr.replyHeader } -// SelectFilters returns the client select filters. -func (tr *Transport) SelectFilters() []selector.Filter { - return tr.filters +// NodeFilters returns the client select filters. +func (tr *Transport) NodeFilters() []selector.NodeFilter { + return tr.nodeFilters } type headerCarrier metadata.MD diff --git a/transport/http/client.go b/transport/http/client.go index f1c213598..79ac4f911 100644 --- a/transport/http/client.go +++ b/transport/http/client.go @@ -16,10 +16,16 @@ import ( "github.com/go-kratos/kratos/v2/middleware" "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/selector" - "github.com/go-kratos/kratos/v2/selector/wrr" + "github.com/go-kratos/kratos/v2/selector/p2c" "github.com/go-kratos/kratos/v2/transport" ) +func init() { + if selector.GlobalSelector() == nil { + selector.SetGlobalSelector(p2c.NewBuilder()) + } +} + // DecodeErrorFunc is decode error func. type DecodeErrorFunc func(ctx context.Context, res *http.Response) error @@ -43,7 +49,7 @@ type clientOptions struct { decoder DecodeResponseFunc errorDecoder DecodeErrorFunc transport http.RoundTripper - selector selector.Selector + nodeFilters []selector.NodeFilter discovery registry.Discovery middleware []middleware.Middleware block bool @@ -112,10 +118,10 @@ func WithDiscovery(d registry.Discovery) ClientOption { } } -// WithSelector with client selector. -func WithSelector(selector selector.Selector) ClientOption { +// WithNodeFilter with select filters +func WithNodeFilter(filters ...selector.NodeFilter) ClientOption { return func(o *clientOptions) { - o.selector = selector + o.nodeFilters = filters } } @@ -140,6 +146,7 @@ type Client struct { r *resolver cc *http.Client insecure bool + selector selector.Selector } // NewClient returns an HTTP client. @@ -151,7 +158,6 @@ func NewClient(ctx context.Context, opts ...ClientOption) (*Client, error) { decoder: DefaultResponseDecoder, errorDecoder: DefaultErrorDecoder, transport: http.DefaultTransport, - selector: wrr.New(), } for _, o := range opts { o(&options) @@ -166,10 +172,11 @@ func NewClient(ctx context.Context, opts ...ClientOption) (*Client, error) { if err != nil { return nil, err } + selector := selector.GlobalSelector().Build() var r *resolver if options.discovery != nil { if target.Scheme == "discovery" { - if r, err = newResolver(ctx, options.discovery, target, options.selector, options.block, insecure); err != nil { + if r, err = newResolver(ctx, options.discovery, target, selector, options.block, insecure); err != nil { return nil, fmt.Errorf("[http client] new resolver failed!err: %v", options.endpoint) } } else if _, _, err := host.ExtractHostPort(options.endpoint); err != nil { @@ -185,6 +192,7 @@ func NewClient(ctx context.Context, opts ...ClientOption) (*Client, error) { Timeout: options.timeout, Transport: options.transport, }, + selector: selector, }, nil } @@ -276,7 +284,7 @@ func (client *Client) do(req *http.Request) (*http.Response, error) { err error node selector.Node ) - if node, done, err = client.opts.selector.Select(req.Context()); err != nil { + if node, done, err = client.selector.Select(req.Context(), selector.WithNodeFilter(client.opts.nodeFilters...)); err != nil { return nil, errors.ServiceUnavailable("NODE_NOT_FOUND", err.Error()) } if client.insecure { diff --git a/transport/http/client_test.go b/transport/http/client_test.go index c768b364b..4ee00456f 100644 --- a/transport/http/client_test.go +++ b/transport/http/client_test.go @@ -182,13 +182,18 @@ func TestWithDiscovery(t *testing.T) { } } -func TestWithSelector(t *testing.T) { - ov := &selector.Default{} - o := WithSelector(ov) +func TestWithNodeFilter(t *testing.T) { + ov := func(context.Context, []selector.Node) []selector.Node { + return []selector.Node{&selector.DefaultNode{}} + } + o := WithNodeFilter(ov) co := &clientOptions{} o(co) - if !reflect.DeepEqual(co.selector, ov) { - t.Errorf("expected selector to be %v, got %v", ov, co.selector) + for _, n := range co.nodeFilters { + ret := n(context.Background(), nil) + if len(ret) != 1 { + t.Errorf("expected node length to be 1, got %v", len(ret)) + } } } From de2f93fbec3d80a81518add3328862d70061eaa5 Mon Sep 17 00:00:00 2001 From: Germiniku Date: Tue, 16 Aug 2022 22:22:35 +0900 Subject: [PATCH 11/71] refactor(log) aliyun use the same interface name (#2251) * feat(log): add tencent cls fix update * refactor(log) use the same interface name * fix(log) tencent toString --- contrib/log/aliyun/aliyun.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/log/aliyun/aliyun.go b/contrib/log/aliyun/aliyun.go index 0c1e1987f..53fdefde8 100644 --- a/contrib/log/aliyun/aliyun.go +++ b/contrib/log/aliyun/aliyun.go @@ -7,13 +7,13 @@ import ( sls "github.com/aliyun/aliyun-log-go-sdk" "github.com/aliyun/aliyun-log-go-sdk/producer" - klog "github.com/go-kratos/kratos/v2/log" + log "github.com/go-kratos/kratos/v2/log" "google.golang.org/protobuf/proto" ) // Log see more detail https://github.com/aliyun/aliyun-log-go-sdk -type Log interface { - klog.Logger +type Logger interface { + log.Logger GetProducer() *producer.Producer Close() error } @@ -78,7 +78,7 @@ func (a *aliyunLog) Close() error { return a.producer.Close(5000) } -func (a *aliyunLog) Log(level klog.Level, keyvals ...interface{}) error { +func (a *aliyunLog) Log(level log.Level, keyvals ...interface{}) error { buf := level.String() levelTitle := "level" @@ -108,7 +108,7 @@ func (a *aliyunLog) Log(level klog.Level, keyvals ...interface{}) error { } // NewAliyunLog new a aliyun logger with options. -func NewAliyunLog(options ...Option) Log { +func NewAliyunLog(options ...Option) Logger { opts := defaultOptions() for _, o := range options { o(opts) From 2d206076f88c1f9a85f4bd353cdfca8e4000896d Mon Sep 17 00:00:00 2001 From: Tony Chen Date: Tue, 16 Aug 2022 22:54:55 +0800 Subject: [PATCH 12/71] fix logger caller depth (#2283) --- log/global.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/log/global.go b/log/global.go index 624fccb39..f1984fc3f 100644 --- a/log/global.go +++ b/log/global.go @@ -27,10 +27,6 @@ func (a *loggerAppliance) SetLogger(in Logger) { a.Logger = in } -func (a *loggerAppliance) Log(level Level, keyvals ...interface{}) error { - return a.Logger.Log(level, keyvals...) -} - // SetLogger should be called before any other log call. // And it is NOT THREAD SAFE. func SetLogger(logger Logger) { From 3f31b4d734536a876c5b0e09b029d6074c105ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=85=E5=AD=90?= Date: Wed, 17 Aug 2022 13:04:56 +0800 Subject: [PATCH 13/71] bc: apollo unable to get and watch to the properties file (#2269) --- contrib/config/apollo/apollo.go | 147 ++++++++++++++++++++++++++++--- contrib/config/apollo/parser.go | 14 +-- contrib/config/apollo/watcher.go | 35 +++++++- 3 files changed, 165 insertions(+), 31 deletions(-) diff --git a/contrib/config/apollo/apollo.go b/contrib/config/apollo/apollo.go index a0a38b023..5f868bab9 100644 --- a/contrib/config/apollo/apollo.go +++ b/contrib/config/apollo/apollo.go @@ -7,7 +7,10 @@ import ( "github.com/go-kratos/kratos/v2/log" "github.com/apolloconfig/agollo/v4" + "github.com/apolloconfig/agollo/v4/constant" apolloConfig "github.com/apolloconfig/agollo/v4/env/config" + "github.com/apolloconfig/agollo/v4/extension" + "github.com/go-kratos/kratos/v2/encoding" ) type apollo struct { @@ -15,6 +18,13 @@ type apollo struct { opt *options } +const ( + yaml = "yaml" + yml = "yml" + json = "json" + properties = "properties" +) + // Option is apollo option type Option func(*options) @@ -26,6 +36,7 @@ type options struct { namespace string isBackupConfig bool backupPath string + originConfig bool } // WithAppID with apollo config app id @@ -84,6 +95,16 @@ func WithBackupPath(backupPath string) Option { } } +// WithOriginalConfig use the original configuration file without parse processing +func WithOriginalConfig() Option { + return func(o *options) { + extension.AddFormatParser(constant.JSON, &jsonExtParser{}) + extension.AddFormatParser(constant.YAML, &yamlExtParser{}) + extension.AddFormatParser(constant.YML, &yamlExtParser{}) + o.originConfig = true + } +} + func NewSource(opts ...Option) config.Source { op := options{} for _, o := range opts { @@ -108,31 +129,78 @@ func NewSource(opts ...Option) config.Source { func format(ns string) string { arr := strings.Split(ns, ".") - if len(arr) <= 1 { - return "json" + if len(arr) <= 1 || arr[len(arr)-1] == properties { + return json } - return arr[len(arr)-1] } func (e *apollo) load() []*config.KeyValue { - kv := make([]*config.KeyValue, 0) + kvs := make([]*config.KeyValue, 0) namespaces := strings.Split(e.opt.namespace, ",") for _, ns := range namespaces { - value, err := e.client.GetConfigCache(ns).Get("content") - if err != nil { - log.Warnw("apollo get config failed", "err", err) + if !e.opt.originConfig { + kv, err := e.getConfig(ns) + if err != nil { + log.Errorf("apollo get config failed,err:%v", err) + continue + } + kvs = append(kvs, kv) + continue } - // serialize the namespace content KeyValue into bytes. - kv = append(kv, &config.KeyValue{ - Key: ns, - Value: []byte(value.(string)), - Format: format(ns), - }) + if strings.Contains(ns, ".") && !strings.Contains(ns, properties) && + (format(ns) == yaml || format(ns) == yml || format(ns) == json) { + kv, err := e.getOriginConfig(ns) + if err != nil { + log.Errorf("apollo get config failed,err:%v", err) + continue + } + kvs = append(kvs, kv) + continue + } else { + kv, err := e.getConfig(ns) + if err != nil { + log.Errorf("apollo get config failed,err:%v", err) + continue + } + kvs = append(kvs, kv) + } + } + return kvs +} + +func (e *apollo) getConfig(ns string) (*config.KeyValue, error) { + next := map[string]interface{}{} + e.client.GetConfigCache(ns).Range(func(key, value interface{}) bool { + // all values are out properties format + resolve(genKey(ns, key.(string)), value, next) + return true + }) + f := format(ns) + codec := encoding.GetCodec(f) + val, err := codec.Marshal(next) + if err != nil { + return nil, err } + return &config.KeyValue{ + Key: ns, + Value: val, + Format: f, + }, nil +} - return kv +func (e apollo) getOriginConfig(ns string) (*config.KeyValue, error) { + value, err := e.client.GetConfigCache(ns).Get("content") + if err != nil { + return nil, err + } + // serialize the namespace content KeyValue into bytes. + return &config.KeyValue{ + Key: ns, + Value: []byte(value.(string)), + Format: format(ns), + }, nil } func (e *apollo) Load() (kv []*config.KeyValue, err error) { @@ -146,3 +214,54 @@ func (e *apollo) Watch() (config.Watcher, error) { } return w, nil } + +// resolve convert kv pair into one map[string]interface{} by split key into different +// map level. such as: app.name = "application" => map[app][name] = "application" +func resolve(key string, value interface{}, target map[string]interface{}) { + // expand key "aaa.bbb" into map[aaa]map[bbb]interface{} + keys := strings.Split(key, ".") + last := len(keys) - 1 + cursor := target + + for i, k := range keys { + if i == last { + cursor[k] = value + break + } + + // not the last key, be deeper + v, ok := cursor[k] + if !ok { + // create a new map + deeper := make(map[string]interface{}) + cursor[k] = deeper + cursor = deeper + continue + } + + // current exists, then check existing value type, if it's not map + // that means duplicate keys, and at least one is not map instance. + if cursor, ok = v.(map[string]interface{}); !ok { + log.Warnf("duplicate key: %v\n", strings.Join(keys[:i+1], ".")) + break + } + } +} + +// genKey got the key of config.KeyValue pair. +// eg: namespace.ext with subKey got namespace.subKey +func genKey(ns, sub string) string { + arr := strings.Split(ns, ".") + if len(arr) < 1 { + return sub + } + + if len(arr) == 1 { + if ns == "" { + return sub + } + return ns + "." + sub + } + + return strings.Join(arr[:len(arr)-1], ".") + "." + sub +} diff --git a/contrib/config/apollo/parser.go b/contrib/config/apollo/parser.go index a449256ff..2b1abb991 100644 --- a/contrib/config/apollo/parser.go +++ b/contrib/config/apollo/parser.go @@ -1,10 +1,5 @@ package apollo -import ( - "github.com/apolloconfig/agollo/v4/constant" - "github.com/apolloconfig/agollo/v4/extension" -) - type jsonExtParser struct{} func (parser jsonExtParser) Parse(configContent interface{}) (map[string]interface{}, error) { @@ -13,13 +8,6 @@ func (parser jsonExtParser) Parse(configContent interface{}) (map[string]interfa type yamlExtParser struct{} -func (parser yamlExtParser) Parse(configContent interface{}) (out map[string]interface{}, err error) { +func (parser yamlExtParser) Parse(configContent interface{}) (map[string]interface{}, error) { return map[string]interface{}{"content": configContent}, nil } - -func init() { - // add json/yaml/yml format - extension.AddFormatParser(constant.JSON, &jsonExtParser{}) - extension.AddFormatParser(constant.YAML, &yamlExtParser{}) - extension.AddFormatParser(constant.YML, &yamlExtParser{}) -} diff --git a/contrib/config/apollo/watcher.go b/contrib/config/apollo/watcher.go index 8c039005e..670139a26 100644 --- a/contrib/config/apollo/watcher.go +++ b/contrib/config/apollo/watcher.go @@ -2,6 +2,9 @@ package apollo import ( "context" + "strings" + + "github.com/go-kratos/kratos/v2/encoding" "github.com/go-kratos/kratos/v2/config" "github.com/go-kratos/kratos/v2/log" @@ -23,14 +26,38 @@ type customChangeListener struct { func (c *customChangeListener) onChange(namespace string, changes map[string]*storage.ConfigChange) []*config.KeyValue { kv := make([]*config.KeyValue, 0, 2) - value, err := c.apollo.client.GetConfigCache(namespace).Get("content") + if strings.Contains(namespace, ".") && !strings.Contains(namespace, properties) && + (format(namespace) == yaml || format(namespace) == yml || format(namespace) == json) { + value, err := c.apollo.client.GetConfigCache(namespace).Get("content") + if err != nil { + log.Warnw("apollo get config failed", "err", err) + } + kv = append(kv, &config.KeyValue{ + Key: namespace, + Value: []byte(value.(string)), + Format: format(namespace), + }) + + return kv + } + + next := make(map[string]interface{}) + + for key, change := range changes { + resolve(genKey(namespace, key), change.NewValue, next) + } + + f := format(namespace) + codec := encoding.GetCodec(f) + val, err := codec.Marshal(next) if err != nil { - log.Warnw("apollo get config failed", "err", err) + log.Warnf("apollo could not handle namespace %s: %v", namespace, err) + return nil } kv = append(kv, &config.KeyValue{ Key: namespace, - Value: []byte(value.(string)), - Format: format(namespace), + Value: val, + Format: f, }) return kv From 563ad0d34a28cd882f6a945620ee2df4fdef435f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=85=E5=AD=90?= Date: Wed, 17 Aug 2022 14:23:48 +0800 Subject: [PATCH 14/71] deps: upgreade kratos version to v2.5.0 (#2286) --- cmd/kratos/version.go | 2 +- cmd/protoc-gen-go-errors/version.go | 2 +- cmd/protoc-gen-go-http/version.go | 2 +- contrib/encoding/msgpack/go.mod | 2 +- contrib/log/aliyun/go.mod | 2 +- contrib/log/fluent/go.mod | 2 +- contrib/log/logrus/go.mod | 2 +- contrib/log/tencent/go.mod | 4 +++- contrib/log/tencent/go.sum | 2 -- contrib/log/zap/go.mod | 2 +- contrib/metrics/datadog/go.mod | 2 +- contrib/metrics/prometheus/go.mod | 2 +- contrib/opensergo/go.mod | 2 +- contrib/registry/consul/go.mod | 2 +- contrib/registry/discovery/go.mod | 2 +- contrib/registry/etcd/go.mod | 2 +- contrib/registry/kubernetes/go.mod | 2 +- contrib/registry/nacos/go.mod | 2 +- contrib/registry/polaris/go.mod | 2 +- contrib/registry/zookeeper/go.mod | 2 +- version.go | 2 +- 21 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cmd/kratos/version.go b/cmd/kratos/version.go index 50708a15c..9d205cbc9 100644 --- a/cmd/kratos/version.go +++ b/cmd/kratos/version.go @@ -1,4 +1,4 @@ package main // release is the current kratos tool version. -const release = "v2.4.1" +const release = "v2.5.0" diff --git a/cmd/protoc-gen-go-errors/version.go b/cmd/protoc-gen-go-errors/version.go index 14ef3ee0d..71fced3ef 100644 --- a/cmd/protoc-gen-go-errors/version.go +++ b/cmd/protoc-gen-go-errors/version.go @@ -1,4 +1,4 @@ package main // release is the current protoc-gen-go-errors version. -const release = "v2.4.1" +const release = "v2.5.0" diff --git a/cmd/protoc-gen-go-http/version.go b/cmd/protoc-gen-go-http/version.go index 36a83f842..065e7dd52 100644 --- a/cmd/protoc-gen-go-http/version.go +++ b/cmd/protoc-gen-go-http/version.go @@ -1,4 +1,4 @@ package main // release is the current protoc-gen-go-http version. -const release = "v2.4.1" +const release = "v2.5.0" diff --git a/contrib/encoding/msgpack/go.mod b/contrib/encoding/msgpack/go.mod index 9e02ad81b..5d78c21b9 100644 --- a/contrib/encoding/msgpack/go.mod +++ b/contrib/encoding/msgpack/go.mod @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/encoding/msgpack/v2 go 1.16 require ( - github.com/go-kratos/kratos/v2 v2.4.1 + github.com/go-kratos/kratos/v2 v2.5.0 github.com/vmihailenco/msgpack/v5 v5.3.5 ) diff --git a/contrib/log/aliyun/go.mod b/contrib/log/aliyun/go.mod index 83b139ea5..efe1b8273 100644 --- a/contrib/log/aliyun/go.mod +++ b/contrib/log/aliyun/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/aliyun/aliyun-log-go-sdk v0.1.37 - github.com/go-kratos/kratos/v2 v2.4.1 + github.com/go-kratos/kratos/v2 v2.5.0 google.golang.org/protobuf v1.28.1 ) diff --git a/contrib/log/fluent/go.mod b/contrib/log/fluent/go.mod index b8477bde6..b316425a7 100644 --- a/contrib/log/fluent/go.mod +++ b/contrib/log/fluent/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect github.com/fluent/fluent-logger-golang v1.9.0 - github.com/go-kratos/kratos/v2 v2.4.1 + github.com/go-kratos/kratos/v2 v2.5.0 github.com/kr/pretty v0.3.0 // indirect github.com/tinylib/msgp v1.1.6 // indirect ) diff --git a/contrib/log/logrus/go.mod b/contrib/log/logrus/go.mod index fa3989f34..aa1f59465 100644 --- a/contrib/log/logrus/go.mod +++ b/contrib/log/logrus/go.mod @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/log/logrus/v2 go 1.16 require ( - github.com/go-kratos/kratos/v2 v2.4.1 + github.com/go-kratos/kratos/v2 v2.5.0 github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.1 ) diff --git a/contrib/log/tencent/go.mod b/contrib/log/tencent/go.mod index feb39f170..2d3fa7dc9 100644 --- a/contrib/log/tencent/go.mod +++ b/contrib/log/tencent/go.mod @@ -3,7 +3,9 @@ module github.com/go-kratos/kratos/contrib/log/tencent/v2 go 1.16 require ( - github.com/go-kratos/kratos/v2 v2.4.1 + github.com/go-kratos/kratos/v2 v2.5.0 github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.2 google.golang.org/protobuf v1.28.0 ) + +replace github.com/go-kratos/kratos/v2 => ../../../ diff --git a/contrib/log/tencent/go.sum b/contrib/log/tencent/go.sum index b4b87442e..993b044f1 100644 --- a/contrib/log/tencent/go.sum +++ b/contrib/log/tencent/go.sum @@ -27,8 +27,6 @@ github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09 github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kratos/aegis v0.1.2/go.mod h1:jYeSQ3Gesba478zEnujOiG5QdsyF3Xk/8owFUeKcHxw= -github.com/go-kratos/kratos/v2 v2.4.1 h1:NFQy8Ha4Xu6T3Q40JlKzspvlMa5IGvIHhJw5+sqyV4c= -github.com/go-kratos/kratos/v2 v2.4.1/go.mod h1:5acyLj4EgY428AJnZl2EwCrMV1OVlttQFBum+SghMiA= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= diff --git a/contrib/log/zap/go.mod b/contrib/log/zap/go.mod index 8d5d2c7e6..ecb315e11 100644 --- a/contrib/log/zap/go.mod +++ b/contrib/log/zap/go.mod @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/log/zap/v2 go 1.16 require ( - github.com/go-kratos/kratos/v2 v2.4.1 + github.com/go-kratos/kratos/v2 v2.5.0 go.uber.org/zap v1.21.0 ) diff --git a/contrib/metrics/datadog/go.mod b/contrib/metrics/datadog/go.mod index 4d06c42c5..206ccf4e6 100644 --- a/contrib/metrics/datadog/go.mod +++ b/contrib/metrics/datadog/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/DataDog/datadog-go v4.8.3+incompatible github.com/Microsoft/go-winio v0.5.2 // indirect - github.com/go-kratos/kratos/v2 v2.4.1 + github.com/go-kratos/kratos/v2 v2.5.0 ) replace github.com/go-kratos/kratos/v2 => ../../../ diff --git a/contrib/metrics/prometheus/go.mod b/contrib/metrics/prometheus/go.mod index ff2f8af2e..c6a1b5df2 100644 --- a/contrib/metrics/prometheus/go.mod +++ b/contrib/metrics/prometheus/go.mod @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/metrics/prometheus/v2 go 1.16 require ( - github.com/go-kratos/kratos/v2 v2.4.1 + github.com/go-kratos/kratos/v2 v2.5.0 github.com/prometheus/client_golang v1.12.2 github.com/prometheus/common v0.37.0 ) diff --git a/contrib/opensergo/go.mod b/contrib/opensergo/go.mod index fa64c2ca4..beba8f7f9 100644 --- a/contrib/opensergo/go.mod +++ b/contrib/opensergo/go.mod @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/opensergo/v2 go 1.17 require ( - github.com/go-kratos/kratos/v2 v2.4.1 + github.com/go-kratos/kratos/v2 v2.5.0 github.com/opensergo/opensergo-go v0.0.0-20220331070310-e5b01fee4d1c golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd diff --git a/contrib/registry/consul/go.mod b/contrib/registry/consul/go.mod index 03ed997f5..368308ec3 100644 --- a/contrib/registry/consul/go.mod +++ b/contrib/registry/consul/go.mod @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/registry/consul/v2 go 1.16 require ( - github.com/go-kratos/kratos/v2 v2.4.1 + github.com/go-kratos/kratos/v2 v2.5.0 github.com/hashicorp/consul/api v1.13.1 ) diff --git a/contrib/registry/discovery/go.mod b/contrib/registry/discovery/go.mod index f03c2f158..407af47a7 100644 --- a/contrib/registry/discovery/go.mod +++ b/contrib/registry/discovery/go.mod @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/registry/discovery/v2 go 1.16 require ( - github.com/go-kratos/kratos/v2 v2.4.1 + github.com/go-kratos/kratos/v2 v2.5.0 github.com/go-resty/resty/v2 v2.7.0 github.com/pkg/errors v0.9.1 ) diff --git a/contrib/registry/etcd/go.mod b/contrib/registry/etcd/go.mod index 6634eac7d..952e8a55a 100644 --- a/contrib/registry/etcd/go.mod +++ b/contrib/registry/etcd/go.mod @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/registry/etcd/v2 go 1.16 require ( - github.com/go-kratos/kratos/v2 v2.4.1 + github.com/go-kratos/kratos/v2 v2.5.0 go.etcd.io/etcd/client/v3 v3.5.4 google.golang.org/grpc v1.46.2 ) diff --git a/contrib/registry/kubernetes/go.mod b/contrib/registry/kubernetes/go.mod index 67dd45042..cad07df0d 100644 --- a/contrib/registry/kubernetes/go.mod +++ b/contrib/registry/kubernetes/go.mod @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/registry/kubernetes/v2 go 1.16 require ( - github.com/go-kratos/kratos/v2 v2.4.1 + github.com/go-kratos/kratos/v2 v2.5.0 github.com/json-iterator/go v1.1.12 k8s.io/api v0.24.3 k8s.io/apimachinery v0.24.3 diff --git a/contrib/registry/nacos/go.mod b/contrib/registry/nacos/go.mod index a4665a109..bdfd037e3 100644 --- a/contrib/registry/nacos/go.mod +++ b/contrib/registry/nacos/go.mod @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/registry/nacos/v2 go 1.16 require ( - github.com/go-kratos/kratos/v2 v2.4.1 + github.com/go-kratos/kratos/v2 v2.5.0 github.com/nacos-group/nacos-sdk-go v1.0.9 ) diff --git a/contrib/registry/polaris/go.mod b/contrib/registry/polaris/go.mod index e399d9ddb..2789a9916 100644 --- a/contrib/registry/polaris/go.mod +++ b/contrib/registry/polaris/go.mod @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/registry/polaris/v2 go 1.16 require ( - github.com/go-kratos/kratos/v2 v2.4.1 + github.com/go-kratos/kratos/v2 v2.5.0 github.com/polarismesh/polaris-go v1.1.0 ) diff --git a/contrib/registry/zookeeper/go.mod b/contrib/registry/zookeeper/go.mod index d8d588181..a149d20aa 100644 --- a/contrib/registry/zookeeper/go.mod +++ b/contrib/registry/zookeeper/go.mod @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/registry/zookeeper/v2 go 1.16 require ( - github.com/go-kratos/kratos/v2 v2.4.1 + github.com/go-kratos/kratos/v2 v2.5.0 github.com/go-zookeeper/zk v1.0.3 golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 ) diff --git a/version.go b/version.go index 08f05950c..d0afa6033 100644 --- a/version.go +++ b/version.go @@ -1,4 +1,4 @@ package kratos // Release is the current kratos version. -const Release = "v2.4.1" +const Release = "v2.5.0" From 39796ea0dcad274a9650023bae44033ce3856267 Mon Sep 17 00:00:00 2001 From: haiyux Date: Wed, 17 Aug 2022 14:31:37 +0800 Subject: [PATCH 15/71] fix: delete endpoint service discovery compatibility (#2289) * fix: delete endpoint package endpoint * fix lint --- internal/endpoint/endpoint.go | 26 -------- internal/endpoint/endpoint_test.go | 99 ------------------------------ 2 files changed, 125 deletions(-) diff --git a/internal/endpoint/endpoint.go b/internal/endpoint/endpoint.go index e4c9ef969..160b694f7 100644 --- a/internal/endpoint/endpoint.go +++ b/internal/endpoint/endpoint.go @@ -2,7 +2,6 @@ package endpoint import ( "net/url" - "strconv" ) // NewEndpoint new an Endpoint URL. @@ -18,10 +17,6 @@ func ParseEndpoint(endpoints []string, scheme string) (string, error) { return "", err } - // TODO: Compatibility processing - // Function is to convert grpc:/127.0.0.1/?isSecure=true into grpcs:/127.0.0.1/ - // It will be deleted in about a month - u = legacyURLToNew(u) if u.Scheme == scheme { return u.Host, nil } @@ -29,27 +24,6 @@ func ParseEndpoint(endpoints []string, scheme string) (string, error) { return "", nil } -func legacyURLToNew(u *url.URL) *url.URL { - if u.Scheme == "https" || u.Scheme == "grpcs" { - return u - } - if IsSecure(u) { - return &url.URL{Scheme: u.Scheme + "s", Host: u.Host} - } - return u -} - -// IsSecure parses isSecure for Endpoint URL. -// Note: It will be deleted after some time, -// unified use grpcs://127.0.0.1:8080 instead of grpc://127.0.0.1:8080?isSecure=true -func IsSecure(u *url.URL) bool { - ok, err := strconv.ParseBool(u.Query().Get("isSecure")) - if err != nil { - return false - } - return ok -} - // Scheme is the scheme of endpoint url. // examples: scheme="http",isSecure=true get "https" func Scheme(scheme string, isSecure bool) string { diff --git a/internal/endpoint/endpoint_test.go b/internal/endpoint/endpoint_test.go index e8870c800..c02878fd5 100644 --- a/internal/endpoint/endpoint_test.go +++ b/internal/endpoint/endpoint_test.go @@ -6,41 +6,6 @@ import ( "testing" ) -func TestEndPoint(t *testing.T) { - type args struct { - url *url.URL - } - tests := []struct { - name string - args args - want bool - }{ - // TODO: Add test cases. - { - name: "grpc://127.0.0.1?isSecure=false", - args: args{&url.URL{Scheme: "grpc", Host: "127.0.0.1", RawQuery: "isSecure=false"}}, - want: false, - }, - { - name: "grpc://127.0.0.1?isSecure=true", - args: args{&url.URL{Scheme: "grpc", Host: "127.0.0.1", RawQuery: "isSecure=true"}}, - want: true, - }, - { - name: "grpc://127.0.0.1", - args: args{&url.URL{Scheme: "grpc", Host: "127.0.0.1"}}, - want: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := IsSecure(tt.args.url); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetQuery() = %v, want %v", got, tt.want) - } - }) - } -} - func TestNewEndpoint(t *testing.T) { type args struct { scheme string @@ -111,20 +76,6 @@ func TestParseEndpoint(t *testing.T) { want: "", wantErr: false, }, - - // Legacy - { - name: "google", - args: args{endpoints: []string{"grpc://www.google.com/?isSecure=true"}, scheme: "grpcs"}, - want: "www.google.com", - wantErr: false, - }, - { - name: "baidu", - args: args{endpoints: []string{"http://www.baidu.com/?isSecure=true"}, scheme: "https"}, - want: "www.baidu.com", - wantErr: false, - }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -140,56 +91,6 @@ func TestParseEndpoint(t *testing.T) { } } -func TestIsSecure(t *testing.T) { - tests := []struct { - url *url.URL - want bool - }{ - { - url: &url.URL{Scheme: "http", Host: "127.0.0.1"}, - want: false, - }, - { - url: &url.URL{Scheme: "http", Host: "127.0.0.1", RawQuery: "isSecure=false"}, - want: false, - }, - { - url: &url.URL{Scheme: "grpc", Host: "127.0.0.1", RawQuery: "isSecure=true"}, - want: true, - }, - } - for _, tt := range tests { - if got := IsSecure(tt.url); got != tt.want { - t.Errorf("IsSecure() = %v, want %v", got, tt.want) - } - } -} - -func TestLegacyURLToNew(t *testing.T) { - tests := []struct { - url *url.URL - want *url.URL - }{ - { - url: &url.URL{Scheme: "http", Host: "www.google.com", RawQuery: "isSecure=true"}, - want: &url.URL{Scheme: "https", Host: "www.google.com"}, - }, - { - url: &url.URL{Scheme: "https", Host: "www.google.com", RawQuery: "isSecure=true"}, - want: &url.URL{Scheme: "https", Host: "www.google.com", RawQuery: "isSecure=true"}, - }, - { - url: &url.URL{Scheme: "http", Host: "go-kratos.dev", RawQuery: "isSecure=false"}, - want: &url.URL{Scheme: "http", Host: "go-kratos.dev", RawQuery: "isSecure=false"}, - }, - } - for _, tt := range tests { - if got := legacyURLToNew(tt.url); !reflect.DeepEqual(got, tt.want) { - t.Errorf("legacyURLToNew() = %v, want %v", got, tt.want) - } - } -} - func TestSchema(t *testing.T) { tests := []struct { schema string From bdfeb4bf785db70fd270fb095520068e19c33a69 Mon Sep 17 00:00:00 2001 From: pwli <763045276@qq.com> Date: Wed, 17 Aug 2022 14:31:54 +0800 Subject: [PATCH 16/71] fix typo (#2284) Co-authored-by: pwli0755 --- transport/http/context.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transport/http/context.go b/transport/http/context.go index 347d93ffe..f65e03fb4 100644 --- a/transport/http/context.go +++ b/transport/http/context.go @@ -46,7 +46,7 @@ type responseWriter struct { w http.ResponseWriter } -func (w *responseWriter) rest(res http.ResponseWriter) { +func (w *responseWriter) reset(res http.ResponseWriter) { w.w = res w.code = http.StatusOK } @@ -151,7 +151,7 @@ func (c *wrapper) Stream(code int, contentType string, rd io.Reader) error { } func (c *wrapper) Reset(res http.ResponseWriter, req *http.Request) { - c.w.rest(res) + c.w.reset(res) c.res = res c.req = req } From 205aa88d862be33fb70afe620a25dd19dbe88ce9 Mon Sep 17 00:00:00 2001 From: Astone Date: Wed, 17 Aug 2022 14:32:18 +0800 Subject: [PATCH 17/71] fix: encoding form decode field mask from well-know (#2285) Co-authored-by: Astone --- encoding/form/proto_decode.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/encoding/form/proto_decode.go b/encoding/form/proto_decode.go index 9e31e3ba7..2856bef5f 100644 --- a/encoding/form/proto_decode.go +++ b/encoding/form/proto_decode.go @@ -12,11 +12,11 @@ import ( "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/types/known/structpb" - "google.golang.org/genproto/protobuf/field_mask" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/types/known/durationpb" + "google.golang.org/protobuf/types/known/fieldmaskpb" "google.golang.org/protobuf/types/known/timestamppb" "google.golang.org/protobuf/types/known/wrapperspb" ) @@ -289,7 +289,7 @@ func parseMessage(md protoreflect.MessageDescriptor, value string) (protoreflect } msg = wrapperspb.Bytes(v) case "google.protobuf.FieldMask": - fm := &field_mask.FieldMask{} + fm := &fieldmaskpb.FieldMask{} for _, fv := range strings.Split(value, ",") { fm.Paths = append(fm.Paths, jsonSnakeCase(fv)) } From ba722304772728e1cd286e7d5a89de2ff4ae10ae Mon Sep 17 00:00:00 2001 From: YidaZhou <32645645+YidaZhou@users.noreply.github.com> Date: Wed, 17 Aug 2022 18:17:25 +0800 Subject: [PATCH 18/71] doc: grammar problems in the Readme file (#2281) --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0508d5c61..f4023812c 100644 --- a/README.md +++ b/README.md @@ -17,21 +17,21 @@ ## About Kratos -> The name is inspired by the game God of War which is based on Greek myths, tells the adventures of Kratos who became a god of war from a mortal and launched a god-killing slaughter. +> The name is inspired by the Greek-mythology-based game "God of War". It tells the adventures of Kratos becoming a god of war from a mortal and launching a god-killing slaughter. Kratos is a microservice-oriented governance framework implemented by golang, which offers convenient capabilities to help you quickly build a bulletproof application from scratch, such as: - The [communication protocol](https://go-kratos.dev/en/docs/component/api) is based on the HTTP/gRPC through the definition of Protobuf. -- Abstract [transport](https://go-kratos.dev/en/docs/component/transport/overview) layer are support: [HTTP](https://go-kratos.dev/en/docs/component/transport/http) / [gRPC](https://go-kratos.dev/en/docs/component/transport/grpc). -- Powerful [middleware](https://go-kratos.dev/en/docs/component/middleware/overview) design, support: [Tracing (OpenTelemetry)](https://go-kratos.dev/en/docs/component/middleware/tracing)、[Metrics (Prometheus is default)](https://go-kratos.dev/en/docs/component/middleware/metrics)、[Recovery](https://go-kratos.dev/en/docs/component/middleware/recovery) and more. +- Abstract [transport](https://go-kratos.dev/en/docs/component/transport/overview) layer support: [HTTP](https://go-kratos.dev/en/docs/component/transport/http) / [gRPC](https://go-kratos.dev/en/docs/component/transport/grpc). +- Powerful [middleware](https://go-kratos.dev/en/docs/component/middleware/overview) design, support: [Tracing (OpenTelemetry)](https://go-kratos.dev/en/docs/component/middleware/tracing), [Metrics (Prometheus is default)](https://go-kratos.dev/en/docs/component/middleware/metrics), [Recovery](https://go-kratos.dev/en/docs/component/middleware/recovery) and more. - [Registry](https://go-kratos.dev/en/docs/component/registry) interface able to be connected with various other centralized registries through plug-ins. -- The [standard log interfaces](https://go-kratos.dev/en/docs/component/log) ease the integration of the third-party log libs and logs are collected through the *Fluentd*. -- The selection of the content [encoding](https://go-kratos.dev/en/docs/component/encoding) is automatically supported by Accept and Content-Type. +- The [standard log interfaces](https://go-kratos.dev/en/docs/component/log) ease the integration of the third-party log libs with logs collected through the *Fluentd*. +- Automatically support the selection of the content [encoding](https://go-kratos.dev/en/docs/component/encoding) with Accept and Content-Type. - Multiple data sources are supported for [configurations](https://go-kratos.dev/en/docs/component/config) and dynamic configurations (use atomic operations). -- In the protocol of HTTP/gRPC, use uniform [metadata](https://go-kratos.dev/en/docs/component/metadata) transfer method. +- In the protocol of HTTP/gRPC, use the uniform [metadata](https://go-kratos.dev/en/docs/component/metadata) transfer method. - You can define [errors](https://go-kratos.dev/en/docs/component/errors/) in protos and generate enums with protoc-gen-go. -- You can define [verification rules](https://go-kratos.dev/en/docs/component/middleware/validate) in Protobuf which is supported by HTTP/gRPC service. -- [Swagger API](https://go-kratos.dev/en/docs/guide/openapi) generated Automatically and embed Swagger UI endpoint can be started by adding [Swagger plugin](https://github.com/go-kratos/swagger-api). +- You can define [verification rules](https://go-kratos.dev/en/docs/component/middleware/validate) in Protobuf supported by the HTTP/gRPC service. +- [Swagger API](https://go-kratos.dev/en/docs/guide/openapi) is generated Automatically and embed Swagger UI endpoint can be started by adding [Swagger plugin](https://github.com/go-kratos/swagger-api). Kratos is accessible, powerful, and provides tools required for large, robust applications. @@ -39,7 +39,7 @@ Kratos is accessible, powerful, and provides tools required for large, robust ap Kratos has the most extensive and thorough [documentation](https://go-kratos.dev/en/docs/getting-started/start) and [example](https://github.com/go-kratos/examples) library of all modern web application frameworks, making it a breeze to get started with the framework. -We also provide a [modern template](https://github.com/go-kratos/kratos-layout), This template should help reduce the work required to setup up a modern project. +We also provide a [modern template](https://github.com/go-kratos/kratos-layout). This template should help reduce the work required to setup up modern projects. ### Goals @@ -47,13 +47,13 @@ Kratos boosts your productivity. With the integration of excellent resources and ### Principles -* **Simple**: Appropriate design, plain and easy code. +* **Simple**: Appropriate design with plain and easy code. * **General**: Cover the various utilities for business development. * **Highly efficient**: Speeding up the efficiency of businesses upgrading. -* **Stable**: The base libs validated in the production environment which have the characters of the high testability, high coverage as well as high security and reliability. +* **Stable**: The base libs validated in the production environment have the characteristics of high testability, high coverage as well as high security and reliability. * **Robust**: Eliminating misusing through high quality of the base libs. * **High-performance**: Optimal performance excluding the optimization of hacking in case of *unsafe*.  -* **Expandability**: Properly designed interfaces, you can expand utilities such as base libs to meet your further requirements. +* **Expandability**: Properly designed interfaces where you can expand utilities such as base libs to meet your further requirements. * **Fault-tolerance**: Designed against failure, enhance the understanding and exercising of SRE within Kratos to achieve more robustness. * **Toolchain**: Includes an extensive toolchain, such as the code generation of cache, the lint tool, and so forth. From 6ca225b078b7666de95895b2d645887b0c07e9be Mon Sep 17 00:00:00 2001 From: "jesse.tang" <1430482733@qq.com> Date: Thu, 18 Aug 2022 10:58:56 +0800 Subject: [PATCH 19/71] add notes by not used defer (#2291) --- app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.go b/app.go index 0a5afabc1..e3d81ffb1 100644 --- a/app.go +++ b/app.go @@ -101,7 +101,7 @@ func (a *App) Run() error { }) wg.Add(1) eg.Go(func() error { - wg.Done() + wg.Done() // here is to ensure server start has begun running before register, so defer is not needed return srv.Start(NewContext(a.opts.ctx, a)) }) } From 5c3f0aa73ebc934ce46a8cb34568c964c68a21ae Mon Sep 17 00:00:00 2001 From: icylight <408209435@qq.com> Date: Sat, 20 Aug 2022 14:48:03 +0800 Subject: [PATCH 20/71] style(metadata): specify map capacity hints (#2296) --- metadata/metadata.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata/metadata.go b/metadata/metadata.go index be1806259..3dabdbaef 100644 --- a/metadata/metadata.go +++ b/metadata/metadata.go @@ -46,7 +46,7 @@ func (m Metadata) Range(f func(k, v string) bool) { // Clone returns a deep copy of Metadata func (m Metadata) Clone() Metadata { - md := Metadata{} + md := make(Metadata, len(m)) for k, v := range m { md[k] = v } From 869fcd57c8399f0dc18964eb9d9532c0975159e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 Aug 2022 14:51:20 +0800 Subject: [PATCH 21/71] build(deps): bump go.uber.org/zap in /contrib/log/zap (#2280) Bumps [go.uber.org/zap](https://github.com/uber-go/zap) from 1.21.0 to 1.22.0. - [Release notes](https://github.com/uber-go/zap/releases) - [Changelog](https://github.com/uber-go/zap/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/zap/compare/v1.21.0...v1.22.0) --- updated-dependencies: - dependency-name: go.uber.org/zap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- contrib/log/zap/go.mod | 2 +- contrib/log/zap/go.sum | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/contrib/log/zap/go.mod b/contrib/log/zap/go.mod index ecb315e11..192127ee0 100644 --- a/contrib/log/zap/go.mod +++ b/contrib/log/zap/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/go-kratos/kratos/v2 v2.5.0 - go.uber.org/zap v1.21.0 + go.uber.org/zap v1.22.0 ) replace github.com/go-kratos/kratos/v2 => ../../../ diff --git a/contrib/log/zap/go.sum b/contrib/log/zap/go.sum index d90e26792..1a82a3847 100644 --- a/contrib/log/zap/go.sum +++ b/contrib/log/zap/go.sum @@ -90,8 +90,8 @@ go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= -go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= +go.uber.org/zap v1.22.0 h1:Zcye5DUgBloQ9BaT4qc9BnjOFog5TvBSAGkJ3Nf70c0= +go.uber.org/zap v1.22.0/go.mod h1:H4siCOZOrAolnUPJEkfaSjDqyP+BDS0DdDWzwcgt3+U= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -179,12 +179,10 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From b1bb0bd18f10c33e20c34eadd0926aba1b90130b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 Aug 2022 14:51:58 +0800 Subject: [PATCH 22/71] build(deps): bump github.com/hashicorp/consul/api (#2278) Bumps [github.com/hashicorp/consul/api](https://github.com/hashicorp/consul) from 1.13.1 to 1.14.0. - [Release notes](https://github.com/hashicorp/consul/releases) - [Changelog](https://github.com/hashicorp/consul/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/consul/compare/v1.13.1...api/v1.14.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/consul/api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- contrib/registry/consul/go.mod | 2 +- contrib/registry/consul/go.sum | 121 +++++++++++++++++++++++++++------ 2 files changed, 102 insertions(+), 21 deletions(-) diff --git a/contrib/registry/consul/go.mod b/contrib/registry/consul/go.mod index 368308ec3..5a0965b44 100644 --- a/contrib/registry/consul/go.mod +++ b/contrib/registry/consul/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/go-kratos/kratos/v2 v2.5.0 - github.com/hashicorp/consul/api v1.13.1 + github.com/hashicorp/consul/api v1.14.0 ) replace github.com/go-kratos/kratos/v2 => ../../../ diff --git a/contrib/registry/consul/go.sum b/contrib/registry/consul/go.sum index 248906563..41a5b15be 100644 --- a/contrib/registry/consul/go.sum +++ b/contrib/registry/consul/go.sum @@ -1,16 +1,27 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.3.10 h1:FR+drcQStOe+32sYyJYyZ7FIdgoGGBnwLl+flodp8Uo= +github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -18,6 +29,7 @@ github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XP github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -32,17 +44,24 @@ github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kratos/aegis v0.1.2/go.mod h1:jYeSQ3Gesba478zEnujOiG5QdsyF3Xk/8owFUeKcHxw= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/form/v4 v4.2.0/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= @@ -55,8 +74,9 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c h1:964Od4U6p2jUkFxvCydnIczKteheJEzHRToSGK3Bnlw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -66,47 +86,66 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.13.1 h1:r5cPdVFUy+pFF7nt+0ArLD9hm+E39OewJkvNdjKXcL4= -github.com/hashicorp/consul/api v1.13.1/go.mod h1:+1VcOos0TVdQFqXxphG4zmGcwQB4KVGkp1maPqnkDpE= +github.com/hashicorp/consul/api v1.14.0 h1:Y64GIJ8hYTu+tuGekwO4G4ardXoiCivX9wv1iP/kihk= +github.com/hashicorp/consul/api v1.14.0/go.mod h1:bcaw5CSZ7NE9qfOfKCI1xb7ZKjzu/MyvQkCLTfqLqxQ= github.com/hashicorp/consul/sdk v0.10.0 h1:rGLEh2AWK4K0KCMvqWAz2EYxQqgciIfMagWZ0nVe5MI= github.com/hashicorp/consul/sdk v0.10.0/go.mod h1:yPkX5Q6CsxTFMjQQDJwzeNmUUF5NUGGbrDsv9wTb8cw= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-hclog v0.12.0 h1:d4QkX8FRTYaKaCZBoXYY8zJX2BXjWxurN/GA2tkrmZM= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= +github.com/hashicorp/go-hclog v0.14.1 h1:nQcJDQwIAGnmoUWp8ubocEX40cCml/17YkF6csQLReU= +github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= +github.com/hashicorp/go-immutable-radix v1.3.0 h1:8exGP7ego3OmkfksihtSouGMZ+hQrhxx+FVELeXpVPE= +github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= +github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= +github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= -github.com/hashicorp/memberlist v0.3.0 h1:8+567mCcFDnS5ADl7lrpxPMWiFCElyUEeW0gtj34fMA= github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/serf v0.9.6 h1:uuEX1kLR6aoda1TBttmJQKDLZE1Ob7KN0NPdE7EtCDc= -github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/hashicorp/memberlist v0.3.1 h1:MXgUXLqva1QvpVEDQW1IQLG0wivQAtmFlHRQ+1vWZfM= +github.com/hashicorp/memberlist v0.3.1/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/serf v0.9.7 h1:hkdgbqizGQHuU5IPqYM1JdSMV8nKfpuOnZYXssk9muY= +github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= @@ -117,32 +156,59 @@ github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcME github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= +github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shirou/gopsutil/v3 v3.21.8/go.mod h1:YWp/H8Qs5fVmf17v7JNZzA0mPJ+mS2e9JdiUF9LlKzQ= -github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -150,10 +216,12 @@ github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMT github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -163,37 +231,45 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1 h1:4qWs8cYYH6PoEFy4dfhDFgoMGkwAcETd+MmPdCPMzUc= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.0.0-20211216030914-fe4d6282115f h1:hEYJvxw1lSnWIl8X9ofsYMklzaDs90JI2az5YMd4fPM= +golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -201,6 +277,7 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -250,10 +327,14 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 0ce9e8d069995989a56b827a15c15a91cdfa5a9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BF=87=E5=AE=A2=E9=BE=99=E9=97=A8?= Date: Mon, 22 Aug 2022 14:44:49 +0800 Subject: [PATCH 23/71] specify array capacity hints (#2299) --- api/metadata/server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/metadata/server.go b/api/metadata/server.go index 3438d1327..50f90f61e 100644 --- a/api/metadata/server.go +++ b/api/metadata/server.go @@ -105,7 +105,10 @@ func (s *Server) ListServices(ctx context.Context, in *ListServicesRequest) (*Li if err := s.load(); err != nil { return nil, err } - reply := new(ListServicesReply) + reply := &ListServicesReply{ + Services: make([]string, 0, len(s.services)), + Methods: make([]string, 0, len(s.methods)), + } for name := range s.services { reply.Services = append(reply.Services, name) } From cb6176dbbbe98b6a4c7bf913cda0689bb2dc6d01 Mon Sep 17 00:00:00 2001 From: Germiniku Date: Wed, 24 Aug 2022 12:39:20 +0800 Subject: [PATCH 24/71] feat(tracing) custom tracer name (#2310) * feat(log): add tencent cls fix update * refactor(log) use the same interface name * fix(log) tencent toString * feat(tracing) custom tracer name --- middleware/tracing/tracer.go | 5 +++-- middleware/tracing/tracing.go | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/middleware/tracing/tracer.go b/middleware/tracing/tracer.go index 48d4eaa14..cf9115bbf 100644 --- a/middleware/tracing/tracer.go +++ b/middleware/tracing/tracer.go @@ -24,6 +24,7 @@ type Tracer struct { func NewTracer(kind trace.SpanKind, opts ...Option) *Tracer { op := options{ propagator: propagation.NewCompositeTextMapPropagator(Metadata{}, propagation.Baggage{}, propagation.TraceContext{}), + tracerName: "kratos", } for _, o := range opts { o(&op) @@ -34,9 +35,9 @@ func NewTracer(kind trace.SpanKind, opts ...Option) *Tracer { switch kind { case trace.SpanKindClient: - return &Tracer{tracer: otel.Tracer("kratos"), kind: kind, opt: &op} + return &Tracer{tracer: otel.Tracer(op.tracerName), kind: kind, opt: &op} case trace.SpanKindServer: - return &Tracer{tracer: otel.Tracer("kratos"), kind: kind, opt: &op} + return &Tracer{tracer: otel.Tracer(op.tracerName), kind: kind, opt: &op} default: panic(fmt.Sprintf("unsupported span kind: %v", kind)) } diff --git a/middleware/tracing/tracing.go b/middleware/tracing/tracing.go index c04b13d0b..167725f40 100644 --- a/middleware/tracing/tracing.go +++ b/middleware/tracing/tracing.go @@ -15,6 +15,7 @@ import ( type Option func(*options) type options struct { + tracerName string tracerProvider trace.TracerProvider propagator propagation.TextMapPropagator } @@ -34,6 +35,13 @@ func WithTracerProvider(provider trace.TracerProvider) Option { } } +// WithTracerName with tracer name +func WithTracerName(tracerName string) Option { + return func(opts *options) { + opts.tracerName = tracerName + } +} + // Server returns a new server middleware for OpenTelemetry. func Server(opts ...Option) middleware.Middleware { tracer := NewTracer(trace.SpanKindServer, opts...) From 73a8323ee7166fe6373f39774390cd89a8e64639 Mon Sep 17 00:00:00 2001 From: "jesse.tang" <1430482733@qq.com> Date: Wed, 24 Aug 2022 18:19:07 +0800 Subject: [PATCH 25/71] fix: slice/map make init cap (#2300) --- cmd/protoc-gen-go-http/http.go | 2 +- config/value.go | 4 ++-- contrib/registry/consul/client.go | 2 +- contrib/registry/discovery/discovery.go | 2 +- transport/grpc/balancer.go | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/protoc-gen-go-http/http.go b/cmd/protoc-gen-go-http/http.go index 3eb91c061..cebbb6b15 100644 --- a/cmd/protoc-gen-go-http/http.go +++ b/cmd/protoc-gen-go-http/http.go @@ -213,9 +213,9 @@ func buildPathVars(path string) (res map[string]*string) { if strings.HasSuffix(path, "/") { fmt.Fprintf(os.Stderr, "\u001B[31mWARN\u001B[m: Path %s should not end with \"/\" \n", path) } - res = make(map[string]*string) pattern := regexp.MustCompile(`(?i){([a-z\.0-9_\s]*)=?([^{}]*)}`) matches := pattern.FindAllStringSubmatch(path, -1) + res = make(map[string]*string, len(matches)) for _, m := range matches { name := strings.TrimSpace(m[1]) if len(name) > 1 && len(m[2]) > 0 { diff --git a/config/value.go b/config/value.go index 805f155e5..46417e773 100644 --- a/config/value.go +++ b/config/value.go @@ -93,9 +93,9 @@ func (v *atomicValue) Slice() ([]Value, error) { func (v *atomicValue) Map() (map[string]Value, error) { if vals, ok := v.Load().(map[string]interface{}); ok { - m := make(map[string]Value) + m := make(map[string]Value, len(vals)) for key, val := range vals { - a := &atomicValue{} + a := new(atomicValue) a.Store(val) m[key] = a } diff --git a/contrib/registry/consul/client.go b/contrib/registry/consul/client.go index 80ea383a6..e97ec7e42 100644 --- a/contrib/registry/consul/client.go +++ b/contrib/registry/consul/client.go @@ -95,7 +95,7 @@ func (c *Client) Service(ctx context.Context, service string, index uint64, pass // Register register service instance to consul func (c *Client) Register(_ context.Context, svc *registry.ServiceInstance, enableHealthCheck bool) error { - addresses := make(map[string]api.ServiceAddress) + addresses := make(map[string]api.ServiceAddress, len(svc.Endpoints)) checkAddresses := make([]string, 0, len(svc.Endpoints)) for _, endpoint := range svc.Endpoints { raw, err := url.Parse(endpoint) diff --git a/contrib/registry/discovery/discovery.go b/contrib/registry/discovery/discovery.go index f6df56dc0..dfff0a972 100644 --- a/contrib/registry/discovery/discovery.go +++ b/contrib/registry/discovery/discovery.go @@ -439,7 +439,7 @@ func (r *Resolve) fetch(ctx context.Context) (ins *disInstancesInfo, ok bool) { ins = new(disInstancesInfo) ins.LastTs = appIns.LastTs ins.Scheduler = appIns.Scheduler - ins.Instances = make(map[string][]*discoveryInstance) + ins.Instances = make(map[string][]*discoveryInstance, len(appIns.Instances)) for zone, in := range appIns.Instances { ins.Instances[zone] = in } diff --git a/transport/grpc/balancer.go b/transport/grpc/balancer.go index bd50f0983..2047eb0db 100644 --- a/transport/grpc/balancer.go +++ b/transport/grpc/balancer.go @@ -40,7 +40,7 @@ func (b *balancerBuilder) Build(info base.PickerBuildInfo) balancer.Picker { // Block the RPC until a new picker is available via UpdateState(). return base.NewErrPicker(balancer.ErrNoSubConnAvailable) } - nodes := make([]selector.Node, 0) + nodes := make([]selector.Node, 0, len(info.ReadySCs)) for conn, info := range info.ReadySCs { ins, _ := info.Address.Attributes.Value("rawServiceInstance").(*registry.ServiceInstance) nodes = append(nodes, &grpcNode{ From b354f185c04421bd81c8890f89f2079f1f976691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=85=E5=AD=90?= Date: Fri, 26 Aug 2022 10:54:02 +0800 Subject: [PATCH 26/71] feat(registry): consul support user custom checks (#2317) --- contrib/registry/consul/client.go | 5 +++++ contrib/registry/consul/registry.go | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/contrib/registry/consul/client.go b/contrib/registry/consul/client.go index e97ec7e42..1b39975a0 100644 --- a/contrib/registry/consul/client.go +++ b/contrib/registry/consul/client.go @@ -29,6 +29,8 @@ type Client struct { heartbeat bool // deregisterCriticalServiceAfter time interval in seconds deregisterCriticalServiceAfter int + // serviceChecks user custom checks + serviceChecks api.AgentServiceChecks } // NewClient creates consul client @@ -139,6 +141,9 @@ func (c *Client) Register(_ context.Context, svc *registry.ServiceInstance, enab }) } + // custom checks + asr.Checks = append(asr.Checks, c.serviceChecks...) + err := c.cli.Agent().ServiceRegister(asr) if err != nil { return err diff --git a/contrib/registry/consul/registry.go b/contrib/registry/consul/registry.go index 9da95d77b..d1c47d774 100644 --- a/contrib/registry/consul/registry.go +++ b/contrib/registry/consul/registry.go @@ -63,6 +63,15 @@ func WithDeregisterCriticalServiceAfter(interval int) Option { } } +// WithServiceCheck with service checks +func WithServiceCheck(checks ...*api.AgentServiceCheck) Option { + return func(o *Registry) { + if o.cli != nil { + o.cli.serviceChecks = checks + } + } +} + // Config is consul registry config type Config struct { *api.Config From 361391732b93dcad750177d90557f69dd94fd431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=9D=E6=A1=91?= <1554694323@qq.com> Date: Mon, 29 Aug 2022 09:27:44 +0800 Subject: [PATCH 27/71] test(selector): improve coverage (#2320) * test(selector): improve coverage * style: gofumpt --- selector/selector_test.go | 116 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/selector/selector_test.go b/selector/selector_test.go index f7c1f1bcf..bcc08264b 100644 --- a/selector/selector_test.go +++ b/selector/selector_test.go @@ -12,6 +12,8 @@ import ( "github.com/go-kratos/kratos/v2/registry" ) +var errNodeNotMatch = errors.New("node is not match") + type mockWeightedNode struct { Node @@ -80,6 +82,18 @@ func (b *mockBalancer) Pick(ctx context.Context, nodes []WeightedNode) (selected return } +type mockMustErrorBalancerBuilder struct{} + +func (b *mockMustErrorBalancerBuilder) Build() Balancer { + return &mockMustErrorBalancer{} +} + +type mockMustErrorBalancer struct{} + +func (b *mockMustErrorBalancer) Pick(ctx context.Context, nodes []WeightedNode) (selected WeightedNode, done DoneFunc, err error) { + return nil, nil, errNodeNotMatch +} + func TestDefault(t *testing.T) { builder := DefaultBuilder{ Node: &mockWeightedNodeBuilder{}, @@ -107,6 +121,7 @@ func TestDefault(t *testing.T) { Endpoints: []string{"http://127.0.0.1:9090"}, Metadata: map[string]string{"weight": "10"}, })) + selector.Apply(nodes) n, done, err := selector.Select(context.Background(), WithNodeFilter(mockFilter("v2.0.0"))) if err != nil { @@ -121,6 +136,9 @@ func TestDefault(t *testing.T) { if !reflect.DeepEqual("v2.0.0", n.Version()) { t.Errorf("expect %v, got %v", "v2.0.0", n.Version()) } + if n.Scheme() == "" { + t.Errorf("expect %v, got %v", "", n.Scheme()) + } if n.Address() == "" { t.Errorf("expect %v, got %v", "", n.Address()) } @@ -135,6 +153,21 @@ func TestDefault(t *testing.T) { } done(context.Background(), DoneInfo{}) + // peer in ctx + ctx := NewPeerContext(context.Background(), &Peer{ + Node: mockWeightedNode{}, + }) + n, done, err = selector.Select(ctx) + if err != nil { + t.Errorf("expect %v, got %v", ErrNoAvailable, err) + } + if done == nil { + t.Errorf("expect %v, got %v", nil, done) + } + if n == nil { + t.Errorf("expect %v, got %v", nil, n) + } + // no v3.0.0 instance n, done, err = selector.Select(context.Background(), WithNodeFilter(mockFilter("v3.0.0"))) if !errors.Is(ErrNoAvailable, err) { @@ -172,4 +205,87 @@ func TestDefault(t *testing.T) { if n != nil { t.Errorf("expect %v, got %v", nil, n) } + + // without node_filters + n, done, err = selector.Select(context.Background()) + if !errors.Is(ErrNoAvailable, err) { + t.Errorf("expect %v, got %v", ErrNoAvailable, err) + } + if done != nil { + t.Errorf("expect %v, got %v", nil, done) + } + if n != nil { + t.Errorf("expect %v, got %v", nil, n) + } +} + +func TestWithoutApply(t *testing.T) { + builder := DefaultBuilder{ + Node: &mockWeightedNodeBuilder{}, + Balancer: &mockBalancerBuilder{}, + } + selector := builder.Build() + n, done, err := selector.Select(context.Background()) + if !errors.Is(ErrNoAvailable, err) { + t.Errorf("expect %v, got %v", ErrNoAvailable, err) + } + if done != nil { + t.Errorf("expect %v, got %v", nil, done) + } + if n != nil { + t.Errorf("expect %v, got %v", nil, n) + } +} + +func TestNoPick(t *testing.T) { + builder := DefaultBuilder{ + Node: &mockWeightedNodeBuilder{}, + Balancer: &mockMustErrorBalancerBuilder{}, + } + var nodes []Node + nodes = append(nodes, NewNode( + "http", + "127.0.0.1:8080", + ®istry.ServiceInstance{ + ID: "127.0.0.1:8080", + Name: "helloworld", + Version: "v2.0.0", + Endpoints: []string{"http://127.0.0.1:8080"}, + Metadata: map[string]string{"weight": "10"}, + })) + nodes = append(nodes, NewNode( + "http", + "127.0.0.1:9090", + ®istry.ServiceInstance{ + ID: "127.0.0.1:9090", + Name: "helloworld", + Version: "v1.0.0", + Endpoints: []string{"http://127.0.0.1:9090"}, + Metadata: map[string]string{"weight": "10"}, + })) + selector := builder.Build() + selector.Apply(nodes) + n, done, err := selector.Select(context.Background()) + if !errors.Is(errNodeNotMatch, err) { + t.Errorf("expect %v, got %v", errNodeNotMatch, err) + } + if done != nil { + t.Errorf("expect %v, got %v", nil, done) + } + if n != nil { + t.Errorf("expect %v, got %v", nil, n) + } +} + +func TestGolobal(t *testing.T) { + builder := DefaultBuilder{ + Node: &mockWeightedNodeBuilder{}, + Balancer: &mockBalancerBuilder{}, + } + SetGlobalSelector(&builder) + + gBuilder := GlobalSelector() + if gBuilder == nil { + t.Errorf("expect %v, got %v", nil, gBuilder) + } } From 890bc21ac17e4196ddc5a576d1d945608575786d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=85=E5=AD=90?= Date: Wed, 31 Aug 2022 21:04:14 +0800 Subject: [PATCH 28/71] docs: update readme.md, remove qq group (#2341) --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index f4023812c..815be2fc5 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,6 @@ If you discover a security vulnerability within Kratos, please send an e-mail to - [Wechat Group](https://github.com/go-kratos/kratos/issues/682) - [Discord Group](https://discord.gg/BWzJsUJ) - [go-kratos.dev](https://go-kratos.dev/en) -- QQ Group: 716486124 ## Contributors From 20c2425c18d7cf18393a1899e72e576749dc799a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=99=AB=E5=AD=90=E6=A8=B1=E6=A1=83?= Date: Wed, 31 Aug 2022 21:35:38 +0800 Subject: [PATCH 29/71] =?UTF-8?q?fix=20`kratos=20new=20-r`=20not=20support?= =?UTF-8?q?=20scp=20styled=20git=20url.issue=20https://gith=E2=80=A6=20(#2?= =?UTF-8?q?295)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix `kratos new -r` not support scp styled git url.issue https://github.com/go-kratos/kratos/issues/2294 * fix lint * fix lint * remove tail space and add test case Co-authored-by: czyt Co-authored-by: czyt --- cmd/kratos/internal/base/repo.go | 34 ++++++-------- cmd/kratos/internal/base/repo_test.go | 50 +++++++++++++------- cmd/kratos/internal/base/vcs_url.go | 58 ++++++++++++++++++++++++ cmd/kratos/internal/base/vcs_url_test.go | 55 ++++++++++++++++++++++ 4 files changed, 162 insertions(+), 35 deletions(-) create mode 100644 cmd/kratos/internal/base/vcs_url.go create mode 100644 cmd/kratos/internal/base/vcs_url_test.go diff --git a/cmd/kratos/internal/base/repo.go b/cmd/kratos/internal/base/repo.go index 55b12ac0d..bdcb3f010 100644 --- a/cmd/kratos/internal/base/repo.go +++ b/cmd/kratos/internal/base/repo.go @@ -3,13 +3,15 @@ package base import ( "context" "fmt" - stdurl "net/url" + "net" "os" "os/exec" "path" "strings" ) +var unExpandVarPath = []string{"~", ".", ".."} + // Repo is git repository manager. type Repo struct { url string @@ -18,27 +20,21 @@ type Repo struct { } func repoDir(url string) string { - if !strings.Contains(url, "//") { - url = "//" + url - } - if strings.HasPrefix(url, "//git@") { - url = "ssh:" + url - } else if strings.HasPrefix(url, "//") { - url = "https:" + url + vcsURL, err := ParseVCSUrl(url) + if err != nil { + return url } - u, err := stdurl.Parse(url) - if err == nil { - url = fmt.Sprintf("%s://%s%s", u.Scheme, u.Hostname(), u.Path) + // check host contains port + host, _, err := net.SplitHostPort(vcsURL.Host) + if err != nil { + host = vcsURL.Host } - var start int - start = strings.Index(url, "//") - if start == -1 { - start = strings.Index(url, ":") + 1 - } else { - start += 2 + for _, p := range unExpandVarPath { + host = strings.TrimLeft(host, p) } - end := strings.LastIndex(url, "/") - return url[start:end] + dir := path.Base(path.Dir(vcsURL.Path)) + url = fmt.Sprintf("%s/%s", host, dir) + return url } // NewRepo new a repository manager. diff --git a/cmd/kratos/internal/base/repo_test.go b/cmd/kratos/internal/base/repo_test.go index 15ed33c8c..dfcdbb93c 100644 --- a/cmd/kratos/internal/base/repo_test.go +++ b/cmd/kratos/internal/base/repo_test.go @@ -7,7 +7,37 @@ import ( ) func TestRepo(t *testing.T) { - os.RemoveAll("/tmp/test_repo") + urls := []string{ + // ssh://[user@]host.xz[:port]/path/to/repo.git/ + "ssh://git@github.com:7875/go-kratos/kratos.git", + // git://host.xz[:port]/path/to/repo.git/ + "git://github.com:7875/go-kratos/kratos.git", + // http[s]://host.xz[:port]/path/to/repo.git/ + "https://github.com:7875/go-kratos/kratos.git", + // ftp[s]://host.xz[:port]/path/to/repo.git/ + "ftps://github.com:7875/go-kratos/kratos.git", + //[user@]host.xz:path/to/repo.git/ + "git@github.com:go-kratos/kratos.git", + // ssh://[user@]host.xz[:port]/~[user]/path/to/repo.git/ + "ssh://git@github.com:7875/go-kratos/kratos.git", + // git://host.xz[:port]/~[user]/path/to/repo.git/ + "git://github.com:7875/go-kratos/kratos.git", + //[user@]host.xz:/~[user]/path/to/repo.git/ + "git@github.com:go-kratos/kratos.git", + ///path/to/repo.git/ + "//github.com/go-kratos/kratos.git", + // file:///path/to/repo.git/ + "file://./github.com/go-kratos/kratos.git", + } + for _, url := range urls { + dir := repoDir(url) + if dir != "github.com/go-kratos" && dir != "/go-kratos" { + t.Fatal(url, "repoDir test failed", dir) + } + } +} + +func TestRepoClone(t *testing.T) { r := NewRepo("https://github.com/go-kratos/service-layout.git", "") if err := r.Clone(context.Background()); err != nil { t.Fatal(err) @@ -15,19 +45,7 @@ func TestRepo(t *testing.T) { if err := r.CopyTo(context.Background(), "/tmp/test_repo", "github.com/go-kratos/kratos-layout", nil); err != nil { t.Fatal(err) } - urls := []string{ - "ssh://git@gitlab.xxx.com:1234/foo/bar.git", - "ssh://gitlab.xxx.com:1234/foo/bar.git", - "//git@gitlab.xxx.com:1234/foo/bar.git", - "git@gitlab.xxx.com:1234/foo/bar.git", - "gitlab.xxx.com:1234/foo/bar.git", - "gitlab.xxx.com/foo/bar.git", - "gitlab.xxx.com/foo/bar", - } - for _, url := range urls { - dir := repoDir(url) - if dir != "gitlab.xxx.com/foo" { - t.Fatal("repoDir test failed", dir) - } - } + t.Cleanup(func() { + os.RemoveAll("/tmp/test_repo") + }) } diff --git a/cmd/kratos/internal/base/vcs_url.go b/cmd/kratos/internal/base/vcs_url.go new file mode 100644 index 000000000..ef76db30f --- /dev/null +++ b/cmd/kratos/internal/base/vcs_url.go @@ -0,0 +1,58 @@ +package base + +import ( + "errors" + "net/url" + "regexp" + "strings" +) + +var ( + scpSyntaxRe = regexp.MustCompile(`^([a-zA-Z0-9_]+)@([a-zA-Z0-9._-]+):(.*)$`) + scheme = []string{"git", "https", "http", "git+ssh", "ssh", "file", "ftp", "ftps"} +) + +// ParseVCSUrl ref https://github.com/golang/go/blob/master/src/cmd/go/internal/vcs/vcs.go +// see https://go-review.googlesource.com/c/go/+/12226/ +// git url define https://git-scm.com/docs/git-clone#_git_urls +func ParseVCSUrl(repo string) (*url.URL, error) { + var ( + repoURL *url.URL + err error + ) + + if m := scpSyntaxRe.FindStringSubmatch(repo); m != nil { + // Match SCP-like syntax and convert it to a URL. + // Eg, "git@github.com:user/repo" becomes + // "ssh://git@github.com/user/repo". + repoURL = &url.URL{ + Scheme: "ssh", + User: url.User(m[1]), + Host: m[2], + Path: m[3], + } + } else { + if !strings.Contains(repo, "//") { + repo = "//" + repo + } + if strings.HasPrefix(repo, "//git@") { + repo = "ssh:" + repo + } else if strings.HasPrefix(repo, "//") { + repo = "https:" + repo + } + repoURL, err = url.Parse(repo) + if err != nil { + return nil, err + } + } + + // Iterate over insecure schemes too, because this function simply + // reports the state of the repo. If we can't see insecure schemes then + // we can't report the actual repo URL. + for _, s := range scheme { + if repoURL.Scheme == s { + return repoURL, nil + } + } + return nil, errors.New("unable to parse repo url") +} diff --git a/cmd/kratos/internal/base/vcs_url_test.go b/cmd/kratos/internal/base/vcs_url_test.go new file mode 100644 index 000000000..09b8d5682 --- /dev/null +++ b/cmd/kratos/internal/base/vcs_url_test.go @@ -0,0 +1,55 @@ +package base + +import ( + "net" + "strings" + "testing" +) + +func TestParseVCSUrl(t *testing.T) { + repos := []string{ + // ssh://[user@]host.xz[:port]/path/to/repo.git/ + "ssh://git@github.com:7875/go-kratos/kratos.git", + // git://host.xz[:port]/path/to/repo.git/ + "git://github.com:7875/go-kratos/kratos.git", + // http[s]://host.xz[:port]/path/to/repo.git/ + "https://github.com:7875/go-kratos/kratos.git", + // ftp[s]://host.xz[:port]/path/to/repo.git/ + "ftps://github.com:7875/go-kratos/kratos.git", + //[user@]host.xz:path/to/repo.git/ + "git@github.com:go-kratos/kratos.git", + // ssh://[user@]host.xz[:port]/~[user]/path/to/repo.git/ + "ssh://git@github.com:7875/go-kratos/kratos.git", + // git://host.xz[:port]/~[user]/path/to/repo.git/ + "git://github.com:7875/go-kratos/kratos.git", + //[user@]host.xz:/~[user]/path/to/repo.git/ + "git@github.com:go-kratos/kratos.git", + ///path/to/repo.git/ + "~/go-kratos/kratos.git", + // file:///path/to/repo.git/ + "file://~/go-kratos/kratos.git", + } + for _, repo := range repos { + url, err := ParseVCSUrl(repo) + if err != nil { + t.Fatal(repo, err) + } + urlPath := strings.TrimLeft(url.Path, "/") + if urlPath != "go-kratos/kratos.git" { + t.Fatal(repo, "parse url failed", urlPath) + } + } +} + +func TestParseSsh(t *testing.T) { + repo := "ssh://git@github.com:7875/go-kratos/kratos.git" + url, err := ParseVCSUrl(repo) + if err != nil { + t.Fatal(err) + } + host, _, err := net.SplitHostPort(url.Host) + if err != nil { + host = url.Host + } + t.Log(host, url.Path) +} From cbfb6db9cf68df3919049f6220096adf83c982e6 Mon Sep 17 00:00:00 2001 From: icylight <408209435@qq.com> Date: Wed, 31 Aug 2022 21:35:59 +0800 Subject: [PATCH 30/71] fix(internal/host): Extract can't return the minium index ip (#2298) * fix(internal/host): Extract can't return the minium index ip * rollback * fix index --- internal/host/host.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/host/host.go b/internal/host/host.go index d5cc7ffa3..bf204eede 100644 --- a/internal/host/host.go +++ b/internal/host/host.go @@ -50,16 +50,13 @@ func Extract(hostPort string, lis net.Listener) (string, error) { if err != nil { return "", err } - lowest := int(^uint(0) >> 1) + minIndex := int(^uint(0) >> 1) var result net.IP for _, iface := range ifaces { if (iface.Flags & net.FlagUp) == 0 { continue } - if iface.Index < lowest || result == nil { - lowest = iface.Index - } - if result != nil { + if iface.Index >= minIndex && result != nil { continue } addrs, err := iface.Addrs() @@ -77,7 +74,9 @@ func Extract(hostPort string, lis net.Listener) (string, error) { continue } if isValidIP(ip.String()) { + minIndex = iface.Index result = ip + break } } } From ad7597c0b167a849d3d424ca4ac41b3004f633d7 Mon Sep 17 00:00:00 2001 From: Wang-TaoTao <53828914+Wang-TaoTao@users.noreply.github.com> Date: Wed, 31 Aug 2022 21:42:54 +0800 Subject: [PATCH 31/71] fix: init global selector to wrr (#2323) --- transport/grpc/client.go | 4 ++-- transport/http/client.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/transport/grpc/client.go b/transport/grpc/client.go index a1424d209..da6ceb028 100644 --- a/transport/grpc/client.go +++ b/transport/grpc/client.go @@ -10,7 +10,7 @@ import ( "github.com/go-kratos/kratos/v2/middleware" "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/selector" - "github.com/go-kratos/kratos/v2/selector/p2c" + "github.com/go-kratos/kratos/v2/selector/wrr" "github.com/go-kratos/kratos/v2/transport" "github.com/go-kratos/kratos/v2/transport/grpc/resolver/discovery" @@ -25,7 +25,7 @@ import ( func init() { if selector.GlobalSelector() == nil { - selector.SetGlobalSelector(p2c.NewBuilder()) + selector.SetGlobalSelector(wrr.NewBuilder()) } } diff --git a/transport/http/client.go b/transport/http/client.go index 79ac4f911..c0ad5ee38 100644 --- a/transport/http/client.go +++ b/transport/http/client.go @@ -16,13 +16,13 @@ import ( "github.com/go-kratos/kratos/v2/middleware" "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/selector" - "github.com/go-kratos/kratos/v2/selector/p2c" + "github.com/go-kratos/kratos/v2/selector/wrr" "github.com/go-kratos/kratos/v2/transport" ) func init() { if selector.GlobalSelector() == nil { - selector.SetGlobalSelector(p2c.NewBuilder()) + selector.SetGlobalSelector(wrr.NewBuilder()) } } From 60b00c8ade032c18b1bba9c9a96a84db4a574bae Mon Sep 17 00:00:00 2001 From: icylight <408209435@qq.com> Date: Wed, 31 Aug 2022 22:58:32 +0800 Subject: [PATCH 32/71] fix(config/env): prefixs typo (#2321) --- config/env/env.go | 10 +++++----- config/env/env_test.go | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/config/env/env.go b/config/env/env.go index 6c104f1c1..30e011b92 100644 --- a/config/env/env.go +++ b/config/env/env.go @@ -8,11 +8,11 @@ import ( ) type env struct { - prefixs []string + prefixes []string } -func NewSource(prefixs ...string) config.Source { - return &env{prefixs: prefixs} +func NewSource(prefixes ...string) config.Source { + return &env{prefixes: prefixes} } func (e *env) Load() (kv []*config.KeyValue, err error) { @@ -29,8 +29,8 @@ func (e *env) load(envStrings []string) []*config.KeyValue { v = subs[1] } - if len(e.prefixs) > 0 { - p, ok := matchPrefix(e.prefixs, k) + if len(e.prefixes) > 0 { + p, ok := matchPrefix(e.prefixes, k) if !ok || len(p) == len(k) { continue } diff --git a/config/env/env_test.go b/config/env/env_test.go index 6574c1d83..72fcff31d 100644 --- a/config/env/env_test.go +++ b/config/env/env_test.go @@ -261,7 +261,7 @@ func TestEnvWithoutPrefix(t *testing.T) { func Test_env_load(t *testing.T) { type fields struct { - prefixs []string + prefixes []string } type args struct { envStrings []string @@ -275,7 +275,7 @@ func Test_env_load(t *testing.T) { { name: "without prefixes", fields: fields{ - prefixs: nil, + prefixes: nil, }, args: args{ envStrings: []string{ @@ -294,7 +294,7 @@ func Test_env_load(t *testing.T) { { name: "empty prefix", fields: fields{ - prefixs: []string{""}, + prefixes: []string{""}, }, args: args{ envStrings: []string{ @@ -313,7 +313,7 @@ func Test_env_load(t *testing.T) { { name: "underscore prefix", fields: fields{ - prefixs: []string{"_"}, + prefixes: []string{"_"}, }, args: args{ envStrings: []string{ @@ -332,7 +332,7 @@ func Test_env_load(t *testing.T) { { name: "with prefixes", fields: fields{ - prefixs: []string{"KRATOS_", "FOO"}, + prefixes: []string{"KRATOS_", "FOO"}, }, args: args{ envStrings: []string{ @@ -351,7 +351,7 @@ func Test_env_load(t *testing.T) { { name: "should not panic #1", fields: fields{ - prefixs: []string{"FOO"}, + prefixes: []string{"FOO"}, }, args: args{ envStrings: []string{ @@ -364,7 +364,7 @@ func Test_env_load(t *testing.T) { { name: "should not panic #2", fields: fields{ - prefixs: []string{"FOO=1"}, + prefixes: []string{"FOO=1"}, }, args: args{ envStrings: []string{ @@ -377,7 +377,7 @@ func Test_env_load(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { e := &env{ - prefixs: tt.fields.prefixs, + prefixes: tt.fields.prefixes, } got := e.load(tt.args.envStrings) if !reflect.DeepEqual(tt.want, got) { @@ -419,8 +419,8 @@ func Test_matchPrefix(t *testing.T) { } func Test_env_watch(t *testing.T) { - prefixs := []string{"BAR", "FOO"} - source := NewSource(prefixs...) + prefixes := []string{"BAR", "FOO"} + source := NewSource(prefixes...) w, err := source.Watch() if err != nil { t.Errorf("expect no err, got %v", err) From 503efd38251825d49d6114881ec461251bcb5033 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Sep 2022 16:09:21 +0800 Subject: [PATCH 33/71] build(deps): bump go.uber.org/zap in /contrib/log/zap (#2326) Bumps [go.uber.org/zap](https://github.com/uber-go/zap) from 1.22.0 to 1.23.0. - [Release notes](https://github.com/uber-go/zap/releases) - [Changelog](https://github.com/uber-go/zap/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/zap/compare/v1.22.0...v1.23.0) --- updated-dependencies: - dependency-name: go.uber.org/zap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- contrib/log/zap/go.mod | 2 +- contrib/log/zap/go.sum | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/contrib/log/zap/go.mod b/contrib/log/zap/go.mod index 192127ee0..0a8e74f60 100644 --- a/contrib/log/zap/go.mod +++ b/contrib/log/zap/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/go-kratos/kratos/v2 v2.5.0 - go.uber.org/zap v1.22.0 + go.uber.org/zap v1.23.0 ) replace github.com/go-kratos/kratos/v2 => ../../../ diff --git a/contrib/log/zap/go.sum b/contrib/log/zap/go.sum index 1a82a3847..5c9de790a 100644 --- a/contrib/log/zap/go.sum +++ b/contrib/log/zap/go.sum @@ -72,11 +72,13 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/shirou/gopsutil/v3 v3.21.8/go.mod h1:YWp/H8Qs5fVmf17v7JNZzA0mPJ+mS2e9JdiUF9LlKzQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= @@ -90,8 +92,8 @@ go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/zap v1.22.0 h1:Zcye5DUgBloQ9BaT4qc9BnjOFog5TvBSAGkJ3Nf70c0= -go.uber.org/zap v1.22.0/go.mod h1:H4siCOZOrAolnUPJEkfaSjDqyP+BDS0DdDWzwcgt3+U= +go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= +go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= From 7a336ca353ab7b899ad4e09841544b8962cf6bee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Sep 2022 16:10:55 +0800 Subject: [PATCH 34/71] build(deps): bump google.golang.org/protobuf in /contrib/opensergo (#2248) Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.28.0 to 1.28.1. - [Release notes](https://github.com/protocolbuffers/protobuf-go/releases) - [Changelog](https://github.com/protocolbuffers/protobuf-go/blob/master/release.bash) - [Commits](https://github.com/protocolbuffers/protobuf-go/compare/v1.28.0...v1.28.1) --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- contrib/opensergo/go.mod | 2 +- contrib/opensergo/go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/opensergo/go.mod b/contrib/opensergo/go.mod index beba8f7f9..0b920de4b 100644 --- a/contrib/opensergo/go.mod +++ b/contrib/opensergo/go.mod @@ -8,7 +8,7 @@ require ( golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd google.golang.org/grpc v1.46.2 - google.golang.org/protobuf v1.28.0 + google.golang.org/protobuf v1.28.1 ) require ( diff --git a/contrib/opensergo/go.sum b/contrib/opensergo/go.sum index f894f6ff2..aa486a6fe 100644 --- a/contrib/opensergo/go.sum +++ b/contrib/opensergo/go.sum @@ -167,8 +167,9 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From aaabd0747484a8b1c654db3dd6fe3c02cd699d15 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Sep 2022 16:12:08 +0800 Subject: [PATCH 35/71] build(deps): bump actions/setup-go from 3.2.1 to 3.3.0 (#2313) Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3.2.1 to 3.3.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v3.2.1...v3.3.0) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b1c2ca11a..552fef4a9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -44,7 +44,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v3.2.1 + uses: actions/setup-go@v3.3.0 with: go-version: ${{ matrix.go }} From e820b392e99c6f99e9471530008a4e27ba93a4e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Sep 2022 21:14:50 +0800 Subject: [PATCH 36/71] build(deps): bump github.com/hashicorp/consul/api (#2279) Bumps [github.com/hashicorp/consul/api](https://github.com/hashicorp/consul) from 1.13.1 to 1.14.0. - [Release notes](https://github.com/hashicorp/consul/releases) - [Changelog](https://github.com/hashicorp/consul/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/consul/compare/v1.13.1...api/v1.14.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/consul/api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- contrib/config/consul/go.mod | 2 +- contrib/config/consul/go.sum | 125 +++++++++++++++++++++++++++++------ 2 files changed, 104 insertions(+), 23 deletions(-) diff --git a/contrib/config/consul/go.mod b/contrib/config/consul/go.mod index a251affb3..49e23b744 100644 --- a/contrib/config/consul/go.mod +++ b/contrib/config/consul/go.mod @@ -4,7 +4,7 @@ go 1.15 require ( github.com/go-kratos/kratos/v2 v2.4.0 - github.com/hashicorp/consul/api v1.13.1 + github.com/hashicorp/consul/api v1.14.0 ) replace github.com/go-kratos/kratos/v2 => ../../../ diff --git a/contrib/config/consul/go.sum b/contrib/config/consul/go.sum index 5816b336c..25fbdf7f3 100644 --- a/contrib/config/consul/go.sum +++ b/contrib/config/consul/go.sum @@ -1,16 +1,27 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.3.10 h1:FR+drcQStOe+32sYyJYyZ7FIdgoGGBnwLl+flodp8Uo= +github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -18,6 +29,7 @@ github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XP github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -32,17 +44,24 @@ github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kratos/aegis v0.1.2/go.mod h1:jYeSQ3Gesba478zEnujOiG5QdsyF3Xk/8owFUeKcHxw= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/form/v4 v4.2.0/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= @@ -55,8 +74,9 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c h1:964Od4U6p2jUkFxvCydnIczKteheJEzHRToSGK3Bnlw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -66,50 +86,69 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.13.1 h1:r5cPdVFUy+pFF7nt+0ArLD9hm+E39OewJkvNdjKXcL4= -github.com/hashicorp/consul/api v1.13.1/go.mod h1:+1VcOos0TVdQFqXxphG4zmGcwQB4KVGkp1maPqnkDpE= +github.com/hashicorp/consul/api v1.14.0 h1:Y64GIJ8hYTu+tuGekwO4G4ardXoiCivX9wv1iP/kihk= +github.com/hashicorp/consul/api v1.14.0/go.mod h1:bcaw5CSZ7NE9qfOfKCI1xb7ZKjzu/MyvQkCLTfqLqxQ= github.com/hashicorp/consul/sdk v0.10.0 h1:rGLEh2AWK4K0KCMvqWAz2EYxQqgciIfMagWZ0nVe5MI= github.com/hashicorp/consul/sdk v0.10.0/go.mod h1:yPkX5Q6CsxTFMjQQDJwzeNmUUF5NUGGbrDsv9wTb8cw= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-hclog v0.12.0 h1:d4QkX8FRTYaKaCZBoXYY8zJX2BXjWxurN/GA2tkrmZM= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= +github.com/hashicorp/go-hclog v0.14.1 h1:nQcJDQwIAGnmoUWp8ubocEX40cCml/17YkF6csQLReU= +github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= +github.com/hashicorp/go-immutable-radix v1.3.0 h1:8exGP7ego3OmkfksihtSouGMZ+hQrhxx+FVELeXpVPE= +github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= +github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= +github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= -github.com/hashicorp/memberlist v0.3.0 h1:8+567mCcFDnS5ADl7lrpxPMWiFCElyUEeW0gtj34fMA= github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/serf v0.9.6 h1:uuEX1kLR6aoda1TBttmJQKDLZE1Ob7KN0NPdE7EtCDc= -github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/hashicorp/memberlist v0.3.1 h1:MXgUXLqva1QvpVEDQW1IQLG0wivQAtmFlHRQ+1vWZfM= +github.com/hashicorp/memberlist v0.3.1/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/serf v0.9.7 h1:hkdgbqizGQHuU5IPqYM1JdSMV8nKfpuOnZYXssk9muY= +github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= @@ -120,32 +159,59 @@ github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcME github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= +github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shirou/gopsutil/v3 v3.21.8/go.mod h1:YWp/H8Qs5fVmf17v7JNZzA0mPJ+mS2e9JdiUF9LlKzQ= -github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -153,10 +219,12 @@ github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMT github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -166,38 +234,46 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1 h1:4qWs8cYYH6PoEFy4dfhDFgoMGkwAcETd+MmPdCPMzUc= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.0.0-20211216030914-fe4d6282115f h1:hEYJvxw1lSnWIl8X9ofsYMklzaDs90JI2az5YMd4fPM= +golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 h1:w8s32wxx3sY+OjLlv9qltkLU5yvJzxjjgiHWLjdIcw4= golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -205,6 +281,7 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -255,11 +332,15 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 39536d32795fa7bda4fdd4e369c63b9d5e3d3a2a Mon Sep 17 00:00:00 2001 From: 180909 <734461790@qq.com> Date: Thu, 1 Sep 2022 23:21:27 +0800 Subject: [PATCH 37/71] fix(cmd): fix CmdAdd long message example (#2343) --- cmd/kratos/internal/proto/add/add.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/kratos/internal/proto/add/add.go b/cmd/kratos/internal/proto/add/add.go index 626b5db25..88433dc75 100644 --- a/cmd/kratos/internal/proto/add/add.go +++ b/cmd/kratos/internal/proto/add/add.go @@ -15,7 +15,7 @@ import ( var CmdAdd = &cobra.Command{ Use: "add", Short: "Add a proto API template", - Long: "Add a proto API template. Example: kratos add helloworld/v1/hello.proto", + Long: "Add a proto API template. Example: kratos proto add helloworld/v1/hello.proto", Run: run, } From 617ee1aa39a09f1b93ce246d7a569e30605690fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E4=BB=B2=E8=BE=89?= Date: Fri, 2 Sep 2022 15:08:26 +0800 Subject: [PATCH 38/71] fix(lint): Using deprecated package `io/ioutil` cause lint interrupted, change to `os` or `io` package. (#2353) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 黄仲辉 <610195979@qq.com> --- contrib/config/polaris/config_test.go | 4 ++-- contrib/opensergo/opensergo.go | 5 ++--- contrib/opensergo/opensergo_test.go | 3 +-- contrib/registry/eureka/client.go | 5 ++--- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/contrib/config/polaris/config_test.go b/contrib/config/polaris/config_test.go index fc864526c..bf8b6fd61 100644 --- a/contrib/config/polaris/config_test.go +++ b/contrib/config/polaris/config_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" + "io" "net/http" "reflect" "strings" @@ -38,7 +38,7 @@ func makeJSONRequest(uri string, data string, method string, headers map[string] return nil, err } defer res.Body.Close() - return ioutil.ReadAll(res.Body) + return io.ReadAll(res.Body) } type commonRes struct { diff --git a/contrib/opensergo/opensergo.go b/contrib/opensergo/opensergo.go index 6da1f5962..112c0babe 100644 --- a/contrib/opensergo/opensergo.go +++ b/contrib/opensergo/opensergo.go @@ -2,7 +2,6 @@ package opensergo import ( "encoding/json" - "io/ioutil" "net" "net/url" "os" @@ -52,7 +51,7 @@ func New(opts ...Option) (*OpenSergo, error) { } } if v := os.Getenv("OPENSERGO_BOOTSTRAP_CONFIG"); v != "" { - b, err := ioutil.ReadFile(v) + b, err := os.ReadFile(v) if err != nil { return nil, err } @@ -89,7 +88,7 @@ func (s *OpenSergo) ReportMetadata(ctx context.Context, app kratos.AppInfo) erro } for _, endpoint := range app.Endpoint() { - u, err := url.Parse(endpoint) //nolint + u, err := url.Parse(endpoint) // nolint if err != nil { return err } diff --git a/contrib/opensergo/opensergo_test.go b/contrib/opensergo/opensergo_test.go index 5c752d1c1..9f49bbeef 100644 --- a/contrib/opensergo/opensergo_test.go +++ b/contrib/opensergo/opensergo_test.go @@ -1,7 +1,6 @@ package opensergo import ( - "io/ioutil" "net" "os" "path/filepath" @@ -337,7 +336,7 @@ func TestOpenSergo(t *testing.T) { }, preFunc: func(t *testing.T) { fileContent := `{"endpoint": "127.0.0.1:9090"}` - err := ioutil.WriteFile("test.json", []byte(fileContent), 0o644) + err := os.WriteFile("test.json", []byte(fileContent), 0o644) if err != nil { t.Fatalf("ioutil.WriteFile error:%s", err) } diff --git a/contrib/registry/eureka/client.go b/contrib/registry/eureka/client.go index 64cdddec9..35dd14729 100644 --- a/contrib/registry/eureka/client.go +++ b/contrib/registry/eureka/client.go @@ -6,7 +6,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "math/rand" "net/http" "strings" @@ -323,12 +322,12 @@ func (e *Client) do(ctx context.Context, method string, params []string, input i continue } defer func() { - _, _ = io.Copy(ioutil.Discard, resp.Body) + _, _ = io.Copy(io.Discard, resp.Body) resp.Body.Close() }() if output != nil && resp.StatusCode/100 == 2 { - data, err := ioutil.ReadAll(resp.Body) + data, err := io.ReadAll(resp.Body) if err != nil { return err } From cb69bf3714373555c6c1db6424312b1bf19f7373 Mon Sep 17 00:00:00 2001 From: GongGuoWei <62499904+guowei-gong@users.noreply.github.com> Date: Tue, 6 Sep 2022 13:46:14 +0800 Subject: [PATCH 39/71] test(config): add etcd config method test (#2349) Added test cases for the about etcd method - WithPath(path string) - WithPrefix(prefix bool) Update #2135 --- contrib/config/etcd/config_test.go | 61 +++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/contrib/config/etcd/config_test.go b/contrib/config/etcd/config_test.go index c106c0573..821167ec4 100644 --- a/contrib/config/etcd/config_test.go +++ b/contrib/config/etcd/config_test.go @@ -15,7 +15,8 @@ const testKey = "/kratos/test/config" func TestConfig(t *testing.T) { client, err := clientv3.New(clientv3.Config{ Endpoints: []string{"127.0.0.1:2379"}, - DialTimeout: time.Second, DialOptions: []grpc.DialOption{grpc.WithBlock()}, + DialTimeout: time.Second, + DialOptions: []grpc.DialOption{grpc.WithBlock()}, }) if err != nil { t.Fatal(err) @@ -108,3 +109,61 @@ func TestExtToFormat(t *testing.T) { t.Errorf("kvs[0].Format is %s", kvs[0].Format) } } + +func TestEtcdWithPath(t *testing.T) { + tests := []struct { + name string + fields string + want string + }{ + { + name: "default", + fields: testKey, + want: testKey, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + options := &options{ + ctx: context.Background(), + } + + got := WithPath(tt.fields) + got(options) + + if options.path != tt.want { + t.Errorf("WithPath(tt.fields) = %v, want %v", got, tt.want) + } + }) + } +} + +func TestEtcdWithPrefix(t *testing.T) { + tests := []struct { + name string + fields bool + want bool + }{ + { + name: "default", + fields: false, + want: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + options := &options{ + ctx: context.Background(), + } + + got := WithPrefix(tt.fields) + got(options) + + if options.prefix != tt.want { + t.Errorf("WithPrefix(tt.fields) = %v, want %v", got, tt.want) + } + }) + } +} From 8d76eebf8bbeefe0e14a521077371cb695c0b9db Mon Sep 17 00:00:00 2001 From: 180909 <734461790@qq.com> Date: Tue, 6 Sep 2022 13:49:16 +0800 Subject: [PATCH 40/71] test(cmd/change): add ParseGithubURL test (#2339) * test(cmd/change): add ParseGithubURL test * use anonymous struct --- cmd/kratos/internal/change/get_test.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 cmd/kratos/internal/change/get_test.go diff --git a/cmd/kratos/internal/change/get_test.go b/cmd/kratos/internal/change/get_test.go new file mode 100644 index 000000000..a6a9d037a --- /dev/null +++ b/cmd/kratos/internal/change/get_test.go @@ -0,0 +1,25 @@ +package change + +import "testing" + +func TestParseGithubURL(t *testing.T) { + urls := []struct { + url string + owner string + repo string + }{ + {"https://github.com/go-kratos/kratos.git", "go-kratos", "kratos"}, + {"https://github.com/go-kratos/kratos", "go-kratos", "kratos"}, + {"git@github.com:go-kratos/kratos.git", "go-kratos", "kratos"}, + {"https://github.com/go-kratos/go-kratos.dev.git", "go-kratos", "go-kratos.dev"}, + } + for _, url := range urls { + owner, repo := ParseGithubURL(url.url) + if owner != url.owner { + t.Fatalf("owner want: %s, got: %s", owner, url.owner) + } + if repo != url.repo { + t.Fatalf("repo want: %s, got: %s", repo, url.repo) + } + } +} From 18c57349301035046cad6df216e300d09c3a2780 Mon Sep 17 00:00:00 2001 From: 180909 <734461790@qq.com> Date: Tue, 6 Sep 2022 13:50:00 +0800 Subject: [PATCH 41/71] test(cmd): add ModulePath test (#2337) --- cmd/kratos/internal/base/mod_test.go | 34 +++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/cmd/kratos/internal/base/mod_test.go b/cmd/kratos/internal/base/mod_test.go index 9ce7e3ccb..577896b03 100644 --- a/cmd/kratos/internal/base/mod_test.go +++ b/cmd/kratos/internal/base/mod_test.go @@ -1,6 +1,9 @@ package base -import "testing" +import ( + "os" + "testing" +) func TestModuleVersion(t *testing.T) { v, err := ModuleVersion("golang.org/x/mod") @@ -9,3 +12,32 @@ func TestModuleVersion(t *testing.T) { } t.Log(v) } + +func TestModulePath(t *testing.T) { + if err := os.Mkdir("/tmp/test_mod", os.ModePerm); err != nil { + t.Fatal(err) + } + + defer os.RemoveAll("/tmp/test_mod") + + f, err := os.Create("/tmp/test_mod/go.mod") + if err != nil { + t.Fatal(err) + } + + mod := `module github.com/go-kratos/kratos/v2 + +go 1.16` + _, err = f.WriteString(mod) + if err != nil { + t.Fatal(err) + } + + p, err := ModulePath("/tmp/test_mod/go.mod") + if err != nil { + t.Fatal(err) + } + if p != "github.com/go-kratos/kratos/v2" { + t.Fatalf("want: %s, got: %s", "module github.com/go-kratos/kratos/v2", p) + } +} From 0f0c75e20b5dfb3f613b9a12391277c98509b3ec Mon Sep 17 00:00:00 2001 From: 180909 <734461790@qq.com> Date: Wed, 7 Sep 2022 11:42:59 +0800 Subject: [PATCH 42/71] feat(cmd): user prePage to check changelog dev (#2340) --- cmd/kratos/internal/change/get.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/kratos/internal/change/get.go b/cmd/kratos/internal/change/get.go index e91de81bc..18e02072a 100644 --- a/cmd/kratos/internal/change/get.go +++ b/cmd/kratos/internal/change/get.go @@ -59,9 +59,10 @@ func (g *GithubAPI) GetReleaseInfo(version string) ReleaseInfo { func (g *GithubAPI) GetCommitsInfo() []CommitInfo { info := g.GetReleaseInfo("latest") page := 1 + prePage := 100 var list []CommitInfo for { - url := fmt.Sprintf("https://api.github.com/repos/%s/%s/commits?pre_page=100&page=%d&since=%s", g.Owner, g.Repo, page, info.PublishedAt) + url := fmt.Sprintf("https://api.github.com/repos/%s/%s/commits?pre_page=%d&page=%d&since=%s", g.Owner, g.Repo, prePage, page, info.PublishedAt) resp, code := requestGithubAPI(url, "GET", nil, g.Token) if code != http.StatusOK { printGithubErrorInfo(resp) @@ -72,7 +73,7 @@ func (g *GithubAPI) GetCommitsInfo() []CommitInfo { fatal(err) } list = append(list, res...) - if len(res) < http.StatusContinue { + if len(res) < prePage { break } page++ From e176ddfcdd29b5881fd23a9394c52dec002d27d6 Mon Sep 17 00:00:00 2001 From: hshe Date: Wed, 7 Sep 2022 11:43:55 +0800 Subject: [PATCH 43/71] feat(internal/host): prefer ipv4 than ipv6 (#2342) * feat:prefer ipv4 than ipv6 * feat:prefer ipv4 than ipv6 * feat:prefer ipv4 than ipv6 * feat:prefer ipv4 than ipv6 --- internal/host/host.go | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/internal/host/host.go b/internal/host/host.go index bf204eede..774f7ae37 100644 --- a/internal/host/host.go +++ b/internal/host/host.go @@ -51,19 +51,19 @@ func Extract(hostPort string, lis net.Listener) (string, error) { return "", err } minIndex := int(^uint(0) >> 1) - var result net.IP + ips := make([]net.IP, 0) for _, iface := range ifaces { if (iface.Flags & net.FlagUp) == 0 { continue } - if iface.Index >= minIndex && result != nil { + if iface.Index >= minIndex && len(ips) != 0 { continue } addrs, err := iface.Addrs() if err != nil { continue } - for _, rawAddr := range addrs { + for i, rawAddr := range addrs { var ip net.IP switch addr := rawAddr.(type) { case *net.IPAddr: @@ -75,13 +75,18 @@ func Extract(hostPort string, lis net.Listener) (string, error) { } if isValidIP(ip.String()) { minIndex = iface.Index - result = ip - break + if i == 0 { + ips = make([]net.IP, 0, 1) + } + ips = append(ips, ip) + if ip.To4() != nil { + break + } } } } - if result != nil { - return net.JoinHostPort(result.String(), port), nil + if len(ips) != 0 { + return net.JoinHostPort(ips[len(ips)-1].String(), port), nil } return "", nil } From 667d63839c3924191497128afec9551212218d4a Mon Sep 17 00:00:00 2001 From: Guoqiang Ding Date: Wed, 7 Sep 2022 11:44:23 +0800 Subject: [PATCH 44/71] fix(makefile): add "make proto" for proto generating (#2130) Co-authored-by: Guoqiang Ding --- Makefile | 7 ++++++- api/metadata/server.go | 3 --- errors/errors.go | 2 -- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 842c95625..843fceb41 100644 --- a/Makefile +++ b/Makefile @@ -76,4 +76,9 @@ test-coverage: .PHONY: lint lint: $(LINTER) @${TOOLS_SHELL} lint - @echo "lint check finished" \ No newline at end of file + @echo "lint check finished" + +.PHONY: proto +proto: + protoc --proto_path=./api --proto_path=./third_party --go_out=paths=source_relative:./api --go-grpc_out=paths=source_relative:./api --go-http_out=paths=source_relative:./api metadata/metadata.proto + protoc --proto_path=./third_party --go_out=paths=source_relative:./ errors/errors.proto diff --git a/api/metadata/server.go b/api/metadata/server.go index 50f90f61e..96f0e1e67 100644 --- a/api/metadata/server.go +++ b/api/metadata/server.go @@ -20,9 +20,6 @@ import ( dpb "google.golang.org/protobuf/types/descriptorpb" ) -//nolint:lll -//go:generate protoc --proto_path=. --proto_path=../../third_party --go_out=paths=source_relative:. --go-grpc_out=paths=source_relative:. --go-http_out=paths=source_relative:. metadata.proto - // Server is api meta server type Server struct { UnimplementedMetadataServer diff --git a/errors/errors.go b/errors/errors.go index e6bebbf8b..fd95ff3b7 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -9,8 +9,6 @@ import ( "google.golang.org/grpc/status" ) -//go:generate protoc -I. --go_out=paths=source_relative:. errors.proto - const ( // UnknownCode is unknown code for error info. UnknownCode = 500 From ae505063fe3aa4392e6eb8889cfd44feaf95f9ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=85=E5=AD=90?= Date: Wed, 14 Sep 2022 19:44:04 +0800 Subject: [PATCH 45/71] fix(apollo): config return nil when watch err --- contrib/config/apollo/watcher.go | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/config/apollo/watcher.go b/contrib/config/apollo/watcher.go index 670139a26..94ef2ef0b 100644 --- a/contrib/config/apollo/watcher.go +++ b/contrib/config/apollo/watcher.go @@ -31,6 +31,7 @@ func (c *customChangeListener) onChange(namespace string, changes map[string]*st value, err := c.apollo.client.GetConfigCache(namespace).Get("content") if err != nil { log.Warnw("apollo get config failed", "err", err) + return nil } kv = append(kv, &config.KeyValue{ Key: namespace, From f2a33929d0bb3364fe02352689b1b5c79fa6f66f Mon Sep 17 00:00:00 2001 From: "jesse.tang" <1430482733@qq.com> Date: Wed, 14 Sep 2022 22:05:48 +0800 Subject: [PATCH 46/71] fix: modify interface check way (#2375) * fix: modify interface check way * fix --- contrib/registry/etcd/watcher.go | 2 +- contrib/registry/eureka/client.go | 2 +- contrib/registry/eureka/watcher.go | 2 +- contrib/registry/zookeeper/watcher.go | 2 +- middleware/logging/logging_test.go | 2 +- middleware/selector/selector_test.go | 2 +- middleware/tracing/tracing_test.go | 2 +- selector/p2c/p2c.go | 2 +- selector/random/random.go | 2 +- selector/wrr/wrr.go | 2 +- transport/grpc/transport.go | 2 +- transport/http/transport.go | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/contrib/registry/etcd/watcher.go b/contrib/registry/etcd/watcher.go index 22e63474c..a5bf63c41 100644 --- a/contrib/registry/etcd/watcher.go +++ b/contrib/registry/etcd/watcher.go @@ -7,7 +7,7 @@ import ( clientv3 "go.etcd.io/etcd/client/v3" ) -var _ registry.Watcher = &watcher{} +var _ registry.Watcher = (*watcher)(nil) type watcher struct { key string diff --git a/contrib/registry/eureka/client.go b/contrib/registry/eureka/client.go index 35dd14729..f2b4e96f3 100644 --- a/contrib/registry/eureka/client.go +++ b/contrib/registry/eureka/client.go @@ -82,7 +82,7 @@ type DataCenterInfo struct { Class string `json:"@class"` } -var _ APIInterface = new(Client) +var _ APIInterface = (*Client)(nil) type APIInterface interface { Register(ctx context.Context, ep Endpoint) error diff --git a/contrib/registry/eureka/watcher.go b/contrib/registry/eureka/watcher.go index 468d97b24..de37d3229 100644 --- a/contrib/registry/eureka/watcher.go +++ b/contrib/registry/eureka/watcher.go @@ -6,7 +6,7 @@ import ( "github.com/go-kratos/kratos/v2/registry" ) -var _ registry.Watcher = &watcher{} +var _ registry.Watcher = (*watcher)(nil) type watcher struct { ctx context.Context diff --git a/contrib/registry/zookeeper/watcher.go b/contrib/registry/zookeeper/watcher.go index 76f502fa8..f20096754 100644 --- a/contrib/registry/zookeeper/watcher.go +++ b/contrib/registry/zookeeper/watcher.go @@ -10,7 +10,7 @@ import ( "github.com/go-zookeeper/zk" ) -var _ registry.Watcher = &watcher{} +var _ registry.Watcher = (*watcher)(nil) var ErrWatcherStopped = errors.New("watcher stopped") diff --git a/middleware/logging/logging_test.go b/middleware/logging/logging_test.go index 7242f8e04..6ad1a02c9 100644 --- a/middleware/logging/logging_test.go +++ b/middleware/logging/logging_test.go @@ -11,7 +11,7 @@ import ( "github.com/go-kratos/kratos/v2/transport" ) -var _ transport.Transporter = &Transport{} +var _ transport.Transporter = (*Transport)(nil) type Transport struct { kind transport.Kind diff --git a/middleware/selector/selector_test.go b/middleware/selector/selector_test.go index 667d2755f..f12943e43 100644 --- a/middleware/selector/selector_test.go +++ b/middleware/selector/selector_test.go @@ -10,7 +10,7 @@ import ( "github.com/go-kratos/kratos/v2/transport" ) -var _ transport.Transporter = &Transport{} +var _ transport.Transporter = (*Transport)(nil) type Transport struct { kind transport.Kind diff --git a/middleware/tracing/tracing_test.go b/middleware/tracing/tracing_test.go index 8de2ceea4..222a6accd 100644 --- a/middleware/tracing/tracing_test.go +++ b/middleware/tracing/tracing_test.go @@ -14,7 +14,7 @@ import ( "go.opentelemetry.io/otel/trace" ) -var _ transport.Transporter = &mockTransport{} +var _ transport.Transporter = (*mockTransport)(nil) type headerCarrier http.Header diff --git a/selector/p2c/p2c.go b/selector/p2c/p2c.go index 6f8d5a3fa..5e339b0c2 100644 --- a/selector/p2c/p2c.go +++ b/selector/p2c/p2c.go @@ -17,7 +17,7 @@ const ( Name = "p2c" ) -var _ selector.Balancer = &Balancer{} +var _ selector.Balancer = (*Balancer)(nil) // Option is random builder option. type Option func(o *options) diff --git a/selector/random/random.go b/selector/random/random.go index cf59534d0..3af52d416 100644 --- a/selector/random/random.go +++ b/selector/random/random.go @@ -13,7 +13,7 @@ const ( Name = "random" ) -var _ selector.Balancer = &Balancer{} // Name is balancer name +var _ selector.Balancer = (*Balancer)(nil) // Name is balancer name // Option is random builder option. type Option func(o *options) diff --git a/selector/wrr/wrr.go b/selector/wrr/wrr.go index 0b95e04fb..3d91d62e3 100644 --- a/selector/wrr/wrr.go +++ b/selector/wrr/wrr.go @@ -13,7 +13,7 @@ const ( Name = "wrr" ) -var _ selector.Balancer = &Balancer{} // Name is balancer name +var _ selector.Balancer = (*Balancer)(nil) // Name is balancer name // Option is random builder option. type Option func(o *options) diff --git a/transport/grpc/transport.go b/transport/grpc/transport.go index a11a271ae..866228d1d 100644 --- a/transport/grpc/transport.go +++ b/transport/grpc/transport.go @@ -6,7 +6,7 @@ import ( "google.golang.org/grpc/metadata" ) -var _ transport.Transporter = &Transport{} +var _ transport.Transporter = (*Transport)(nil) // Transport is a gRPC transport. type Transport struct { diff --git a/transport/http/transport.go b/transport/http/transport.go index c377b5ad9..e7f53f6db 100644 --- a/transport/http/transport.go +++ b/transport/http/transport.go @@ -7,7 +7,7 @@ import ( "github.com/go-kratos/kratos/v2/transport" ) -var _ Transporter = &Transport{} +var _ Transporter = (*Transport)(nil) // Transporter is http Transporter type Transporter interface { From 0ed01efdfd1316b688602e041093e7ac8d384b27 Mon Sep 17 00:00:00 2001 From: "jesse.tang" <1430482733@qq.com> Date: Thu, 15 Sep 2022 20:10:39 +0800 Subject: [PATCH 47/71] revise err logic or null pointer exception (#2376) --- config/reader_test.go | 6 ------ contrib/config/polaris/config_test.go | 6 +++--- transport/transport_test.go | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/config/reader_test.go b/config/reader_test.go index f2ac1444b..15f8f6178 100644 --- a/config/reader_test.go +++ b/config/reader_test.go @@ -132,9 +132,6 @@ a: t.Fatal(`vvv is not equal to 1`) } - if err != nil { - t.Fatal(`err is not nil`) - } vv, ok = r.Value("a.b.Y") if !ok { t.Fatal(`ok is false`) @@ -147,9 +144,6 @@ a: t.Fatal(`vvy is not equal to "lol"`) } - if err != nil { - t.Fatal(`err is not nil`) - } vv, ok = r.Value("a.b.z") if !ok { t.Fatal(`ok is false`) diff --git a/contrib/config/polaris/config_test.go b/contrib/config/polaris/config_test.go index bf8b6fd61..9559174fa 100644 --- a/contrib/config/polaris/config_test.go +++ b/contrib/config/polaris/config_test.go @@ -26,13 +26,13 @@ var ( func makeJSONRequest(uri string, data string, method string, headers map[string]string) ([]byte, error) { client := http.Client{} req, err := http.NewRequest(method, uri, strings.NewReader(data)) + if err != nil { + return nil, err + } req.Header.Add("Content-Type", "application/json") for k, v := range headers { req.Header.Add(k, v) } - if err != nil { - return nil, err - } res, err := client.Do(req) if err != nil { return nil, err diff --git a/transport/transport_test.go b/transport/transport_test.go index b83c8ee3c..cba7f2ae1 100644 --- a/transport/transport_test.go +++ b/transport/transport_test.go @@ -53,7 +53,7 @@ func TestServerTransport(t *testing.T) { t.Errorf("expected:%v got:%v", true, ok) } if mtr == nil { - t.Errorf("expected:%v got:%v", nil, mtr) + t.Fatalf("expected:%v got:%v", nil, mtr) } if mtr.Kind().String() != KindGRPC.String() { t.Errorf("expected:%v got:%v", KindGRPC.String(), mtr.Kind().String()) From b0b49be38393082193c530e410fa6c42012eb23d Mon Sep 17 00:00:00 2001 From: "jesse.tang" <1430482733@qq.com> Date: Thu, 15 Sep 2022 20:13:08 +0800 Subject: [PATCH 48/71] feat: remote assert libraries (#2372) --- contrib/log/logrus/go.mod | 1 - contrib/log/logrus/go.sum | 1 - contrib/log/logrus/logrus_test.go | 5 +- contrib/registry/servicecomb/go.mod | 4 - contrib/registry/servicecomb/go.sum | 16 ---- contrib/registry/servicecomb/registry_test.go | 77 +++++++++++++------ 6 files changed, 56 insertions(+), 48 deletions(-) diff --git a/contrib/log/logrus/go.mod b/contrib/log/logrus/go.mod index aa1f59465..c41e4ecc7 100644 --- a/contrib/log/logrus/go.mod +++ b/contrib/log/logrus/go.mod @@ -5,7 +5,6 @@ go 1.16 require ( github.com/go-kratos/kratos/v2 v2.5.0 github.com/sirupsen/logrus v1.8.1 - github.com/stretchr/testify v1.7.1 ) replace github.com/go-kratos/kratos/v2 => ../../../ diff --git a/contrib/log/logrus/go.sum b/contrib/log/logrus/go.sum index 129b0363b..c8ee9b374 100644 --- a/contrib/log/logrus/go.sum +++ b/contrib/log/logrus/go.sum @@ -154,7 +154,6 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/contrib/log/logrus/logrus_test.go b/contrib/log/logrus/logrus_test.go index 3dcd6e64f..50b7a99b4 100644 --- a/contrib/log/logrus/logrus_test.go +++ b/contrib/log/logrus/logrus_test.go @@ -7,7 +7,6 @@ import ( "github.com/go-kratos/kratos/v2/log" "github.com/sirupsen/logrus" - "github.com/stretchr/testify/assert" ) func TestLoggerLog(t *testing.T) { @@ -58,7 +57,9 @@ func TestLoggerLog(t *testing.T) { wrapped := NewLogger(logger) _ = wrapped.Log(test.logLevel, test.kvs...) - assert.True(t, strings.HasPrefix(output.String(), test.want)) + if !strings.HasPrefix(output.String(), test.want) { + t.Errorf("TestName(%s): %s has not prefix %s", name, output.String(), test.want) + } }) } } diff --git a/contrib/registry/servicecomb/go.mod b/contrib/registry/servicecomb/go.mod index 43661281a..b5cb1c42a 100644 --- a/contrib/registry/servicecomb/go.mod +++ b/contrib/registry/servicecomb/go.mod @@ -7,9 +7,5 @@ require ( github.com/go-chassis/sc-client v0.6.1-0.20210615014358-a45e9090c751 github.com/go-kratos/kratos/v2 v2.3.1 github.com/gofrs/uuid v4.2.0+incompatible -) - -require ( - github.com/stretchr/testify v1.7.1 golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 ) diff --git a/contrib/registry/servicecomb/go.sum b/contrib/registry/servicecomb/go.sum index 738943dbe..015d1508a 100644 --- a/contrib/registry/servicecomb/go.sum +++ b/contrib/registry/servicecomb/go.sum @@ -137,9 +137,7 @@ github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+ github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/form/v4 v4.2.0 h1:N1wh+Goz61e6w66vo8vJkQt+uwZSoLz50kZPJWR8eic= github.com/go-playground/form/v4 v4.2.0/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= @@ -204,7 +202,6 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -219,7 +216,6 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -229,14 +225,12 @@ github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OI github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -302,11 +296,9 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/little-cui/etcdadpt v0.3.2/go.mod h1:HnRRpIrVEVNWobkiCvG2EHLWKKZ+L047EcI29ma2zA4= @@ -548,7 +540,6 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 h1:w8s32wxx3sY+OjLlv9qltkLU5yvJzxjjgiHWLjdIcw4= golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -589,7 +580,6 @@ golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -597,7 +587,6 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -636,7 +625,6 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -660,7 +648,6 @@ google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd h1:e0TwkXOdbnH/1x5rc5MZ/VYyiZ4v+RdVfrGMqEwT68I= google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -674,7 +661,6 @@ google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.46.2 h1:u+MLGgVf7vRdjEYZ8wDFhAVNmhkbJ5hmrA1LMWK1CAQ= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -688,12 +674,10 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= diff --git a/contrib/registry/servicecomb/registry_test.go b/contrib/registry/servicecomb/registry_test.go index d100c68a1..85afe306c 100644 --- a/contrib/registry/servicecomb/registry_test.go +++ b/contrib/registry/servicecomb/registry_test.go @@ -6,17 +6,14 @@ import ( pb "github.com/go-chassis/cari/discovery" "github.com/go-chassis/sc-client" - "github.com/go-kratos/kratos/v2/registry" "github.com/gofrs/uuid" - "github.com/stretchr/testify/assert" ) var r *Registry func init() { - c := &mockClient{} - r = NewRegistry(c) + r = NewRegistry(&mockClient{}) } type mockClient struct{} @@ -28,7 +25,6 @@ func (receiver *mockClient) WatchMicroService(microServiceID string, callback fu //nolint func (receiver *mockClient) FindMicroServiceInstances(consumerID, appID, microServiceName, versionRule string, opts ...sc.CallOption, - ) ([]*pb.MicroServiceInstance, error) { if microServiceName == "KratosServicecomb" { return []*pb.MicroServiceInstance{{}}, nil @@ -56,10 +52,11 @@ func (receiver *mockClient) GetMicroServiceID(appID, microServiceName, version, return "", nil } -// TestRegistry func TestRegistry(t *testing.T) { instanceID, err := uuid.NewV4() - assert.NoError(t, err) + if err != nil { + t.Fatal(err) + } svc := ®istry.ServiceInstance{ Name: "KratosServicecomb", Version: "0.0.1", @@ -70,25 +67,34 @@ func TestRegistry(t *testing.T) { ctx := context.TODO() t.Run("Register test, expected: success.", func(t *testing.T) { err = r.Register(ctx, svc) - assert.NoError(t, err) + if err != nil { + t.Error(err) + } }) t.Run("GetService test, expected: success.", func(t *testing.T) { var insts []*registry.ServiceInstance insts, err = r.GetService(ctx, svc.Name) - assert.NoError(t, err) - assert.Greater(t, len(insts), 0) + if err != nil { + t.Fatal(err) + } + if len(insts) <= 0 { + t.Errorf("inst len less than 0") + } }) t.Run("Deregister test, expected: success.", func(t *testing.T) { svc.ID = instanceID.String() err = r.Deregister(ctx, svc) - assert.NoError(t, err) + if err != nil { + t.Error(err) + } }) } func TestWatcher(t *testing.T) { - ctx := context.TODO() instanceID1, err := uuid.NewV4() - assert.NoError(t, err) + if err != nil { + t.Fatal(err) + } svc1 := ®istry.ServiceInstance{ Name: "WatcherTest", Version: "0.0.1", @@ -96,33 +102,56 @@ func TestWatcher(t *testing.T) { Endpoints: []string{"tcp://127.0.0.1:9000?isSecure=false"}, ID: instanceID1.String(), } + ctx := context.TODO() err = r.Register(ctx, svc1) - assert.NoError(t, err) + if err != nil { + t.Fatal(err) + } w, err := r.Watch(ctx, "WatcherTest") - assert.NoError(t, err) - assert.NotEmpty(t, w) + if err != nil { + t.Fatal(err) + } + if w == nil { + t.Fatal("w is nil") + } sbWatcher := w.(*Watcher) t.Run("Watch register event, expected: success", func(t *testing.T) { go sbWatcher.Put(svc1) var instances []*registry.ServiceInstance instances, err = w.Next() - assert.NoError(t, err) - assert.NotEmpty(t, instances) - assert.Equal(t, instanceID1.String(), instances[0].ID) + if err != nil { + t.Fatal(err) + } + if len(instances) == 0 { + t.Errorf("instances is empty") + } + if instanceID1.String() != instances[0].ID { + t.Errorf("expected %v, got %v", instanceID1.String(), instances[0].ID) + } }) t.Run("Watch deregister event, expected: success", func(t *testing.T) { // Deregister instance1. err = r.Deregister(ctx, svc1) - assert.NoError(t, err) + if err != nil { + t.Fatal(err) + } go sbWatcher.Put(svc1) var instances []*registry.ServiceInstance instances, err = w.Next() - assert.NoError(t, err) - assert.NotEmpty(t, instances) - assert.Equal(t, instanceID1.String(), instances[0].ID) + if err != nil { + t.Fatal(err) + } + if len(instances) == 0 { + t.Errorf("instances is empty") + } + if instanceID1.String() != instances[0].ID { + t.Errorf("expected %v, got %v", instanceID1.String(), instances[0].ID) + } }) t.Run("Stop test, expected: success", func(t *testing.T) { err = w.Stop() - assert.NoError(t, err) + if err != nil { + t.Error(err) + } }) } From d3f80c10612c5050d30219a6f8ee3765f3046eff Mon Sep 17 00:00:00 2001 From: Loner1024 Date: Thu, 15 Sep 2022 20:13:51 +0800 Subject: [PATCH 49/71] test: supplement the unit testing of transport/grpc (#2371) * test:grpc codec test * style:go fmt * refactor:delete useless code * style:go fmt --- transport/grpc/codec_test.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 transport/grpc/codec_test.go diff --git a/transport/grpc/codec_test.go b/transport/grpc/codec_test.go new file mode 100644 index 000000000..534439ff9 --- /dev/null +++ b/transport/grpc/codec_test.go @@ -0,0 +1,28 @@ +package grpc + +import ( + "reflect" + "testing" + + "google.golang.org/protobuf/types/known/structpb" +) + +func TestCodec(t *testing.T) { + in, err := structpb.NewStruct(map[string]interface{}{"Golang": "Kratos"}) + if err != nil { + t.Errorf("grpc codec create input data error:%v", err) + } + c := codec{} + data, err := c.Marshal(in) + if err != nil { + t.Errorf("grpc codec marshal error:%v", err) + } + out := &structpb.Struct{} + err = c.Unmarshal(data, out) + if err != nil { + t.Errorf("grpc codec unmarshal error:%v", err) + } + if !reflect.DeepEqual(in, out) { + t.Errorf("grpc codec want %v, got %v", in, out) + } +} From 7a320233cd157ecede1744eeef4918c9636f609c Mon Sep 17 00:00:00 2001 From: "jesse.tang" <1430482733@qq.com> Date: Thu, 15 Sep 2022 20:15:07 +0800 Subject: [PATCH 50/71] fix: .gitignore del Repeated .*so (#2367) --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0384a2c2f..260c599e2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ *.exe *.exe~ *.dll -*.so *.dylib # Test binary, built with `go test -c` From 7f2666be9f86e1a37b1e16656e34c234b22deb30 Mon Sep 17 00:00:00 2001 From: Jiepeng Cao Date: Thu, 15 Sep 2022 21:31:13 +0800 Subject: [PATCH 51/71] typo for log (#2374) --- contrib/opensergo/opensergo_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/opensergo/opensergo_test.go b/contrib/opensergo/opensergo_test.go index 9f49bbeef..b63430e20 100644 --- a/contrib/opensergo/opensergo_test.go +++ b/contrib/opensergo/opensergo_test.go @@ -338,7 +338,7 @@ func TestOpenSergo(t *testing.T) { fileContent := `{"endpoint": "127.0.0.1:9090"}` err := os.WriteFile("test.json", []byte(fileContent), 0o644) if err != nil { - t.Fatalf("ioutil.WriteFile error:%s", err) + t.Fatalf("os.WriteFile error:%s", err) } confPath, err := filepath.Abs("./test.json") if err != nil { From 9737a3c5e43456ec64244cae15949f9e9f152443 Mon Sep 17 00:00:00 2001 From: "jesse.tang" <1430482733@qq.com> Date: Mon, 19 Sep 2022 10:39:54 +0800 Subject: [PATCH 52/71] fix: typo and grammatical errors (#2368) * fix: grammar * fix: grammar * fix overrode * translate to English * translate to English --- .github/ISSUE_TEMPLATE/feature-request.md | 2 +- CONTRIBUTING.md | 8 ++++---- cmd/protoc-gen-go-http/http.go | 4 ++-- contrib/config/etcd/README.md | 2 +- contrib/log/aliyun/aliyun.go | 2 +- contrib/metrics/datadog/options.go | 2 +- contrib/registry/consul/client.go | 2 +- contrib/registry/discovery/discovery.go | 2 +- contrib/registry/etcd/registry.go | 2 +- contrib/registry/eureka/eureka.go | 6 +++--- contrib/registry/kubernetes/registry.go | 2 +- encoding/encoding_test.go | 2 +- encoding/form/proto_decode.go | 2 +- errors/types.go | 10 +++++----- internal/group/group.go | 2 +- log/global_test.go | 2 +- log/helper_writer.go | 2 +- middleware/circuitbreaker/circuitbreaker.go | 4 ++-- middleware/logging/logging.go | 2 +- middleware/metadata/metadata_test.go | 2 +- middleware/tracing/span.go | 10 ++++++---- registry/registry.go | 2 +- selector/random/random.go | 2 +- selector/selector_test.go | 2 +- transport/grpc/balancer.go | 2 +- transport/http/client.go | 2 +- transport/http/filter.go | 2 +- transport/http/status/status.go | 2 +- 28 files changed, 44 insertions(+), 42 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index c8cc2f816..eeaf24273 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -43,7 +43,7 @@ example: ### Requirements description of the feature ### References