From 7758b261eaf466d1d5c1ec5317510d19ae7a32e6 Mon Sep 17 00:00:00 2001 From: MrLYC Date: Wed, 26 Oct 2022 13:51:30 +0800 Subject: [PATCH 1/3] feat: pass the client into operation --- core/bkapi/client.go | 4 +- core/bkapi/option_test.go | 5 +- core/define/operation.go | 6 ++ core/internal/client.go | 12 ++-- core/internal/client_test.go | 32 +-------- core/internal/mock/client.go | 41 ++--------- core/internal/mock/config.go | 54 ++------------ core/internal/mock/http.go | 18 +---- core/internal/mock/io.go | 11 --- core/internal/mock/logging.go | 41 ++--------- core/internal/mock/operation.go | 123 +++++++++++--------------------- core/internal/mock/provider.go | 27 +------ core/internal/operation.go | 18 ++++- core/internal/operation_test.go | 15 +++- core/internal/option_test.go | 4 +- 15 files changed, 113 insertions(+), 298 deletions(-) diff --git a/core/bkapi/client.go b/core/bkapi/client.go index 469b6dc..564046a 100644 --- a/core/bkapi/client.go +++ b/core/bkapi/client.go @@ -44,8 +44,8 @@ func NewBkApiClient( client := internal.NewBkApiClient( apiName, gentleman.New(), - func(name string, request *gentleman.Request) define.Operation { - return internal.NewOperation(name, request) + func(name string, client define.BkApiClient, request *gentleman.Request) define.Operation { + return internal.NewOperation(name, client, request) }, configProvider.ProvideConfig(apiName), ) diff --git a/core/bkapi/option_test.go b/core/bkapi/option_test.go index 053bd76..fac4f82 100644 --- a/core/bkapi/option_test.go +++ b/core/bkapi/option_test.go @@ -31,6 +31,7 @@ var _ = Describe("Option", func() { ctrl *gomock.Controller roundTripper *mock.MockRoundTripper operation *internal.Operation + bkapiClient *mock.MockBkApiClient requestError error ) @@ -48,7 +49,9 @@ var _ = Describe("Option", func() { request := gentleman.NewRequest() request.Use(transport.Set(roundTripper)) - operation = internal.NewOperation("testing", request) + bkapiClient = mock.NewMockBkApiClient(ctrl) + + operation = internal.NewOperation("testing", bkapiClient, request) }) AfterEach(func() { diff --git a/core/define/operation.go b/core/define/operation.go index efb5690..cc83b6d 100644 --- a/core/define/operation.go +++ b/core/define/operation.go @@ -21,9 +21,15 @@ import ( // Operation defines the operation of the API. type Operation interface { + // ClientName method returns the client's name. + ClientName() string + // Name method returns the operation's name. Name() string + // FullName method returns the operation's name. + FullName() string + // Apply method applies the given options to the operation. Apply(opts ...OperationOption) Operation diff --git a/core/internal/client.go b/core/internal/client.go index 8d41b01..c623f8f 100644 --- a/core/internal/client.go +++ b/core/internal/client.go @@ -24,6 +24,8 @@ import ( "gopkg.in/h2non/gentleman.v2/plugins/headers" ) +//go:generate mockgen -destination=../internal/mock/logging.go -package=mock github.com/TencentBlueKing/gopkg/logging Logger + // DefaultUserAgent : var DefaultUserAgent string @@ -33,7 +35,7 @@ type BkApiClient struct { logger logging.Logger client *gentleman.Client operationOptions []define.OperationOption - operationFactory func(name string, request *gentleman.Request) define.Operation + operationFactory func(name string, client define.BkApiClient, request *gentleman.Request) define.Operation } // Name returns the client name. @@ -99,10 +101,10 @@ func (cli *BkApiClient) newGentlemanRequest(config define.OperationConfig) *gent func (cli *BkApiClient) newOperationName(config define.OperationConfig) string { name := config.GetName() if name != "" { - return fmt.Sprintf("%s.%s", cli.Name(), name) + return name } - return fmt.Sprintf("%s(%s %s)", cli.Name(), config.GetMethod(), config.GetPath()) + return fmt.Sprintf("(%s %s)", config.GetMethod(), config.GetPath()) } func (cli *BkApiClient) applyOperationOptions(op define.Operation, opts ...define.OperationOption) { @@ -123,7 +125,7 @@ func (cli *BkApiClient) NewOperation( config := provider.ProvideConfig() request := cli.newGentlemanRequest(config) name := cli.newOperationName(config) - operation := cli.operationFactory(name, request) + operation := cli.operationFactory(name, cli, request) request.Use(plugin.NewResponsePlugin(func(c *context.Context, h context.Handler) { cli.logResponse(operation, c.Response) @@ -139,7 +141,7 @@ func (cli *BkApiClient) NewOperation( func NewBkApiClient( name string, client *gentleman.Client, - factory func(name string, request *gentleman.Request) define.Operation, + factory func(name string, client define.BkApiClient, request *gentleman.Request) define.Operation, config define.ClientConfig, ) *BkApiClient { diff --git a/core/internal/client_test.go b/core/internal/client_test.go index 64a3263..83e2f67 100644 --- a/core/internal/client_test.go +++ b/core/internal/client_test.go @@ -57,7 +57,7 @@ var _ = Describe("Client", func() { client = internal.NewBkApiClient( "testing", gentlemanClient, - func(name string, req *gentleman.Request) define.Operation { + func(name string, client define.BkApiClient, req *gentleman.Request) define.Operation { operation.EXPECT().Name().Return(name).AnyTimes() request = req @@ -150,34 +150,6 @@ var _ = Describe("Client", func() { Expect(op).NotTo(BeNil()) }) - It("should generate operation name by config.Name", func() { - operationConfig := mock.NewMockOperationConfig(ctrl) - operationConfigProvider := mock.NewMockOperationConfigProvider(ctrl) - operationConfigProvider.EXPECT().ProvideConfig().Return(operationConfig).AnyTimes() - - operationConfig.EXPECT().GetName().Return("operation").AnyTimes() - operationConfig.EXPECT().GetMethod().Return("GET").AnyTimes() - operationConfig.EXPECT().GetPath().Return("/test").AnyTimes() - - operation := client.NewOperation(operationConfigProvider) - - Expect(operation.Name()).To(Equal("testing.operation")) - }) - - It("should generate anonymous operation name", func() { - operationConfig := mock.NewMockOperationConfig(ctrl) - operationConfigProvider := mock.NewMockOperationConfigProvider(ctrl) - operationConfigProvider.EXPECT().ProvideConfig().Return(operationConfig).AnyTimes() - - operationConfig.EXPECT().GetName().Return("").AnyTimes() - operationConfig.EXPECT().GetMethod().Return("GET").AnyTimes() - operationConfig.EXPECT().GetPath().Return("/test").AnyTimes() - - operation := client.NewOperation(operationConfigProvider) - - Expect(operation.Name()).To(Equal("testing(GET /test)")) - }) - It("should set the user agent", func() { op := client.NewOperation(operationConfigProvider) Expect(op).To(Equal(operation)) @@ -206,7 +178,7 @@ var _ = Describe("Client", func() { client = internal.NewBkApiClient( "testing", gentlemanClient, - func(name string, req *gentleman.Request) define.Operation { + func(name string, client define.BkApiClient, req *gentleman.Request) define.Operation { operation.EXPECT().Name().Return(name).AnyTimes() request = req diff --git a/core/internal/mock/client.go b/core/internal/mock/client.go index e4da1d9..6aa7b51 100644 --- a/core/internal/mock/client.go +++ b/core/internal/mock/client.go @@ -1,14 +1,3 @@ -/** - * TencentBlueKing is pleased to support the open source community by - * making 蓝鲸智云-蓝鲸 PaaS 平台(BlueKing-PaaS) available. - * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://opensource.org/licenses/MIT - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - // Code generated by MockGen. DO NOT EDIT. // Source: client.go @@ -60,11 +49,7 @@ func (m *MockBkApiClient) AddOperationOptions(opts ...define.OperationOption) er // AddOperationOptions indicates an expected call of AddOperationOptions. func (mr *MockBkApiClientMockRecorder) AddOperationOptions(opts ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "AddOperationOptions", - reflect.TypeOf((*MockBkApiClient)(nil).AddOperationOptions), - opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddOperationOptions", reflect.TypeOf((*MockBkApiClient)(nil).AddOperationOptions), opts...) } // Apply mocks base method. @@ -82,11 +67,7 @@ func (m *MockBkApiClient) Apply(opts ...define.BkApiClientOption) error { // Apply indicates an expected call of Apply. func (mr *MockBkApiClientMockRecorder) Apply(opts ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "Apply", - reflect.TypeOf((*MockBkApiClient)(nil).Apply), - opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Apply", reflect.TypeOf((*MockBkApiClient)(nil).Apply), opts...) } // Name mocks base method. @@ -104,10 +85,7 @@ func (mr *MockBkApiClientMockRecorder) Name() *gomock.Call { } // NewOperation mocks base method. -func (m *MockBkApiClient) NewOperation( - config define.OperationConfigProvider, - opts ...define.OperationOption, -) define.Operation { +func (m *MockBkApiClient) NewOperation(config define.OperationConfigProvider, opts ...define.OperationOption) define.Operation { m.ctrl.T.Helper() varargs := []interface{}{config} for _, a := range opts { @@ -122,11 +100,7 @@ func (m *MockBkApiClient) NewOperation( func (mr *MockBkApiClientMockRecorder) NewOperation(config interface{}, opts ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{config}, opts...) - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "NewOperation", - reflect.TypeOf((*MockBkApiClient)(nil).NewOperation), - varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewOperation", reflect.TypeOf((*MockBkApiClient)(nil).NewOperation), varargs...) } // MockBkApiClientOption is a mock of BkApiClientOption interface. @@ -163,10 +137,5 @@ func (m *MockBkApiClientOption) ApplyToClient(client define.BkApiClient) error { // ApplyToClient indicates an expected call of ApplyToClient. func (mr *MockBkApiClientOptionMockRecorder) ApplyToClient(client interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "ApplyToClient", - reflect.TypeOf((*MockBkApiClientOption)(nil).ApplyToClient), - client, - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApplyToClient", reflect.TypeOf((*MockBkApiClientOption)(nil).ApplyToClient), client) } diff --git a/core/internal/mock/config.go b/core/internal/mock/config.go index 0425fd2..3745810 100644 --- a/core/internal/mock/config.go +++ b/core/internal/mock/config.go @@ -1,14 +1,3 @@ -/** - * TencentBlueKing is pleased to support the open source community by - * making 蓝鲸智云-蓝鲸 PaaS 平台(BlueKing-PaaS) available. - * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://opensource.org/licenses/MIT - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - // Code generated by MockGen. DO NOT EDIT. // Source: config.go @@ -57,11 +46,7 @@ func (m *MockClientConfig) GetAuthorizationHeaders() map[string]string { // GetAuthorizationHeaders indicates an expected call of GetAuthorizationHeaders. func (mr *MockClientConfigMockRecorder) GetAuthorizationHeaders() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "GetAuthorizationHeaders", - reflect.TypeOf((*MockClientConfig)(nil).GetAuthorizationHeaders), - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorizationHeaders", reflect.TypeOf((*MockClientConfig)(nil).GetAuthorizationHeaders)) } // GetLogger mocks base method. @@ -75,11 +60,7 @@ func (m *MockClientConfig) GetLogger() logging.Logger { // GetLogger indicates an expected call of GetLogger. func (mr *MockClientConfigMockRecorder) GetLogger() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "GetLogger", - reflect.TypeOf((*MockClientConfig)(nil).GetLogger), - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLogger", reflect.TypeOf((*MockClientConfig)(nil).GetLogger)) } // GetUrl mocks base method. @@ -130,12 +111,7 @@ func (m *MockClientConfigProvider) ProvideConfig(apiName string) define.ClientCo // ProvideConfig indicates an expected call of ProvideConfig. func (mr *MockClientConfigProviderMockRecorder) ProvideConfig(apiName interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "ProvideConfig", - reflect.TypeOf((*MockClientConfigProvider)(nil).ProvideConfig), - apiName, - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProvideConfig", reflect.TypeOf((*MockClientConfigProvider)(nil).ProvideConfig), apiName) } // MockOperationConfig is a mock of OperationConfig interface. @@ -172,11 +148,7 @@ func (m *MockOperationConfig) GetMethod() string { // GetMethod indicates an expected call of GetMethod. func (mr *MockOperationConfigMockRecorder) GetMethod() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "GetMethod", - reflect.TypeOf((*MockOperationConfig)(nil).GetMethod), - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMethod", reflect.TypeOf((*MockOperationConfig)(nil).GetMethod)) } // GetName mocks base method. @@ -190,11 +162,7 @@ func (m *MockOperationConfig) GetName() string { // GetName indicates an expected call of GetName. func (mr *MockOperationConfigMockRecorder) GetName() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "GetName", - reflect.TypeOf((*MockOperationConfig)(nil).GetName), - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetName", reflect.TypeOf((*MockOperationConfig)(nil).GetName)) } // GetPath mocks base method. @@ -208,11 +176,7 @@ func (m *MockOperationConfig) GetPath() string { // GetPath indicates an expected call of GetPath. func (mr *MockOperationConfigMockRecorder) GetPath() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "GetPath", - reflect.TypeOf((*MockOperationConfig)(nil).GetPath), - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPath", reflect.TypeOf((*MockOperationConfig)(nil).GetPath)) } // MockOperationConfigProvider is a mock of OperationConfigProvider interface. @@ -249,9 +213,5 @@ func (m *MockOperationConfigProvider) ProvideConfig() define.OperationConfig { // ProvideConfig indicates an expected call of ProvideConfig. func (mr *MockOperationConfigProviderMockRecorder) ProvideConfig() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "ProvideConfig", - reflect.TypeOf((*MockOperationConfigProvider)(nil).ProvideConfig), - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProvideConfig", reflect.TypeOf((*MockOperationConfigProvider)(nil).ProvideConfig)) } diff --git a/core/internal/mock/http.go b/core/internal/mock/http.go index 26068f3..4170ac5 100644 --- a/core/internal/mock/http.go +++ b/core/internal/mock/http.go @@ -1,14 +1,3 @@ -/** - * TencentBlueKing is pleased to support the open source community by - * making 蓝鲸智云-蓝鲸 PaaS 平台(BlueKing-PaaS) available. - * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://opensource.org/licenses/MIT - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - // Code generated by MockGen. DO NOT EDIT. // Source: net/http (interfaces: RoundTripper) @@ -57,10 +46,5 @@ func (m *MockRoundTripper) RoundTrip(arg0 *http.Request) (*http.Response, error) // RoundTrip indicates an expected call of RoundTrip. func (mr *MockRoundTripperMockRecorder) RoundTrip(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "RoundTrip", - reflect.TypeOf((*MockRoundTripper)(nil).RoundTrip), - arg0, - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RoundTrip", reflect.TypeOf((*MockRoundTripper)(nil).RoundTrip), arg0) } diff --git a/core/internal/mock/io.go b/core/internal/mock/io.go index 2c698ca..d16f447 100644 --- a/core/internal/mock/io.go +++ b/core/internal/mock/io.go @@ -1,14 +1,3 @@ -/** - * TencentBlueKing is pleased to support the open source community by - * making 蓝鲸智云-蓝鲸 PaaS 平台(BlueKing-PaaS) available. - * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://opensource.org/licenses/MIT - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - // Code generated by MockGen. DO NOT EDIT. // Source: io (interfaces: ReadCloser) diff --git a/core/internal/mock/logging.go b/core/internal/mock/logging.go index 8e5d431..f691c48 100644 --- a/core/internal/mock/logging.go +++ b/core/internal/mock/logging.go @@ -1,14 +1,3 @@ -/** - * TencentBlueKing is pleased to support the open source community by - * making 蓝鲸智云-蓝鲸 PaaS 平台(BlueKing-PaaS) available. - * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://opensource.org/licenses/MIT - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/TencentBlueKing/gopkg/logging (interfaces: Logger) @@ -76,11 +65,7 @@ func (m *MockLogger) DebugContext(arg0 context.Context, arg1 string, arg2 ...map func (mr *MockLoggerMockRecorder) DebugContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "DebugContext", - reflect.TypeOf((*MockLogger)(nil).DebugContext), - varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DebugContext", reflect.TypeOf((*MockLogger)(nil).DebugContext), varargs...) } // Error mocks base method. @@ -114,11 +99,7 @@ func (m *MockLogger) ErrorContext(arg0 context.Context, arg1 string, arg2 ...map func (mr *MockLoggerMockRecorder) ErrorContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "ErrorContext", - reflect.TypeOf((*MockLogger)(nil).ErrorContext), - varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ErrorContext", reflect.TypeOf((*MockLogger)(nil).ErrorContext), varargs...) } // Info mocks base method. @@ -152,11 +133,7 @@ func (m *MockLogger) InfoContext(arg0 context.Context, arg1 string, arg2 ...map[ func (mr *MockLoggerMockRecorder) InfoContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "InfoContext", - reflect.TypeOf((*MockLogger)(nil).InfoContext), - varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InfoContext", reflect.TypeOf((*MockLogger)(nil).InfoContext), varargs...) } // Trace mocks base method. @@ -190,11 +167,7 @@ func (m *MockLogger) TraceContext(arg0 context.Context, arg1 string, arg2 ...map func (mr *MockLoggerMockRecorder) TraceContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "TraceContext", - reflect.TypeOf((*MockLogger)(nil).TraceContext), - varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TraceContext", reflect.TypeOf((*MockLogger)(nil).TraceContext), varargs...) } // Warn mocks base method. @@ -228,9 +201,5 @@ func (m *MockLogger) WarnContext(arg0 context.Context, arg1 string, arg2 ...map[ func (mr *MockLoggerMockRecorder) WarnContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "WarnContext", - reflect.TypeOf((*MockLogger)(nil).WarnContext), - varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WarnContext", reflect.TypeOf((*MockLogger)(nil).WarnContext), varargs...) } diff --git a/core/internal/mock/operation.go b/core/internal/mock/operation.go index 29dd7a8..a395f95 100644 --- a/core/internal/mock/operation.go +++ b/core/internal/mock/operation.go @@ -1,14 +1,3 @@ -/** - * TencentBlueKing is pleased to support the open source community by - * making 蓝鲸智云-蓝鲸 PaaS 平台(BlueKing-PaaS) available. - * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://opensource.org/licenses/MIT - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - // Code generated by MockGen. DO NOT EDIT. // Source: operation.go @@ -66,6 +55,34 @@ func (mr *MockOperationMockRecorder) Apply(opts ...interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Apply", reflect.TypeOf((*MockOperation)(nil).Apply), opts...) } +// ClientName mocks base method. +func (m *MockOperation) ClientName() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ClientName") + ret0, _ := ret[0].(string) + return ret0 +} + +// ClientName indicates an expected call of ClientName. +func (mr *MockOperationMockRecorder) ClientName() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientName", reflect.TypeOf((*MockOperation)(nil).ClientName)) +} + +// FullName mocks base method. +func (m *MockOperation) FullName() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FullName") + ret0, _ := ret[0].(string) + return ret0 +} + +// FullName indicates an expected call of FullName. +func (mr *MockOperationMockRecorder) FullName() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FullName", reflect.TypeOf((*MockOperation)(nil).FullName)) +} + // Name mocks base method. func (m *MockOperation) Name() string { m.ctrl.T.Helper() @@ -106,12 +123,7 @@ func (m *MockOperation) SetBody(data interface{}) define.Operation { // SetBody indicates an expected call of SetBody. func (mr *MockOperationMockRecorder) SetBody(data interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "SetBody", - reflect.TypeOf((*MockOperation)(nil).SetBody), - data, - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetBody", reflect.TypeOf((*MockOperation)(nil).SetBody), data) } // SetBodyProvider mocks base method. @@ -125,12 +137,7 @@ func (m *MockOperation) SetBodyProvider(provider define.BodyProvider) define.Ope // SetBodyProvider indicates an expected call of SetBodyProvider. func (mr *MockOperationMockRecorder) SetBodyProvider(provider interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "SetBodyProvider", - reflect.TypeOf((*MockOperation)(nil).SetBodyProvider), - provider, - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetBodyProvider", reflect.TypeOf((*MockOperation)(nil).SetBodyProvider), provider) } // SetBodyReader mocks base method. @@ -144,12 +151,7 @@ func (m *MockOperation) SetBodyReader(body io.Reader) define.Operation { // SetBodyReader indicates an expected call of SetBodyReader. func (mr *MockOperationMockRecorder) SetBodyReader(body interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "SetBodyReader", - reflect.TypeOf((*MockOperation)(nil).SetBodyReader), - body, - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetBodyReader", reflect.TypeOf((*MockOperation)(nil).SetBodyReader), body) } // SetContentLength mocks base method. @@ -163,12 +165,7 @@ func (m *MockOperation) SetContentLength(contentLength int64) define.Operation { // SetContentLength indicates an expected call of SetContentLength. func (mr *MockOperationMockRecorder) SetContentLength(contentLength interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "SetContentLength", - reflect.TypeOf((*MockOperation)(nil).SetContentLength), - contentLength, - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetContentLength", reflect.TypeOf((*MockOperation)(nil).SetContentLength), contentLength) } // SetContentType mocks base method. @@ -182,12 +179,7 @@ func (m *MockOperation) SetContentType(contentType string) define.Operation { // SetContentType indicates an expected call of SetContentType. func (mr *MockOperationMockRecorder) SetContentType(contentType interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "SetContentType", - reflect.TypeOf((*MockOperation)(nil).SetContentType), - contentType, - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetContentType", reflect.TypeOf((*MockOperation)(nil).SetContentType), contentType) } // SetContext mocks base method. @@ -201,12 +193,7 @@ func (m *MockOperation) SetContext(ctx context.Context) define.Operation { // SetContext indicates an expected call of SetContext. func (mr *MockOperationMockRecorder) SetContext(ctx interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "SetContext", - reflect.TypeOf((*MockOperation)(nil).SetContext), - ctx, - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetContext", reflect.TypeOf((*MockOperation)(nil).SetContext), ctx) } // SetHeaders mocks base method. @@ -220,12 +207,7 @@ func (m *MockOperation) SetHeaders(headers map[string]string) define.Operation { // SetHeaders indicates an expected call of SetHeaders. func (mr *MockOperationMockRecorder) SetHeaders(headers interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "SetHeaders", - reflect.TypeOf((*MockOperation)(nil).SetHeaders), - headers, - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeaders", reflect.TypeOf((*MockOperation)(nil).SetHeaders), headers) } // SetPathParams mocks base method. @@ -239,12 +221,7 @@ func (m *MockOperation) SetPathParams(params map[string]string) define.Operation // SetPathParams indicates an expected call of SetPathParams. func (mr *MockOperationMockRecorder) SetPathParams(params interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "SetPathParams", - reflect.TypeOf((*MockOperation)(nil).SetPathParams), - params, - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPathParams", reflect.TypeOf((*MockOperation)(nil).SetPathParams), params) } // SetQueryParams mocks base method. @@ -258,12 +235,7 @@ func (m *MockOperation) SetQueryParams(params map[string]string) define.Operatio // SetQueryParams indicates an expected call of SetQueryParams. func (mr *MockOperationMockRecorder) SetQueryParams(params interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "SetQueryParams", - reflect.TypeOf((*MockOperation)(nil).SetQueryParams), - params, - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetQueryParams", reflect.TypeOf((*MockOperation)(nil).SetQueryParams), params) } // SetResult mocks base method. @@ -277,12 +249,7 @@ func (m *MockOperation) SetResult(result interface{}) define.Operation { // SetResult indicates an expected call of SetResult. func (mr *MockOperationMockRecorder) SetResult(result interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "SetResult", - reflect.TypeOf((*MockOperation)(nil).SetResult), - result, - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetResult", reflect.TypeOf((*MockOperation)(nil).SetResult), result) } // SetResultProvider mocks base method. @@ -296,12 +263,7 @@ func (m *MockOperation) SetResultProvider(provider define.ResultProvider) define // SetResultProvider indicates an expected call of SetResultProvider. func (mr *MockOperationMockRecorder) SetResultProvider(provider interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "SetResultProvider", - reflect.TypeOf((*MockOperation)(nil).SetResultProvider), - provider, - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetResultProvider", reflect.TypeOf((*MockOperation)(nil).SetResultProvider), provider) } // MockOperationOption is a mock of OperationOption interface. @@ -338,10 +300,5 @@ func (m *MockOperationOption) ApplyToOperation(operation define.Operation) error // ApplyToOperation indicates an expected call of ApplyToOperation. func (mr *MockOperationOptionMockRecorder) ApplyToOperation(operation interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "ApplyToOperation", - reflect.TypeOf((*MockOperationOption)(nil).ApplyToOperation), - operation, - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApplyToOperation", reflect.TypeOf((*MockOperationOption)(nil).ApplyToOperation), operation) } diff --git a/core/internal/mock/provider.go b/core/internal/mock/provider.go index 55bdca6..9d23735 100644 --- a/core/internal/mock/provider.go +++ b/core/internal/mock/provider.go @@ -1,14 +1,3 @@ -/** - * TencentBlueKing is pleased to support the open source community by - * making 蓝鲸智云-蓝鲸 PaaS 平台(BlueKing-PaaS) available. - * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://opensource.org/licenses/MIT - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - // Code generated by MockGen. DO NOT EDIT. // Source: provider.go @@ -57,13 +46,7 @@ func (m *MockBodyProvider) ProvideBody(operation define.Operation, data interfac // ProvideBody indicates an expected call of ProvideBody. func (mr *MockBodyProviderMockRecorder) ProvideBody(operation, data interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "ProvideBody", - reflect.TypeOf((*MockBodyProvider)(nil).ProvideBody), - operation, - data, - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProvideBody", reflect.TypeOf((*MockBodyProvider)(nil).ProvideBody), operation, data) } // MockResultProvider is a mock of ResultProvider interface. @@ -100,11 +83,5 @@ func (m *MockResultProvider) ProvideResult(response *http.Response, result inter // ProvideResult indicates an expected call of ProvideResult. func (mr *MockResultProviderMockRecorder) ProvideResult(response, result interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType( - mr.mock, - "ProvideResult", - reflect.TypeOf((*MockResultProvider)(nil).ProvideResult), - response, - result, - ) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProvideResult", reflect.TypeOf((*MockResultProvider)(nil).ProvideResult), response, result) } diff --git a/core/internal/operation.go b/core/internal/operation.go index 5c36c3b..0f5012c 100644 --- a/core/internal/operation.go +++ b/core/internal/operation.go @@ -14,6 +14,7 @@ package internal import ( "bytes" "context" + "fmt" "io" "io/ioutil" "net/http" @@ -34,6 +35,7 @@ type Operation struct { result interface{} resultProvider define.ResultProvider request *gentleman.Request + client define.BkApiClient } // Name returns the operation name. @@ -41,9 +43,20 @@ func (op *Operation) Name() string { return op.name } +// ClientName returns the client name. +func (op *Operation) ClientName() string { + return op.client.Name() +} + +// FullName returns the operation name. +func (op *Operation) FullName() string { + // .. + return fmt.Sprintf("%s.api.%s", op.ClientName(), op.name) +} + // String returns the operation name. func (op *Operation) String() string { - return op.name + return fmt.Sprintf("%s %s", op.ClientName(), op.name) } // GetError returns the operation error. @@ -217,10 +230,11 @@ func (op *Operation) Request() (*http.Response, error) { } // NewOperation creates a new operation. -func NewOperation(name string, request *gentleman.Request) *Operation { +func NewOperation(name string, client define.BkApiClient, request *gentleman.Request) *Operation { return &Operation{ name: name, request: request, + client: client, } } diff --git a/core/internal/operation_test.go b/core/internal/operation_test.go index 463f944..16efd86 100644 --- a/core/internal/operation_test.go +++ b/core/internal/operation_test.go @@ -39,6 +39,7 @@ var _ = Describe("operation", func() { client *gentleman.Client response *http.Response operation *internal.Operation + bkapiClient *mock.MockBkApiClient ) BeforeEach(func() { @@ -50,8 +51,10 @@ var _ = Describe("operation", func() { response = &http.Response{} + bkapiClient = mock.NewMockBkApiClient(ctrl) + request := client.Request() - operation = internal.NewOperation("test", request) + operation = internal.NewOperation("test", bkapiClient, request) }) AfterEach(func() { @@ -65,6 +68,14 @@ var _ = Describe("operation", func() { }) } + It("should return correct names", func() { + bkapiClient.EXPECT().Name().Return("client").AnyTimes() + + Expect(operation.Name()).To(Equal("test")) + Expect(operation.FullName()).To(Equal("client.api.test")) + Expect(fmt.Sprintf("%v", operation)).To(Equal("client test")) + }) + It("should fail on apply", func() { option := mock.NewMockOperationOption(ctrl) option.EXPECT().ApplyToOperation(gomock.Any()).Return(errors.New("test")) @@ -114,7 +125,7 @@ var _ = Describe("operation", func() { mockTransportRoundTrip() request := client.Request().Path("/hello/{name}") - operation = internal.NewOperation("test", request) + operation = internal.NewOperation("test", bkapiClient, request) response, err := operation. SetPathParams(map[string]string{ diff --git a/core/internal/option_test.go b/core/internal/option_test.go index e14ce78..cd9951d 100644 --- a/core/internal/option_test.go +++ b/core/internal/option_test.go @@ -28,6 +28,7 @@ var _ = Describe("Option", func() { option *internal.PluginOption pluginA, pluginB *mock.MockPlugin client *gentleman.Client + bkapiClient *mock.MockBkApiClient ) BeforeEach(func() { @@ -36,6 +37,7 @@ var _ = Describe("Option", func() { pluginB = mock.NewMockPlugin(ctrl) option = internal.NewPluginOption(pluginA, pluginB) client = gentleman.New() + bkapiClient = mock.NewMockBkApiClient(ctrl) }) AfterEach(func() { @@ -44,7 +46,7 @@ var _ = Describe("Option", func() { It("should apply to operation", func() { request := client.Request() - operation := internal.NewOperation("", request) + operation := internal.NewOperation("", bkapiClient, request) operation.Apply(option) Expect(operation.GetError()).To(BeNil()) From 596975c1dc31e1e54b73cae5b0178fc16b69de66 Mon Sep 17 00:00:00 2001 From: MrLYC Date: Wed, 26 Oct 2022 17:35:31 +0800 Subject: [PATCH 2/3] feat: add prometheus plugin --- core/bkapi/client.go | 34 +- core/define/errors.go | 9 +- core/internal/operation.go | 5 + core/prometheus/plugin.go | 227 +++++++++++++ core/prometheus/plugin_test.go | 243 ++++++++++++++ core/prometheus/prometheus_suite_test.go | 24 ++ go.mod | 26 +- go.sum | 398 ++++++++++++++++++++++- 8 files changed, 937 insertions(+), 29 deletions(-) create mode 100644 core/prometheus/plugin.go create mode 100644 core/prometheus/plugin_test.go create mode 100644 core/prometheus/prometheus_suite_test.go diff --git a/core/bkapi/client.go b/core/bkapi/client.go index 564046a..94885c0 100644 --- a/core/bkapi/client.go +++ b/core/bkapi/client.go @@ -23,23 +23,20 @@ import ( "gopkg.in/h2non/gentleman.v2" ) -func newGentlemanClient(config define.ClientConfig) *gentleman.Client { - client := gentleman.New(). - URL(config.GetUrl()) +// the common options for all bkapi clients +var globalBkapiClientOptions []define.BkApiClientOption - headers := config.GetAuthorizationHeaders() - if len(headers) > 0 { - client.SetHeaders(headers) - } - - return client +// RegisterGlobalBkapiClientOption use to register a global bkapi client option. +// Warning: this function is not safe for concurrent access. +func RegisterGlobalBkapiClientOption(opt define.BkApiClientOption) { + globalBkapiClientOptions = append(globalBkapiClientOptions, opt) } // NewBkApiClient creates a new BkApiClient. func NewBkApiClient( apiName string, configProvider define.ClientConfigProvider, - opts ...define.BkApiClientOption, + options ...define.BkApiClientOption, ) (define.BkApiClient, error) { client := internal.NewBkApiClient( apiName, @@ -50,13 +47,18 @@ func NewBkApiClient( configProvider.ProvideConfig(apiName), ) - if len(opts) == 0 { - return client, nil - } + for phase, opts := range map[string][]define.BkApiClientOption{ + "global": globalBkapiClientOptions, + "client": options, + } { + if len(opts) == 0 { + continue + } - err := client.Apply(opts...) - if err != nil { - return nil, define.ErrorWrapf(err, "failed to apply options to client %s", apiName) + err := client.Apply(opts...) + if err != nil { + return nil, define.ErrorWrapf(err, "failed to apply options to client %s, phase %s", apiName, phase) + } } return client, nil diff --git a/core/define/errors.go b/core/define/errors.go index 74cf2be..7001ad8 100644 --- a/core/define/errors.go +++ b/core/define/errors.go @@ -24,8 +24,13 @@ var ( ErrBkApiRequest = errors.New("bkapi request error") ) -// ErrorWrapf annotates err with the format specifier and arguments. -var ErrorWrapf = pkgErrors.WithMessagef +// +var ( + // ErrorWrapf annotates err with the format specifier and arguments. + ErrorWrapf = pkgErrors.WithMessagef + // ErrorCause returns the underlying cause of the error, if possible. + ErrorCause = pkgErrors.Cause +) // EnableStackTraceErrorWrapf enables stack trace for ErrorWrapf. func EnableStackTraceErrorWrapf() { diff --git a/core/internal/operation.go b/core/internal/operation.go index 0f5012c..85185f6 100644 --- a/core/internal/operation.go +++ b/core/internal/operation.go @@ -266,3 +266,8 @@ func NewOperationOption(fn func(operation *Operation) error) *OperationOption { fn: fn, } } + +// GetOperationRawRequest return the underlying raw request +func GetOperationRawRequest(op *Operation) *gentleman.Request { + return op.request +} diff --git a/core/prometheus/plugin.go b/core/prometheus/plugin.go new file mode 100644 index 0000000..3426e0d --- /dev/null +++ b/core/prometheus/plugin.go @@ -0,0 +1,227 @@ +/** + * TencentBlueKing is pleased to support the open source community by + * making 蓝鲸智云-蓝鲸 PaaS 平台(BlueKing-PaaS) available. + * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at http://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package prometheus + +import ( + "strconv" + "sync" + "time" + + "github.com/TencentBlueKing/bk-apigateway-sdks/core/bkapi" + "github.com/TencentBlueKing/bk-apigateway-sdks/core/define" + "github.com/TencentBlueKing/bk-apigateway-sdks/core/internal" + "github.com/prometheus/client_golang/prometheus" + "gopkg.in/h2non/gentleman.v2/context" +) + +// PrometheusOptions for common prometheus metrics options +type PrometheusOptions struct { + Namespace string + Subsystem string + ConstLabels prometheus.Labels + DurationBuckets []float64 + BytesBuckets []float64 + Registerer prometheus.Registerer +} + +type bkapiCollector struct { + *internal.OperationOption + metricRequestsDurationSeconds *prometheus.HistogramVec + metricRequestsBodyBytes *prometheus.HistogramVec + metricResponsesBodyBytes *prometheus.HistogramVec + metricResponsesTotal *prometheus.CounterVec + metricResponsesFailuresTotal *prometheus.CounterVec +} + +func (c *bkapiCollector) init(opt PrometheusOptions) { + c.OperationOption = internal.NewOperationOption(c.collectMetrics) + + registerer := opt.Registerer + + c.metricRequestsDurationSeconds = prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Namespace: opt.Namespace, + Subsystem: opt.Subsystem, + ConstLabels: opt.ConstLabels, + Buckets: opt.DurationBuckets, + Name: "bkapi_requests_duration_seconds", + Help: "Histogram of requests duration by operation, method", + }, []string{"operation", "method"}, + ) + registerer.MustRegister(c.metricRequestsDurationSeconds) + + c.metricRequestsBodyBytes = prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Namespace: opt.Namespace, + Subsystem: opt.Subsystem, + ConstLabels: opt.ConstLabels, + Buckets: opt.BytesBuckets, + Name: "bkapi_requests_body_bytes", + Help: "Histogram of requests body bytes by operation, method", + }, []string{"operation", "method"}, + ) + registerer.MustRegister(c.metricRequestsBodyBytes) + + c.metricResponsesBodyBytes = prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Namespace: opt.Namespace, + Subsystem: opt.Subsystem, + ConstLabels: opt.ConstLabels, + Buckets: opt.BytesBuckets, + Name: "bkapi_responses_body_bytes", + Help: "Histogram of responses body bytes by operation, method", + }, []string{"operation", "method"}, + ) + registerer.MustRegister(c.metricResponsesBodyBytes) + + c.metricResponsesTotal = prometheus.NewCounterVec( + prometheus.CounterOpts{ + Namespace: opt.Namespace, + Subsystem: opt.Subsystem, + ConstLabels: opt.ConstLabels, + Name: "bkapi_responses_total", + Help: "Count of responses by operation, method, status", + }, []string{"operation", "method", "status"}, + ) + registerer.MustRegister(c.metricResponsesTotal) + + c.metricResponsesFailuresTotal = prometheus.NewCounterVec( + prometheus.CounterOpts{ + Namespace: opt.Namespace, + Subsystem: opt.Subsystem, + ConstLabels: opt.ConstLabels, + Name: "bkapi_failures_total", + Help: "Count of failures by operation, method", + }, []string{"operation", "method", "error"}, + ) + registerer.MustRegister(c.metricResponsesFailuresTotal) +} + +func (c *bkapiCollector) collectMetrics(operation *internal.Operation) error { + var ( + requestStart time.Time + name = operation.FullName() + request = internal.GetOperationRawRequest(operation) + ) + + request.UseHandler("before dial", func(ctx *context.Context, h context.Handler) { + requestStart = time.Now() + h.Next(ctx) + }) + + request.UseHandler("after dial", func(ctx *context.Context, h context.Handler) { + requestEnd := time.Now() + defer h.Next(ctx) + + method := ctx.Request.Method + status := strconv.Itoa(ctx.Response.StatusCode) + c.metricResponsesTotal.WithLabelValues(name, method, status).Inc() + + if !requestStart.IsZero() { + c.metricRequestsDurationSeconds.WithLabelValues(name, method). + Observe(requestEnd.Sub(requestStart).Seconds()) + } + + requestContentLength, err := strconv.ParseFloat(ctx.Request.Header.Get("Content-Length"), 64) + if err == nil { + c.metricRequestsBodyBytes.WithLabelValues(name, method).Observe(requestContentLength) + } + + responseContentLength, err := strconv.ParseFloat(ctx.Response.Header.Get("Content-Length"), 64) + if err == nil { + c.metricResponsesBodyBytes.WithLabelValues(name, method).Observe(responseContentLength) + } + }) + + request.UseHandler("error", func(ctx *context.Context, h context.Handler) { + defer h.Next(ctx) + + cause := define.ErrorCause(ctx.Error) + if cause == nil { + return + } + + c.metricResponsesFailuresTotal.WithLabelValues(name, ctx.Request.Method, cause.Error()).Inc() + }) + + return nil +} + +func initCollector(collector *bkapiCollector, opt PrometheusOptions) { + if opt.DurationBuckets == nil { + opt.DurationBuckets = []float64{ + 1, + 5, + 10, + 50, + 100, + 500, + 1024, // 1k + 5120, // 5k + 10240, // 10k + 51200, // 50k + 102400, // 100k + 512000, // 500k + 1048576, // 1m + 5242880, // 5m + 10485760, // 10m + 52428800, // 50m + 104857600, // 100m + 524288000, // 500m + 1073741824, // 1g + } + } + + if opt.BytesBuckets == nil { + opt.BytesBuckets = []float64{ + 0.1, + 0.25, + 0.5, + 0.75, + 1.0, + 2.5, + 5.0, + 7.5, + 10.0, + 25.0, + 50.0, + 75.0, + 100.0, + 250.0, + 500.0, + 750.0, + } + } + + if opt.Registerer == nil { + opt.Registerer = prometheus.DefaultRegisterer + } + + collector.init(opt) +} + +var ( + initOnce sync.Once + globalBkapiCollector bkapiCollector +) + +// Enable prometheus metrics +func Enable(opt PrometheusOptions) (ok bool) { + initOnce.Do(func() { + initCollector(&globalBkapiCollector, opt) + bkapi.RegisterGlobalBkapiClientOption(globalBkapiCollector) + + ok = true + }) + + return ok +} diff --git a/core/prometheus/plugin_test.go b/core/prometheus/plugin_test.go new file mode 100644 index 0000000..7e211a1 --- /dev/null +++ b/core/prometheus/plugin_test.go @@ -0,0 +1,243 @@ +/** + * TencentBlueKing is pleased to support the open source community by + * making 蓝鲸智云-蓝鲸 PaaS 平台(BlueKing-PaaS) available. + * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at http://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package prometheus + +import ( + "fmt" + "net/http" + "strconv" + + "github.com/TencentBlueKing/bk-apigateway-sdks/core/bkapi" + "github.com/TencentBlueKing/bk-apigateway-sdks/core/define" + "github.com/TencentBlueKing/bk-apigateway-sdks/core/internal/mock" + "github.com/golang/mock/gomock" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "github.com/prometheus/client_golang/prometheus" + io_prometheus_client "github.com/prometheus/client_model/go" +) + +var _ = Describe("Plugin", func() { + var ( + ctrl *gomock.Controller + mockTransport *mock.MockRoundTripper + response *http.Response + requestError error + registry *prometheus.Registry + collector *bkapiCollector + client define.BkApiClient + apiName = "testing" + operationName string + clientConfig bkapi.ClientConfig + operationConfig bkapi.OperationConfig + ) + + BeforeEach(func() { + ctrl = gomock.NewController(GinkgoT()) + mockTransport = mock.NewMockRoundTripper(ctrl) + requestError = nil + response = &http.Response{ + StatusCode: 200, + Header: http.Header{}, + } + + collector = &bkapiCollector{} + registry = prometheus.NewRegistry() + initCollector(collector, PrometheusOptions{ + Registerer: registry, + }) + + operationConfig = bkapi.OperationConfig{ + Name: "demo", + Method: "POST", + Path: "/api/v1/demo", + } + + clientConfig = bkapi.ClientConfig{ + Endpoint: "http://example.com", + } + var err error + client, err = bkapi.NewBkApiClient(apiName, clientConfig, collector, bkapi.OptTransport(mockTransport)) + Expect(err).To(BeNil()) + + operationName = fmt.Sprintf("%s.api.%s", client.Name(), operationConfig.Name) + }) + + AfterEach(func() { + ctrl.Finish() + }) + + mockRequest := func() { + mockTransport.EXPECT().RoundTrip(gomock.Any()).DoAndReturn(func(req *http.Request) (*http.Response, error) { + response.Request = req + + return response, requestError + }) + } + + gatherMetric := func(metricName string, labels map[string]string) *io_prometheus_client.Metric { + results, err := registry.Gather() + Expect(err).To(BeNil()) + + for _, result := range results { + if *result.Name != metricName { + continue + } + + outer: + for _, metric := range result.Metric { + for _, label := range metric.Label { + value, ok := labels[*label.Name] + if !ok { + continue + } + + if value != *label.Value { + break outer + } + } + + return metric + } + } + + return nil + } + + Context("bkapi_requests_duration_seconds", func() { + It("should record when success", func() { + mockRequest() + _, err := client.NewOperation(operationConfig).Request() + Expect(err).To(BeNil()) + + metric := gatherMetric("bkapi_requests_duration_seconds", map[string]string{ + "operation": operationName, + "method": operationConfig.Method, + }) + Expect(metric).NotTo(BeNil()) + }) + + It("should not record when error", func() { + requestError = fmt.Errorf("testing") + + mockRequest() + _, err := client.NewOperation(operationConfig).Request() + Expect(err).NotTo(BeNil()) + + metric := gatherMetric("bkapi_requests_duration_seconds", map[string]string{ + "operation": operationName, + "method": operationConfig.Method, + }) + Expect(metric).To(BeNil()) + }) + }) + + Context("bkapi_responses_total", func() { + DescribeTable("should record when success", func(statusCode int) { + response.StatusCode = statusCode + mockRequest() + response, err := client.NewOperation(operationConfig).Request() + Expect(err).To(BeNil()) + + metric := gatherMetric("bkapi_responses_total", map[string]string{ + "operation": operationName, + "method": operationConfig.Method, + "status": strconv.Itoa(response.StatusCode), + }) + Expect(metric).NotTo(BeNil()) + }, + Entry("200", 200), + Entry("400", 400), + Entry("500", 500), + ) + + It("should not record when error", func() { + requestError = fmt.Errorf("testing") + + mockRequest() + _, err := client.NewOperation(operationConfig).Request() + Expect(err).NotTo(BeNil()) + + metric := gatherMetric("bkapi_responses_total", map[string]string{ + "operation": operationName, + "method": operationConfig.Method, + "status": strconv.Itoa(response.StatusCode), + }) + Expect(metric).To(BeNil()) + }) + }) + + Context("bkapi_failures_total", func() { + DescribeTable("should not record when success", func(statusCode int) { + response.StatusCode = statusCode + mockRequest() + _, err := client.NewOperation(operationConfig).Request() + Expect(err).To(BeNil()) + + metric := gatherMetric("bkapi_failures_total", map[string]string{ + "operation": operationName, + "method": operationConfig.Method, + }) + Expect(metric).To(BeNil()) + }, + Entry("200", 200), + Entry("400", 400), + Entry("500", 500), + ) + + It("should record when error", func() { + requestError = fmt.Errorf("testing") + + mockRequest() + _, err := client.NewOperation(operationConfig).Request() + Expect(err).NotTo(BeNil()) + + metric := gatherMetric("bkapi_failures_total", map[string]string{ + "operation": operationName, + "method": operationConfig.Method, + }) + Expect(metric).NotTo(BeNil()) + }) + }) + + Context("bkapi_requests_body_bytes", func() { + It("should record when contain Content-Length header", func() { + mockRequest() + _, err := client.NewOperation(operationConfig). + SetHeaders(map[string]string{"Content-Length": "1024"}). + Request() + Expect(err).To(BeNil()) + + metric := gatherMetric("bkapi_requests_body_bytes", map[string]string{ + "operation": operationName, + "method": operationConfig.Method, + }) + Expect(metric).NotTo(BeNil()) + }) + }) + + Context("bkapi_responses_body_bytes", func() { + It("should record when contain Content-Length header", func() { + response.Header.Add("Content-Length", "1024") + + mockRequest() + _, err := client.NewOperation(operationConfig).Request() + Expect(err).To(BeNil()) + + metric := gatherMetric("bkapi_responses_body_bytes", map[string]string{ + "operation": operationName, + "method": operationConfig.Method, + }) + Expect(metric).NotTo(BeNil()) + }) + }) +}) diff --git a/core/prometheus/prometheus_suite_test.go b/core/prometheus/prometheus_suite_test.go new file mode 100644 index 0000000..58c9a7f --- /dev/null +++ b/core/prometheus/prometheus_suite_test.go @@ -0,0 +1,24 @@ +/** + * TencentBlueKing is pleased to support the open source community by + * making 蓝鲸智云-蓝鲸 PaaS 平台(BlueKing-PaaS) available. + * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at http://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package prometheus + +import ( + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestPrometheus(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Prometheus Suite") +} diff --git a/go.mod b/go.mod index b115f60..2396ed1 100644 --- a/go.mod +++ b/go.mod @@ -7,18 +7,30 @@ require ( github.com/flosch/pongo2/v5 v5.0.0 github.com/golang-jwt/jwt/v4 v4.3.0 github.com/golang/mock v1.6.0 - github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect github.com/onsi/ginkgo/v2 v2.1.3 github.com/onsi/gomega v1.18.1 - github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pkg/errors v0.9.1 - golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect - golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect - golang.org/x/text v0.3.7 // indirect + github.com/prometheus/client_golang v1.13.0 + github.com/prometheus/client_model v0.2.0 gopkg.in/h2non/gentleman.v2 v2.0.5 gopkg.in/h2non/gock.v1 v1.1.2 - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b +) + +require ( + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect + github.com/prometheus/common v0.37.0 // indirect + github.com/prometheus/procfs v0.8.0 // indirect + golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect + golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/protobuf v1.28.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect logur.dev/logur v0.17.0 // indirect ) diff --git a/go.sum b/go.sum index 13f5e18..6d066c0 100644 --- a/go.sum +++ b/go.sum @@ -1,49 +1,177 @@ +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 v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 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/TencentBlueKing/gopkg v1.0.9 h1:23kSBaLyFaK4aUgmQUD6NW1x/6jn7UDiW3CQMdjLXTw= github.com/TencentBlueKing/gopkg v1.0.9/go.mod h1:C8xV79ap0bF2pR10YfhsxO5w5LtJlPakrRunkRbl2yw= +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/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 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +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/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +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/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/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/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/flosch/pongo2/v5 v5.0.0 h1:ZauMp+iPZzh2aI1QM2UwRb0lXD4BoFcvBuWqefkIuq0= github.com/flosch/pongo2/v5 v5.0.0/go.mod h1:6ysKu++8ANFXmc3x6uA6iVaS+PKUoDfdX3yPcv8TIzY= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +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-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +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-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/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/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= 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.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= 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.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +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/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.4.1/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.1/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.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +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/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +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/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +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/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= +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/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +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/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +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/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 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.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/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 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/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +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/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +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/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -62,97 +190,348 @@ github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= +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/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.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= +github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= +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 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +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.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +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.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +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/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= 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 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 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/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.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= +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-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-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/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/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +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-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/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.1.1-0.20191107180719-034126e5016b/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-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-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-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-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/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-20200222125558-5a598a2470a0/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-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/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-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +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-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= 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-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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/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-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= +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-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +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-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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-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-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-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/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-20200803210538-64077c9b5642/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-20210112080510-489259a85091/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-20210423082822-04245dca01da/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-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/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.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +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-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/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-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-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-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/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-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/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/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/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +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/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +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-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +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.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= 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.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +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 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +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= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= @@ -162,17 +541,28 @@ gopkg.in/h2non/gentleman.v2 v2.0.5/go.mod h1:A1c7zwrTgAyyf6AbpvVksYtBayTB4STBUGm gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +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.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.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 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 h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/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= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= logur.dev/adapter/logrus v0.5.0/go.mod h1:9VKOXYYAQU3gjKJj1gs4jwr+YtDlGHGRVJ4tVAWeRhQ= logur.dev/adapter/zap v0.5.0/go.mod h1:fpjTeoSkN05hrUviBkIe/u0CKWTh1PBxWQLLFgnWhUA= logur.dev/logur v0.16.1/go.mod h1:DyA5B+b6WjjCcnpE1+HGtTLh2lXooxRq+JmAwXMRK08= logur.dev/logur v0.17.0 h1:lwFZk349ZBY7KhonJFLshP/VhfFa6BxOjHxNnPHnEyc= logur.dev/logur v0.17.0/go.mod h1:DyA5B+b6WjjCcnpE1+HGtTLh2lXooxRq+JmAwXMRK08= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From 09117a0153dab4ffddd1d49b73866f9799af72ee Mon Sep 17 00:00:00 2001 From: MrLYC Date: Thu, 27 Oct 2022 10:24:05 +0800 Subject: [PATCH 3/3] refactor: move package demo out of package core --- {core/demo => demo}/benchmark_test.go | 2 +- {core/demo => demo}/client.go | 0 {core/demo => demo}/client_test.go | 2 +- {core/demo => demo}/demo_suite_test.go | 0 {core/demo => demo}/operation.go | 0 {core/demo => demo}/operation_test.go | 2 +- {core/demo => demo}/response.go | 0 7 files changed, 3 insertions(+), 3 deletions(-) rename {core/demo => demo}/benchmark_test.go (96%) rename {core/demo => demo}/client.go (100%) rename {core/demo => demo}/client_test.go (96%) rename {core/demo => demo}/demo_suite_test.go (100%) rename {core/demo => demo}/operation.go (100%) rename {core/demo => demo}/operation_test.go (98%) rename {core/demo => demo}/response.go (100%) diff --git a/core/demo/benchmark_test.go b/demo/benchmark_test.go similarity index 96% rename from core/demo/benchmark_test.go rename to demo/benchmark_test.go index de46aac..8db4b4d 100644 --- a/core/demo/benchmark_test.go +++ b/demo/benchmark_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/TencentBlueKing/bk-apigateway-sdks/core/bkapi" - "github.com/TencentBlueKing/bk-apigateway-sdks/core/demo" + "github.com/TencentBlueKing/bk-apigateway-sdks/demo" ) type mockTransport struct { diff --git a/core/demo/client.go b/demo/client.go similarity index 100% rename from core/demo/client.go rename to demo/client.go diff --git a/core/demo/client_test.go b/demo/client_test.go similarity index 96% rename from core/demo/client_test.go rename to demo/client_test.go index d864a8b..82ac40b 100644 --- a/core/demo/client_test.go +++ b/demo/client_test.go @@ -17,7 +17,7 @@ import ( "github.com/TencentBlueKing/bk-apigateway-sdks/core/bkapi" "github.com/TencentBlueKing/bk-apigateway-sdks/core/define" - "github.com/TencentBlueKing/bk-apigateway-sdks/core/demo" + "github.com/TencentBlueKing/bk-apigateway-sdks/demo" ) var _ = Describe("Client", func() { diff --git a/core/demo/demo_suite_test.go b/demo/demo_suite_test.go similarity index 100% rename from core/demo/demo_suite_test.go rename to demo/demo_suite_test.go diff --git a/core/demo/operation.go b/demo/operation.go similarity index 100% rename from core/demo/operation.go rename to demo/operation.go diff --git a/core/demo/operation_test.go b/demo/operation_test.go similarity index 98% rename from core/demo/operation_test.go rename to demo/operation_test.go index e908897..72495b8 100644 --- a/core/demo/operation_test.go +++ b/demo/operation_test.go @@ -16,7 +16,7 @@ import ( . "github.com/onsi/gomega" "github.com/TencentBlueKing/bk-apigateway-sdks/core/bkapi" - "github.com/TencentBlueKing/bk-apigateway-sdks/core/demo" + "github.com/TencentBlueKing/bk-apigateway-sdks/demo" ) var _ = Describe("Operation", func() { diff --git a/core/demo/response.go b/demo/response.go similarity index 100% rename from core/demo/response.go rename to demo/response.go