You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ti...@apache.org on 2021/08/16 01:19:09 UTC
[servicecomb-service-center] branch v1.x updated: Bug: continue if
parse value failed (#1135)
This is an automated email from the ASF dual-hosted git repository.
tianxiaoliang pushed a commit to branch v1.x
in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git
The following commit(s) were added to refs/heads/v1.x by this push:
new 8ff1cd6 Bug: continue if parse value failed (#1135)
8ff1cd6 is described below
commit 8ff1cd6e829069fe5cb702ee0b9791e683c82135
Author: little-cui <su...@qq.com>
AuthorDate: Mon Aug 16 09:19:02 2021 +0800
Bug: continue if parse value failed (#1135)
* Bug: continue if parse value failed
* Fix: CI
---
.github/workflows/golangci-lint.yml | 8 +-
client/client_lb.go | 3 +-
client/client_lb_test.go | 3 +-
client/config.go | 3 +-
client/instance.go | 3 +-
client/websocket.go | 3 +-
cmd/scctl/main.go | 1 +
cmd/scserver/main.go | 6 +-
frontend/main.go | 3 +-
go.mod | 4 +-
go.sum | 9 +
integration/admin_test.go | 5 +-
integration/governance_test.go | 9 +-
integration/health_test.go | 5 +-
integration/instances_test.go | 16 +-
integration/integrationtest_suite_test.go | 7 +-
integration/microservices_test.go | 5 +-
integration/rules_test.go | 9 +-
integration/schema_test.go | 7 +-
integration/tags_test.go | 9 +-
pkg/cache/tree.go | 3 +-
pkg/chain/callback.go | 1 +
pkg/chain/chain_test.go | 3 +-
pkg/chain/invocation.go | 1 +
pkg/etcdsync/mutex.go | 7 +-
pkg/etcdsync/mutex_test.go | 7 +-
pkg/event/bus.go | 1 +
pkg/event/bus_service.go | 3 +-
pkg/event/bus_service_test.go | 3 +-
pkg/event/event.go | 3 +-
pkg/event/subscriber.go | 1 +
pkg/gopool/goroutines.go | 5 +-
pkg/grace/grace.go | 3 +-
pkg/log/lager.go | 3 +-
pkg/log/log.go | 5 +-
pkg/plugin/loader.go | 3 +-
pkg/privacy/password.go | 5 +-
pkg/privacy/password_test.go | 3 +-
pkg/queue/taskqueue.go | 1 +
pkg/queue/uniqueue.go | 1 +
pkg/rbacframe/api.go | 1 +
pkg/rbacframe/api_test.go | 3 +-
pkg/rest/client.go | 7 +-
pkg/task/executor.go | 1 +
pkg/task/service_async.go | 7 +-
pkg/tlsutil/common.go | 49 ------
pkg/tlsutil/common_test.go | 25 ---
pkg/tlsutil/config.go | 68 -------
pkg/tlsutil/tls13.go | 26 ---
pkg/tlsutil/tlsutil.go | 196 ---------------------
pkg/tlsutil/tlsutil_test.go | 149 ----------------
pkg/util/context_grpc.go | 1 +
pkg/util/context_grpc_test.go | 3 +-
pkg/util/sys.go | 8 +-
pkg/util/uuid.go | 5 +-
pkg/validate/rule.go | 3 +-
pkg/validate/validator.go | 3 +-
scctl/bootstrap/bootstrap.go | 16 +-
scctl/etcd/client.go | 5 +-
scctl/pkg/cmd/cmd.go | 5 +-
scctl/pkg/cmd/help.go | 7 +-
scctl/pkg/model/types.go | 5 +-
scctl/pkg/plugin/diagnose/cmd.go | 3 +-
scctl/pkg/plugin/diagnose/compare_holder.go | 1 +
scctl/pkg/plugin/diagnose/compare_holder_test.go | 3 +-
scctl/pkg/plugin/diagnose/diagnose.go | 1 +
scctl/pkg/plugin/diagnose/diagnose_test.go | 3 +-
scctl/pkg/plugin/get/cluster/cluster_cmd.go | 1 +
scctl/pkg/plugin/get/instance/instance_cmd.go | 3 +-
scctl/pkg/plugin/get/instance/printer.go | 3 +-
scctl/pkg/plugin/get/schema/schema_cmd.go | 13 +-
scctl/pkg/plugin/get/schema/writer.go | 3 +-
scctl/pkg/plugin/get/service/service_cmd.go | 3 +-
scctl/pkg/plugin/health/cmd.go | 1 +
scctl/pkg/plugin/version/cmd.go | 1 +
scctl/pkg/progress-bar/progress-bar.go | 3 +-
scctl/pkg/writer/writer.go | 3 +-
server/alarm/common.go | 1 +
server/alarm/service.go | 3 +-
server/api.go | 5 +-
server/bootstrap/bootstrap.go | 79 +++++----
server/broker/broker_suite_test.go | 11 +-
server/broker/controller.go | 3 +-
server/broker/service.go | 4 +-
server/broker/service_test.go | 2 +
server/broker/util.go | 8 +-
server/connection/grpc/stream.go | 3 +-
server/connection/grpc/stream_test.go | 5 +-
server/connection/metrics.go | 3 +-
server/connection/ws/broker.go | 1 +
server/connection/ws/broker_test.go | 3 +-
server/connection/ws/common.go | 1 +
server/connection/ws/health_check_test.go | 3 +-
server/connection/ws/websocket_test.go | 4 +-
server/core/backend/common.go | 3 +-
server/core/backend/defer_instance.go | 5 +-
server/core/backend/defer_instance_test.go | 5 +-
server/core/backend/defer_lease.go | 3 +-
server/core/backend/discovery.go | 3 +-
server/core/backend/discovery_test.go | 3 +-
server/core/backend/lease.go | 3 +-
server/core/backend/lease_test.go | 5 +-
server/core/backend/metrics.go | 3 +-
server/core/backend/registry.go | 5 +-
server/core/config.go | 5 +-
server/core/core.go | 10 +-
server/core/key_convertor.go | 3 +-
server/core/key_convertor_test.go | 3 +-
server/core/key_generator_test.go | 3 +-
server/core/microservice.go | 5 +-
server/core/microservice_test.go | 5 +-
server/core/proto/parser.go | 29 +--
server/core/proto/parser_test.go | 95 ++++------
server/core/proto/services.go | 1 +
server/core/proto/services.pb.go | 1 +
server/event/instance_subscriber.go | 1 +
server/handler/auth/auth.go | 3 +-
server/handler/cache/cache.go | 3 +-
server/handler/context/context.go | 3 +-
server/handler/context/v3.go | 5 +-
server/handler/context/v4.go | 5 +-
server/handler/maxbody/maxbody.go | 3 +-
server/handler/metric/metric.go | 5 +-
server/handler/tracing/tracing.go | 5 +-
server/health/health.go | 1 +
server/health/health_test.go | 5 +-
server/health/metrics.go | 5 +-
server/interceptor/access/access.go | 3 +-
server/interceptor/cors/cors.go | 3 +-
server/interceptor/interceptors.go | 3 +-
server/metric/calculator_test.go | 3 +-
server/metric/common.go | 5 +-
server/metric/common_test.go | 3 +-
server/metric/gatherer.go | 7 +-
server/metric/metrics_test.go | 3 +-
server/mux/mux.go | 3 +-
server/plugin/auth/buildin/buidlin_test.go | 9 +-
server/plugin/auth/buildin/buildin.go | 5 +-
server/plugin/common.go | 3 +-
server/plugin/discovery/aggregate/common.go | 3 +-
.../plugin/discovery/aggregate/conflict_checker.go | 3 +-
server/plugin/discovery/cache_kv.go | 3 +-
server/plugin/discovery/cacher_test.go | 3 +-
server/plugin/discovery/config.go | 3 +-
server/plugin/discovery/config_test.go | 3 +-
server/plugin/discovery/etcd/adaptor_test.go | 3 +-
server/plugin/discovery/etcd/cacher_kv.go | 5 +-
server/plugin/discovery/etcd/cacher_kv_test.go | 7 +-
server/plugin/discovery/etcd/common.go | 3 +-
server/plugin/discovery/etcd/indexer_etcd.go | 13 +-
server/plugin/discovery/etcd/indexer_test.go | 3 +-
server/plugin/discovery/etcd/listwatch.go | 3 +-
server/plugin/discovery/etcd/listwatch_inner.go | 1 +
server/plugin/discovery/etcd/listwatch_test.go | 5 +-
server/plugin/discovery/etcd/metrics_test.go | 3 +-
server/plugin/discovery/etcd/watcher_inner.go | 3 +-
server/plugin/discovery/etcd/watcher_test.go | 3 +-
server/plugin/discovery/event_proxy.go | 3 +-
server/plugin/discovery/indexer_test.go | 3 +-
.../discovery/k8s/adaptor/cacher_instance.go | 5 +-
server/plugin/discovery/k8s/adaptor/common.go | 5 +-
server/plugin/discovery/k8s/adaptor/convertor.go | 9 +-
server/plugin/discovery/k8s/adaptor/kube_client.go | 9 +-
server/plugin/discovery/k8s/adaptor/listwatcher.go | 3 +-
server/plugin/discovery/metrics.go | 3 +-
server/plugin/discovery/servicecenter/aggregate.go | 5 +-
.../discovery/servicecenter/aggregate_test.go | 3 +-
server/plugin/discovery/servicecenter/indexer.go | 3 +-
server/plugin/discovery/servicecenter/syncer.go | 5 +-
.../plugin/discovery/servicecenter/syncer_test.go | 3 +-
server/plugin/discovery/types.go | 5 +-
server/plugin/export.go | 2 +-
server/plugin/quota/buildin/buildin.go | 1 +
server/plugin/quota/buildin/common_test.go | 3 +-
server/plugin/quota/counter/event.go | 1 +
server/plugin/quota/counter/event_test.go | 3 +-
server/plugin/quota/quota.go | 3 +-
server/plugin/quota/unlimit/unlimit.go | 1 +
server/plugin/registry/buildin/buildin.go | 1 +
server/plugin/registry/config.go | 7 +-
server/plugin/registry/embededetcd/embededetcd.go | 7 +-
server/plugin/registry/etcd/etcd.go | 1 +
server/plugin/registry/etcd/etcd_test.go | 29 ++-
server/plugin/registry/etcd/logger.go | 3 +-
server/plugin/registry/etcd/tracing.go | 3 +-
server/plugin/registry/metrics.go | 3 +-
server/plugin/registry/types.go | 3 +-
server/plugin/tls/buildin/buildin.go | 1 +
server/plugin/tls/buildin/tls.go | 11 +-
server/plugin/tls/buildin/tls_test.go | 8 +-
server/plugin/tracing/pzipkin/buildin.go | 7 +-
server/plugin/tracing/pzipkin/buildin_test.go | 7 +-
server/plugin/tracing/pzipkin/common.go | 9 +-
server/plugin/tracing/pzipkin/common_test.go | 3 +-
server/plugin/tracing/pzipkin/file_collector.go | 7 +-
.../plugin/tracing/pzipkin/file_collector_test.go | 5 +-
server/plugin/tracing/pzipkin/span.go | 3 +-
server/plugin/tracing/pzipkin/span_test.go | 3 +-
server/plugin/tracing/tracing.go | 1 +
server/plugin/uuid/buildin/buildin.go | 1 +
server/plugin/uuid/context/context.go | 1 +
server/rest/admin/controller_v4.go | 6 +-
server/rest/admin/service.go | 5 +-
server/rest/admin/service_test.go | 3 +-
server/rest/controller/rest_util.go | 5 +-
server/rest/controller/v3/dependency_controller.go | 2 +-
server/rest/controller/v3/instance_controller.go | 2 +-
server/rest/controller/v3/instance_watcher.go | 2 +-
server/rest/controller/v3/main_controller.go | 5 +-
.../rest/controller/v3/microservice_controller.go | 2 +-
server/rest/controller/v3/query_rule_controller.go | 2 +-
server/rest/controller/v3/schema_controller.go | 2 +-
server/rest/controller/v3/tag_controller.go | 2 +-
server/rest/controller/v4/auth_resource.go | 5 +-
server/rest/controller/v4/auth_resource_test.go | 17 +-
server/rest/controller/v4/dependency_controller.go | 5 +-
server/rest/controller/v4/instance_controller.go | 7 +-
server/rest/controller/v4/instance_watcher.go | 3 +-
server/rest/controller/v4/main_controller.go | 5 +-
.../rest/controller/v4/microservice_controller.go | 5 +-
server/rest/controller/v4/query_rule_controller.go | 7 +-
server/rest/controller/v4/schema_controller.go | 7 +-
server/rest/controller/v4/tag_controller.go | 7 +-
server/rest/govern/controller_v4.go | 6 +-
server/rest/govern/govern_suite_test.go | 15 +-
server/rest/govern/service.go | 1 +
server/rest/govern/service_test.go | 7 +-
server/rest/pprof.go | 3 +-
server/rest/server.go | 3 +-
server/rest/server_mux.go | 3 +-
server/scerror/error.go | 1 +
server/server.go | 11 +-
server/service/auth/datasource.go | 1 +
server/service/auth/etcd/etcd.go | 1 +
server/service/auth/etcd/etcd_test.go | 3 +-
server/service/auth/etcd/key_generator_test.go | 3 +-
server/service/auth/manager.go | 1 +
server/service/auth/manager_test.go | 3 +-
server/service/cache/dependency.go | 1 +
server/service/cache/filter_consistency.go | 1 +
server/service/cache/filter_consumer.go | 1 +
server/service/cache/filter_instances.go | 3 +-
server/service/cache/filter_permission.go | 1 +
server/service/cache/filter_service.go | 1 +
server/service/cache/filter_tags.go | 5 +-
server/service/cache/filter_version.go | 1 +
server/service/cache/instance.go | 3 +-
server/service/dep/etcd/util.go | 1 +
server/service/dep/manager.go | 1 +
server/service/dep/manager_test.go | 3 +-
server/service/dependency.go | 1 +
server/service/dependency_test.go | 3 +-
server/service/dependency_validator.go | 3 +-
server/service/event/dependency_event_handler.go | 3 +-
.../event/dependency_rule_event_handler_test.go | 3 +-
server/service/event/rule_event_handler.go | 1 +
.../service/event/schema_summary_event_handler.go | 3 +-
server/service/event/service_event_handler.go | 3 +-
server/service/event/tag_event_handler.go | 1 +
server/service/instance.go | 7 +-
server/service/instance_test.go | 9 +-
server/service/instance_validator.go | 5 +-
server/service/kv/store.go | 1 +
server/service/kv/store_test.go | 3 +-
server/service/lock/etcd/etcd.go | 7 +-
server/service/lock/etcd/etcd_test.go | 4 +-
server/service/lock/manager.go | 1 +
server/service/microservice.go | 3 +-
server/service/microservice_test.go | 5 +-
server/service/microservice_validator.go | 3 +-
server/service/ms/datasource.go | 1 +
server/service/ms/etcd/etcd.go | 5 +-
server/service/ms/etcd/etcd_suite_test.go | 13 +-
server/service/ms/etcd/etcd_test.go | 9 +-
server/service/ms/etcd/util.go | 7 +-
server/service/ms/manager.go | 1 +
server/service/ms/manager_test.go | 7 +-
server/service/rbac/authr_plugin.go | 1 +
server/service/rbac/blocker_test.go | 5 +-
server/service/rbac/dao/account_dao.go | 1 +
server/service/rbac/dao/account_dao_test.go | 3 +-
server/service/rbac/dao/role_dao.go | 1 +
server/service/rbac/decision.go | 1 +
server/service/rbac/decision_test.go | 3 +-
server/service/rbac/password.go | 1 +
server/service/rbac/rbac.go | 3 +-
server/service/rbac/rbca_test.go | 8 +-
server/service/rule.go | 5 +-
server/service/rule_test.go | 3 +-
server/service/rule_validator.go | 3 +-
server/service/schema.go | 3 +-
server/service/schema_test.go | 3 +-
server/service/schema_validator.go | 3 +-
server/service/service.go | 3 +-
server/service/service_suite_test.go | 15 +-
server/service/tag.go | 1 +
server/service/tag_test.go | 5 +-
server/service/tag_validator.go | 3 +-
server/service/util/dependency.go | 1 +
server/service/util/dependency_query.go | 3 +-
server/service/util/dependency_test.go | 3 +-
server/service/util/dependency_util.go | 3 +-
server/service/util/domain_util.go | 3 +-
server/service/util/heartbeat_util.go | 1 +
server/service/util/instance_util.go | 7 +-
server/service/util/instance_util_test.go | 3 +-
server/service/util/microservice_util.go | 3 +-
server/service/util/rule_util.go | 7 +-
server/service/util/rule_util_test.go | 5 +-
server/service/util/schema_util.go | 1 +
server/service/util/tag_util.go | 1 +
server/service/util/util.go | 1 +
server/service/util/util_suite_test.go | 12 +-
server/service/util/versionrule.go | 5 +-
server/service/util/versionrule_test.go | 5 +-
server/service/validate.go | 5 +-
server/service/watch.go | 1 +
server/service/watch_test.go | 3 +-
server/task/clear_service.go | 3 +-
server/task/clear_service_test.go | 17 +-
server/version.go | 1 +
syncer/config/config.go | 1 +
syncer/config/config_test.go | 3 +-
syncer/config/verify.go | 2 +-
syncer/etcd/option.go | 2 -
syncer/pkg/syssig/signal.go | 3 +-
syncer/pkg/ticker/ticker.go | 3 +-
syncer/plugins/eureka/eureka.go | 3 +-
syncer/plugins/servicecenter/instance.go | 1 +
syncer/plugins/servicecenter/service.go | 1 +
syncer/plugins/servicecenter/servicecenter.go | 1 +
syncer/plugins/servicecenter/transform.go | 3 +-
syncer/proto/syncer.pb.go | 11 +-
.../hello-server/servicecenter/servicecenter.go | 9 +-
syncer/server/convert.go | 6 +-
syncer/server/handler.go | 2 +-
syncer/server/server.go | 16 +-
test/test.go | 1 +
338 files changed, 930 insertions(+), 1129 deletions(-)
diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml
index 162d9f8..9b41798 100644
--- a/.github/workflows/golangci-lint.yml
+++ b/.github/workflows/golangci-lint.yml
@@ -1,5 +1,5 @@
name: golangci-lint
-on: [push, pull_request]
+on: [ push, pull_request ]
jobs:
golangci:
name: lint
@@ -7,7 +7,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: golangci-lint
- uses: golangci/golangci-lint-action@v1
+ uses: golangci/golangci-lint-action@v2
with:
- version: v1.27
- args: --timeout=5m --skip-dirs=server/core/proto,test,pkg/cache,server/plugin/discovery,server/service/event,server/service/util,server/bootstrap,server/notify,server/rest/controller/v3,server/broker/brokerpb,examples,syncer,frontend,scctl,integration,pkg/registry --out-format=colored-line-number --enable golint,gocyclo --skip-files=.*_test.go$
\ No newline at end of file
+ version: v1.29
+ args: --timeout=5m --skip-dirs='server/core/proto,test,pkg/cache,server/plugin/discovery,server/service/event,server/service/util,server/bootstrap,server/notify,server/rest/controller/v3,server/broker/brokerpb,examples,syncer,frontend,scctl,integration,pkg/registry' --enable gofmt,golint,gocyclo,goimports --skip-files=.*_test.go$
diff --git a/client/client_lb.go b/client/client_lb.go
index b2d73e6..822ec07 100644
--- a/client/client_lb.go
+++ b/client/client_lb.go
@@ -19,10 +19,11 @@ import (
"context"
"errors"
"fmt"
+ "net/http"
+
"github.com/apache/servicecomb-service-center/pkg/lb"
"github.com/apache/servicecomb-service-center/pkg/rest"
"github.com/apache/servicecomb-service-center/pkg/util"
- "net/http"
)
func NewLBClient(endpoints []string, options rest.URLClientOption) (*LBClient, error) {
diff --git a/client/client_lb_test.go b/client/client_lb_test.go
index 05e2514..6f78116 100644
--- a/client/client_lb_test.go
+++ b/client/client_lb_test.go
@@ -18,12 +18,13 @@ package client
import (
"context"
"fmt"
- "github.com/apache/servicecomb-service-center/pkg/rest"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"testing"
+
+ "github.com/apache/servicecomb-service-center/pkg/rest"
)
func TestNewLBClient(t *testing.T) {
diff --git a/client/config.go b/client/config.go
index 5e7caa8..a8079dd 100644
--- a/client/config.go
+++ b/client/config.go
@@ -16,10 +16,11 @@
package client
import (
- "github.com/apache/servicecomb-service-center/pkg/rest"
"io/ioutil"
"strings"
"time"
+
+ "github.com/apache/servicecomb-service-center/pkg/rest"
)
const defaultRequestTimeout = 10 * time.Second
diff --git a/client/instance.go b/client/instance.go
index 78601ce..5670fd8 100644
--- a/client/instance.go
+++ b/client/instance.go
@@ -19,11 +19,12 @@ import (
"context"
"encoding/json"
"fmt"
- "github.com/apache/servicecomb-service-center/pkg/registry"
"io/ioutil"
"net/http"
"net/url"
+ "github.com/apache/servicecomb-service-center/pkg/registry"
+
scerr "github.com/apache/servicecomb-service-center/server/scerror"
)
diff --git a/client/websocket.go b/client/websocket.go
index 0cff948..3b56686 100644
--- a/client/websocket.go
+++ b/client/websocket.go
@@ -19,10 +19,11 @@ import (
"context"
"errors"
"fmt"
- "github.com/apache/servicecomb-service-center/pkg/util"
"net/http"
"net/url"
+ "github.com/apache/servicecomb-service-center/pkg/util"
+
"github.com/gorilla/websocket"
)
diff --git a/cmd/scctl/main.go b/cmd/scctl/main.go
index 52bc2d5..7854f39 100644
--- a/cmd/scctl/main.go
+++ b/cmd/scctl/main.go
@@ -17,6 +17,7 @@ package main
import (
_ "github.com/apache/servicecomb-service-center/scctl/bootstrap"
+
"github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
)
diff --git a/cmd/scserver/main.go b/cmd/scserver/main.go
index 7ddb510..4e91806 100644
--- a/cmd/scserver/main.go
+++ b/cmd/scserver/main.go
@@ -17,9 +17,11 @@
package main
-import _ "github.com/apache/servicecomb-service-center/server/init"
-import _ "github.com/apache/servicecomb-service-center/server/bootstrap"
import (
+ _ "github.com/apache/servicecomb-service-center/server/init"
+
+ _ "github.com/apache/servicecomb-service-center/server/bootstrap"
+
"github.com/apache/servicecomb-service-center/server"
)
diff --git a/frontend/main.go b/frontend/main.go
index c460299..7118b74 100644
--- a/frontend/main.go
+++ b/frontend/main.go
@@ -20,10 +20,11 @@ import (
"flag"
"fmt"
- "github.com/astaxie/beego"
"net"
"net/url"
"strconv"
+
+ "github.com/astaxie/beego"
)
type Config struct {
diff --git a/go.mod b/go.mod
index 54b163e..c122e02 100644
--- a/go.mod
+++ b/go.mod
@@ -1,7 +1,6 @@
module github.com/apache/servicecomb-service-center
replace (
- github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b => github.com/go-chassis/glog v0.0.0-20180920075250-95a09b2413e9
github.com/apache/thrift => github.com/apache/thrift v0.0.0-20180125231006-3d556248a8b9
google.golang.org/grpc => google.golang.org/grpc v1.26.0
)
@@ -18,6 +17,7 @@ require (
github.com/go-chassis/foundation v0.3.0
github.com/go-chassis/go-archaius v1.3.2
github.com/go-chassis/go-chassis v0.0.0-20200826064053-d90be848aa10
+ github.com/go-chassis/foundation v0.3.1-0.20210811025651-7f4d2b2b906c
github.com/go-chassis/paas-lager v1.1.1
github.com/gogo/protobuf v1.3.2
github.com/golang/protobuf v1.4.3
@@ -40,7 +40,7 @@ require (
github.com/satori/go.uuid v1.1.0
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.5
- github.com/stretchr/testify v1.6.1
+ github.com/stretchr/testify v1.7.0
github.com/widuu/gojson v0.0.0-20170212122013-7da9d2cd949b
go.uber.org/zap v1.13.0
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a
diff --git a/go.sum b/go.sum
index 6813899..27c2de6 100644
--- a/go.sum
+++ b/go.sum
@@ -207,6 +207,8 @@ github.com/go-chassis/foundation v0.1.1-0.20191113114104-2b05871e9ec4/go.mod h1:
github.com/go-chassis/foundation v0.1.1-0.20200825060850-b16bf420f7b3/go.mod h1:21/ajGtgJlWTCeM0TxGJdRhO8bJkKirWyV8Stlh6g6c=
github.com/go-chassis/foundation v0.3.0 h1:jG4BIrK8fXD9jbTtJ5rOLGQZ1pQI/mLnDuVJzToCtos=
github.com/go-chassis/foundation v0.3.0/go.mod h1:2PjwqpVwYEVaAldl5A58a08viH8p27pNeYaiE3ZxOBA=
+github.com/go-chassis/foundation v0.3.1-0.20210811025651-7f4d2b2b906c h1:6ooUyysnayGgoJHV++NLEcnnnXzsw3ud4VydjISGBqI=
+github.com/go-chassis/foundation v0.3.1-0.20210811025651-7f4d2b2b906c/go.mod h1:6NsIUaHghTFRGfCBcZN011zl196F6OR5QvD9N+P4oWU=
github.com/go-chassis/glog v0.0.0-20180920075250-95a09b2413e9 h1:z6ezGZIJVMl2Yo0gOJlv8jOvCDFi9W3TLADQvJ6Z2t0=
github.com/go-chassis/glog v0.0.0-20180920075250-95a09b2413e9/go.mod h1:tfdQUl8deEC8YmpbYjbSZJv7Y/7hC0ag9n3RVrjIoJs=
github.com/go-chassis/go-archaius v1.3.2 h1:b52voYtSL+fukmvg/rsn/quw/hgDWtV945adl0VV8Lg=
@@ -242,6 +244,9 @@ github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501 h1:C1JKChikHGpXwT5
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87 h1:zP3nY8Tk2E6RTkqGYrarZXuzh+ffyLDljLxCy1iJw80=
github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
+github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
+github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
+github.com/go-playground/validator v9.31.0+incompatible/go.mod h1:yrEkQXlcI+PugkyDjY2bRrL/UBU4f3rvrgkN3V8JEig=
github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
@@ -256,6 +261,7 @@ github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9/WXiA+pa3tz3fJXkt5B7QaRBrM62gk=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -449,6 +455,7 @@ github.com/labstack/gommon v0.2.1/go.mod h1:/tj9csK2iPSBvn+3NLM9e52usepMtrd5ilFY
github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0=
github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k=
github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ=
+github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
@@ -689,6 +696,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
+github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
diff --git a/integration/admin_test.go b/integration/admin_test.go
index 3233324..d3e5edf 100644
--- a/integration/admin_test.go
+++ b/integration/admin_test.go
@@ -17,12 +17,13 @@
package integrationtest_test
import (
+ "io/ioutil"
+ "net/http"
+
. "github.com/apache/servicecomb-service-center/integration"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/widuu/gojson"
- "io/ioutil"
- "net/http"
)
var _ = Describe("Admin Api Test", func() {
diff --git a/integration/governance_test.go b/integration/governance_test.go
index f31e2e3..0476624 100644
--- a/integration/governance_test.go
+++ b/integration/governance_test.go
@@ -19,16 +19,17 @@ package integrationtest_test
import (
"bytes"
"encoding/json"
- . "github.com/apache/servicecomb-service-center/integration"
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/widuu/gojson"
"io/ioutil"
"math/rand"
"net/http"
"strconv"
"strings"
"testing"
+
+ . "github.com/apache/servicecomb-service-center/integration"
+ . "github.com/onsi/ginkgo"
+ . "github.com/onsi/gomega"
+ "github.com/widuu/gojson"
)
var _ = Describe("MicroService Api Test", func() {
diff --git a/integration/health_test.go b/integration/health_test.go
index 856ec3b..fe32ab9 100644
--- a/integration/health_test.go
+++ b/integration/health_test.go
@@ -20,11 +20,12 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
- . "github.com/apache/servicecomb-service-center/integration"
- "github.com/widuu/gojson"
"io/ioutil"
"net/http"
"testing"
+
+ . "github.com/apache/servicecomb-service-center/integration"
+ "github.com/widuu/gojson"
)
var _ = Describe("Basic Api Test", func() {
diff --git a/integration/instances_test.go b/integration/instances_test.go
index fcc9108..74a95fd 100644
--- a/integration/instances_test.go
+++ b/integration/instances_test.go
@@ -19,23 +19,25 @@ package integrationtest_test
import (
"encoding/json"
"fmt"
- "github.com/go-chassis/cari/discovery"
- "github.com/gorilla/websocket"
- "github.com/stretchr/testify/assert"
"net/http"
"strings"
"sync"
+ "github.com/go-chassis/cari/discovery"
+ "github.com/gorilla/websocket"
+ "github.com/stretchr/testify/assert"
+
"bytes"
- . "github.com/apache/servicecomb-service-center/integration"
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/widuu/gojson"
"io/ioutil"
"math/rand"
"strconv"
"testing"
"time"
+
+ . "github.com/apache/servicecomb-service-center/integration"
+ . "github.com/onsi/ginkgo"
+ . "github.com/onsi/gomega"
+ "github.com/widuu/gojson"
)
var _ = Describe("MicroService Api Test", func() {
diff --git a/integration/integrationtest_suite_test.go b/integration/integrationtest_suite_test.go
index d5a2d83..a2d3724 100644
--- a/integration/integrationtest_suite_test.go
+++ b/integration/integrationtest_suite_test.go
@@ -17,12 +17,13 @@
package integrationtest_test
import (
- . "github.com/onsi/ginkgo"
- "github.com/onsi/ginkgo/reporters"
- . "github.com/onsi/gomega"
"net/http"
"os"
"testing"
+
+ . "github.com/onsi/ginkgo"
+ "github.com/onsi/ginkgo/reporters"
+ . "github.com/onsi/gomega"
)
const LengthUUID = 40
diff --git a/integration/microservices_test.go b/integration/microservices_test.go
index a3c3c87..3450824 100644
--- a/integration/microservices_test.go
+++ b/integration/microservices_test.go
@@ -22,8 +22,6 @@ import (
"bytes"
"encoding/json"
- . "github.com/apache/servicecomb-service-center/integration"
- "github.com/widuu/gojson"
"io/ioutil"
"math/rand"
"net/http"
@@ -31,6 +29,9 @@ import (
"strings"
"testing"
"time"
+
+ . "github.com/apache/servicecomb-service-center/integration"
+ "github.com/widuu/gojson"
)
var serviceName = ""
diff --git a/integration/rules_test.go b/integration/rules_test.go
index 3a70959..a031950 100644
--- a/integration/rules_test.go
+++ b/integration/rules_test.go
@@ -19,16 +19,17 @@ package integrationtest_test
import (
"bytes"
"encoding/json"
- . "github.com/apache/servicecomb-service-center/integration"
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/widuu/gojson"
"io/ioutil"
"math/rand"
"net/http"
"strconv"
"strings"
"time"
+
+ . "github.com/apache/servicecomb-service-center/integration"
+ . "github.com/onsi/ginkgo"
+ . "github.com/onsi/gomega"
+ "github.com/widuu/gojson"
)
var _ = Describe("MicroService Api Test", func() {
diff --git a/integration/schema_test.go b/integration/schema_test.go
index 70b1f7a..1639181 100644
--- a/integration/schema_test.go
+++ b/integration/schema_test.go
@@ -19,13 +19,14 @@ package integrationtest_test
import (
"bytes"
"encoding/json"
+ "io/ioutil"
+ "net/http"
+ "strings"
+
. "github.com/apache/servicecomb-service-center/integration"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/widuu/gojson"
- "io/ioutil"
- "net/http"
- "strings"
)
var _ = Describe("MicroService Api schema Test", func() {
diff --git a/integration/tags_test.go b/integration/tags_test.go
index 1d93dea..af671a1 100644
--- a/integration/tags_test.go
+++ b/integration/tags_test.go
@@ -19,16 +19,17 @@ package integrationtest_test
import (
"bytes"
"encoding/json"
- . "github.com/apache/servicecomb-service-center/integration"
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/widuu/gojson"
"io/ioutil"
"math/rand"
"net/http"
"strconv"
"strings"
"time"
+
+ . "github.com/apache/servicecomb-service-center/integration"
+ . "github.com/onsi/ginkgo"
+ . "github.com/onsi/gomega"
+ "github.com/widuu/gojson"
)
var _ = Describe("MicroService Api Test", func() {
diff --git a/pkg/cache/tree.go b/pkg/cache/tree.go
index b1f8ceb..4aad7ab 100644
--- a/pkg/cache/tree.go
+++ b/pkg/cache/tree.go
@@ -20,8 +20,9 @@ package cache
import (
"context"
"errors"
- "github.com/karlseguin/ccache"
"sync"
+
+ "github.com/karlseguin/ccache"
)
var errNilNode = errors.New("nil node")
diff --git a/pkg/chain/callback.go b/pkg/chain/callback.go
index 20c9219..7faeb98 100644
--- a/pkg/chain/callback.go
+++ b/pkg/chain/callback.go
@@ -19,6 +19,7 @@ package chain
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
)
diff --git a/pkg/chain/chain_test.go b/pkg/chain/chain_test.go
index c21ad3a..baaef88 100644
--- a/pkg/chain/chain_test.go
+++ b/pkg/chain/chain_test.go
@@ -19,9 +19,10 @@ package chain
import (
"context"
"errors"
- "github.com/apache/servicecomb-service-center/pkg/util"
"testing"
"time"
+
+ "github.com/apache/servicecomb-service-center/pkg/util"
)
const (
diff --git a/pkg/chain/invocation.go b/pkg/chain/invocation.go
index 6d87500..19f5e79 100644
--- a/pkg/chain/invocation.go
+++ b/pkg/chain/invocation.go
@@ -19,6 +19,7 @@ package chain
import (
"context"
+
errorsEx "github.com/apache/servicecomb-service-center/pkg/errors"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/pkg/etcdsync/mutex.go b/pkg/etcdsync/mutex.go
index 266ed2a..0a8c073 100644
--- a/pkg/etcdsync/mutex.go
+++ b/pkg/etcdsync/mutex.go
@@ -20,15 +20,16 @@ package etcdsync
import (
"context"
"fmt"
+ "os"
+ "sync"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/core/backend"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
"github.com/coreos/etcd/client"
- "os"
- "sync"
- "time"
)
const (
diff --git a/pkg/etcdsync/mutex_test.go b/pkg/etcdsync/mutex_test.go
index 0e9e125..797ec51 100644
--- a/pkg/etcdsync/mutex_test.go
+++ b/pkg/etcdsync/mutex_test.go
@@ -18,13 +18,14 @@ package etcdsync_test
import (
"fmt"
- "github.com/apache/servicecomb-service-center/pkg/etcdsync"
- "github.com/astaxie/beego"
- "github.com/stretchr/testify/assert"
"testing"
_ "github.com/apache/servicecomb-service-center/server/plugin/registry/etcd"
_ "github.com/apache/servicecomb-service-center/server/plugin/tracing/pzipkin"
+
+ "github.com/apache/servicecomb-service-center/pkg/etcdsync"
+ "github.com/astaxie/beego"
+ "github.com/stretchr/testify/assert"
)
func init() {
diff --git a/pkg/event/bus.go b/pkg/event/bus.go
index 3c59341..4e7fe77 100644
--- a/pkg/event/bus.go
+++ b/pkg/event/bus.go
@@ -19,6 +19,7 @@ package event
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/queue"
"github.com/apache/servicecomb-service-center/pkg/util"
)
diff --git a/pkg/event/bus_service.go b/pkg/event/bus_service.go
index b5c8cd2..22277be 100644
--- a/pkg/event/bus_service.go
+++ b/pkg/event/bus_service.go
@@ -20,8 +20,9 @@ package event
import (
"errors"
"fmt"
- "github.com/apache/servicecomb-service-center/pkg/log"
"sync"
+
+ "github.com/apache/servicecomb-service-center/pkg/log"
)
// BusService is the daemon service to manage multiple type Bus
diff --git a/pkg/event/bus_service_test.go b/pkg/event/bus_service_test.go
index 752101d..c6ae242 100644
--- a/pkg/event/bus_service_test.go
+++ b/pkg/event/bus_service_test.go
@@ -18,9 +18,10 @@
package event
import (
- simple "github.com/apache/servicecomb-service-center/pkg/time"
"testing"
"time"
+
+ simple "github.com/apache/servicecomb-service-center/pkg/time"
)
func TestGetNotifyService(t *testing.T) {
diff --git a/pkg/event/event.go b/pkg/event/event.go
index eeac4ce..d057a80 100644
--- a/pkg/event/event.go
+++ b/pkg/event/event.go
@@ -18,8 +18,9 @@
package event
import (
- simple "github.com/apache/servicecomb-service-center/pkg/time"
"time"
+
+ simple "github.com/apache/servicecomb-service-center/pkg/time"
)
type Event interface {
diff --git a/pkg/event/subscriber.go b/pkg/event/subscriber.go
index 583213e..df771dd 100644
--- a/pkg/event/subscriber.go
+++ b/pkg/event/subscriber.go
@@ -19,6 +19,7 @@ package event
import (
"errors"
+
"github.com/apache/servicecomb-service-center/pkg/util"
)
diff --git a/pkg/gopool/goroutines.go b/pkg/gopool/goroutines.go
index 4e22ced..d5ca917 100644
--- a/pkg/gopool/goroutines.go
+++ b/pkg/gopool/goroutines.go
@@ -19,10 +19,11 @@ package gopool
import (
"context"
- "github.com/apache/servicecomb-service-center/pkg/log"
- "github.com/apache/servicecomb-service-center/pkg/util"
"sync"
"time"
+
+ "github.com/apache/servicecomb-service-center/pkg/log"
+ "github.com/apache/servicecomb-service-center/pkg/util"
)
var GlobalConfig = Configure()
diff --git a/pkg/grace/grace.go b/pkg/grace/grace.go
index ec94485..b16e23d 100644
--- a/pkg/grace/grace.go
+++ b/pkg/grace/grace.go
@@ -20,13 +20,14 @@ package grace
import (
"flag"
"fmt"
- "github.com/apache/servicecomb-service-center/pkg/log"
"os"
"os/exec"
"os/signal"
"strings"
"sync"
"syscall"
+
+ "github.com/apache/servicecomb-service-center/pkg/log"
)
const (
diff --git a/pkg/log/lager.go b/pkg/log/lager.go
index 62b1de0..75655f0 100644
--- a/pkg/log/lager.go
+++ b/pkg/log/lager.go
@@ -18,10 +18,11 @@
package log
import (
+ "runtime/debug"
+
"github.com/apache/servicecomb-service-center/pkg/util"
stlager "github.com/go-chassis/paas-lager"
"github.com/go-chassis/paas-lager/third_party/forked/cloudfoundry/lager"
- "runtime/debug"
)
var (
diff --git a/pkg/log/log.go b/pkg/log/log.go
index 8d7e324..ca92e60 100644
--- a/pkg/log/log.go
+++ b/pkg/log/log.go
@@ -19,12 +19,13 @@ package log
import (
"fmt"
- "github.com/apache/servicecomb-service-center/pkg/util"
- "github.com/go-chassis/paas-lager/third_party/forked/cloudfoundry/lager"
"os"
"path/filepath"
"strings"
"time"
+
+ "github.com/apache/servicecomb-service-center/pkg/util"
+ "github.com/go-chassis/paas-lager/third_party/forked/cloudfoundry/lager"
)
const (
diff --git a/pkg/plugin/loader.go b/pkg/plugin/loader.go
index 25d6761..e7dacb1 100644
--- a/pkg/plugin/loader.go
+++ b/pkg/plugin/loader.go
@@ -19,13 +19,14 @@ package plugin
import (
"fmt"
- "github.com/apache/servicecomb-service-center/pkg/log"
"io/ioutil"
"os"
"path/filepath"
"plugin"
"regexp"
"sync"
+
+ "github.com/apache/servicecomb-service-center/pkg/log"
)
var (
diff --git a/pkg/privacy/password.go b/pkg/privacy/password.go
index 66f4ae2..0f82efa 100644
--- a/pkg/privacy/password.go
+++ b/pkg/privacy/password.go
@@ -18,11 +18,12 @@
package privacy
import (
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/log"
- "github.com/elithrar/simple-scrypt"
+ scrypt "github.com/elithrar/simple-scrypt"
"github.com/go-chassis/foundation/stringutil"
"golang.org/x/crypto/bcrypt"
- "strings"
)
const (
diff --git a/pkg/privacy/password_test.go b/pkg/privacy/password_test.go
index c4ad3dd..509fd7f 100644
--- a/pkg/privacy/password_test.go
+++ b/pkg/privacy/password_test.go
@@ -18,9 +18,10 @@
package privacy_test
import (
+ "testing"
+
"github.com/apache/servicecomb-service-center/pkg/privacy"
"github.com/stretchr/testify/assert"
- "testing"
)
func TestHashPassword(t *testing.T) {
diff --git a/pkg/queue/taskqueue.go b/pkg/queue/taskqueue.go
index b394802..1875ff2 100644
--- a/pkg/queue/taskqueue.go
+++ b/pkg/queue/taskqueue.go
@@ -17,6 +17,7 @@ package queue
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
)
diff --git a/pkg/queue/uniqueue.go b/pkg/queue/uniqueue.go
index 98d0717..d6e9c41 100644
--- a/pkg/queue/uniqueue.go
+++ b/pkg/queue/uniqueue.go
@@ -20,6 +20,7 @@ package queue
import (
"context"
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/log"
)
diff --git a/pkg/rbacframe/api.go b/pkg/rbacframe/api.go
index 5f7c462..87d3f86 100644
--- a/pkg/rbacframe/api.go
+++ b/pkg/rbacframe/api.go
@@ -21,6 +21,7 @@ package rbacframe
import (
"context"
"crypto/rsa"
+
"github.com/go-chassis/go-chassis/security/token"
)
diff --git a/pkg/rbacframe/api_test.go b/pkg/rbacframe/api_test.go
index 1835158..775a9ad 100644
--- a/pkg/rbacframe/api_test.go
+++ b/pkg/rbacframe/api_test.go
@@ -19,11 +19,12 @@ package rbacframe_test
import (
"context"
+ "testing"
+
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
"github.com/go-chassis/go-chassis/security/secret"
"github.com/go-chassis/go-chassis/security/token"
"github.com/stretchr/testify/assert"
- "testing"
)
func TestFromContext(t *testing.T) {
diff --git a/pkg/rest/client.go b/pkg/rest/client.go
index a298730..5d080c4 100644
--- a/pkg/rest/client.go
+++ b/pkg/rest/client.go
@@ -18,9 +18,9 @@ package rest
import (
"bytes"
"compress/gzip"
+ "context"
"crypto/tls"
"fmt"
- "github.com/apache/servicecomb-service-center/pkg/log"
"io"
"io/ioutil"
"net/http"
@@ -31,10 +31,9 @@ import (
"time"
"github.com/apache/servicecomb-service-center/pkg/buffer"
- "github.com/apache/servicecomb-service-center/pkg/tlsutil"
+ "github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
-
- "context"
+ "github.com/go-chassis/foundation/tlsutil"
)
var defaultURLClientOption = URLClientOption{
diff --git a/pkg/task/executor.go b/pkg/task/executor.go
index 0146698..2edac60 100644
--- a/pkg/task/executor.go
+++ b/pkg/task/executor.go
@@ -20,6 +20,7 @@ package task
import (
"context"
"errors"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/queue"
diff --git a/pkg/task/service_async.go b/pkg/task/service_async.go
index 4def6f7..2b21e32 100644
--- a/pkg/task/service_async.go
+++ b/pkg/task/service_async.go
@@ -20,12 +20,13 @@ package task
import (
"context"
"errors"
- "github.com/apache/servicecomb-service-center/pkg/gopool"
- "github.com/apache/servicecomb-service-center/pkg/log"
- "github.com/apache/servicecomb-service-center/pkg/util"
"sync"
"sync/atomic"
"time"
+
+ "github.com/apache/servicecomb-service-center/pkg/gopool"
+ "github.com/apache/servicecomb-service-center/pkg/log"
+ "github.com/apache/servicecomb-service-center/pkg/util"
)
const (
diff --git a/pkg/tlsutil/common.go b/pkg/tlsutil/common.go
deleted file mode 100644
index 62e0cdb..0000000
--- a/pkg/tlsutil/common.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// 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 tlsutil
-
-import (
- "crypto/tls"
-)
-
-var TLSCipherSuiteMap = map[string]uint16{
- "TLS_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
- "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
- "TLS_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
- "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
- "TLS_RSA_WITH_AES_128_CBC_SHA256": tls.TLS_RSA_WITH_AES_128_CBC_SHA256,
-}
-
-var TLSVersionMap = map[string]uint16{
- "TLSv1.0": tls.VersionTLS10,
- "TLSv1.1": tls.VersionTLS11,
- "TLSv1.2": tls.VersionTLS12,
-}
-
-var cipherSuite []uint16
-
-// MaxSupportedTLSVersion is the max supported TLS version
-var MaxSupportedTLSVersion uint16 = tls.VersionTLS12
-
-func TLSCipherSuits() []uint16 {
- if cipherSuite != nil {
- return cipherSuite
- }
- for _, c := range TLSCipherSuiteMap {
- cipherSuite = append(cipherSuite, c)
- }
- return cipherSuite
-}
diff --git a/pkg/tlsutil/common_test.go b/pkg/tlsutil/common_test.go
deleted file mode 100644
index 76f9f80..0000000
--- a/pkg/tlsutil/common_test.go
+++ /dev/null
@@ -1,25 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// 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 tlsutil
-
-import "testing"
-
-func TestTLSCipherSuits(t *testing.T) {
- suits := TLSCipherSuits()
- if len(suits) <= 0 {
- t.Fatalf("Get TLSCipherSuits failed")
- }
-}
diff --git a/pkg/tlsutil/config.go b/pkg/tlsutil/config.go
deleted file mode 100644
index 86f57e9..0000000
--- a/pkg/tlsutil/config.go
+++ /dev/null
@@ -1,68 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// 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 tlsutil
-
-import (
- "crypto/tls"
-)
-
-type SSLConfig struct {
- VerifyPeer bool
- VerifyHostName bool
- CipherSuites []uint16
- MinVersion uint16
- MaxVersion uint16
- CACertFile string
- CertFile string
- KeyFile string
- KeyPassphase string
-}
-
-type SSLConfigOption func(*SSLConfig)
-
-func WithVerifyPeer(b bool) SSLConfigOption { return func(c *SSLConfig) { c.VerifyPeer = b } }
-func WithVerifyHostName(b bool) SSLConfigOption { return func(c *SSLConfig) { c.VerifyHostName = b } }
-func WithCipherSuits(s []uint16) SSLConfigOption { return func(c *SSLConfig) { c.CipherSuites = s } }
-func WithVersion(min, max uint16) SSLConfigOption {
- return func(c *SSLConfig) { c.MinVersion, c.MaxVersion = min, max }
-}
-func WithCert(f string) SSLConfigOption { return func(c *SSLConfig) { c.CertFile = f } }
-func WithKey(k string) SSLConfigOption { return func(c *SSLConfig) { c.KeyFile = k } }
-func WithKeyPass(p string) SSLConfigOption { return func(c *SSLConfig) { c.KeyPassphase = p } }
-func WithCA(f string) SSLConfigOption { return func(c *SSLConfig) { c.CACertFile = f } }
-
-func toSSLConfig(opts ...SSLConfigOption) (op SSLConfig) {
- for _, opt := range opts {
- opt(&op)
- }
- return
-}
-
-func DefaultClientTLSOptions() []SSLConfigOption {
- return []SSLConfigOption{
- WithVerifyPeer(true),
- WithVerifyHostName(true),
- WithVersion(tls.VersionTLS12, MaxSupportedTLSVersion),
- }
-}
-
-func DefaultServerTLSOptions() []SSLConfigOption {
- return []SSLConfigOption{
- WithVerifyPeer(true),
- WithVersion(tls.VersionTLS12, MaxSupportedTLSVersion),
- WithCipherSuits(TLSCipherSuits()),
- }
-}
diff --git a/pkg/tlsutil/tls13.go b/pkg/tlsutil/tls13.go
deleted file mode 100644
index d8e45fd..0000000
--- a/pkg/tlsutil/tls13.go
+++ /dev/null
@@ -1,26 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// 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.
-
-// +build go1.12
-
-package tlsutil
-
-import "crypto/tls"
-
-func init() {
- // Add TLS 1.3 version
- TLSVersionMap["TLSv1.3"] = tls.VersionTLS13
- MaxSupportedTLSVersion = tls.VersionTLS13
-}
diff --git a/pkg/tlsutil/tlsutil.go b/pkg/tlsutil/tlsutil.go
deleted file mode 100644
index e4dcc59..0000000
--- a/pkg/tlsutil/tlsutil.go
+++ /dev/null
@@ -1,196 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// 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 tlsutil
-
-import (
- "crypto/tls"
- "crypto/x509"
- "encoding/pem"
- "github.com/apache/servicecomb-service-center/pkg/log"
- "github.com/apache/servicecomb-service-center/pkg/util"
- "io/ioutil"
- "strings"
-)
-
-func ParseSSLCipherSuites(ciphers string, permitTLSCipherSuiteMap map[string]uint16) []uint16 {
- if len(ciphers) == 0 || len(permitTLSCipherSuiteMap) == 0 {
- return nil
- }
-
- cipherSuiteList := make([]uint16, 0)
- cipherSuiteNameList := strings.Split(ciphers, ",")
- for _, cipherSuiteName := range cipherSuiteNameList {
- cipherSuiteName = strings.TrimSpace(cipherSuiteName)
- if len(cipherSuiteName) == 0 {
- continue
- }
-
- if cipherSuite, ok := permitTLSCipherSuiteMap[cipherSuiteName]; ok {
- cipherSuiteList = append(cipherSuiteList, cipherSuite)
- } else {
- // 配置算法不存在
- log.Warnf("cipher %s not exist.", cipherSuiteName)
- }
- }
-
- return cipherSuiteList
-}
-
-func ParseDefaultSSLCipherSuites(ciphers string) []uint16 {
- return ParseSSLCipherSuites(ciphers, TLSCipherSuiteMap)
-}
-
-func ParseSSLProtocol(sprotocol string) uint16 {
- var result uint16 = tls.VersionTLS12
- if protocol, ok := TLSVersionMap[sprotocol]; ok {
- result = protocol
- } else {
- log.Warnf("invalid ssl minimal version(%s), use default.", sprotocol)
- }
-
- return result
-}
-
-func GetX509CACertPool(caCertFile string) (caCertPool *x509.CertPool, err error) {
- pool := x509.NewCertPool()
- caCert, err := ioutil.ReadFile(caCertFile)
- if err != nil {
- log.Errorf(err, "read ca cert file %s failed.", caCertFile)
- return nil, err
- }
-
- pool.AppendCertsFromPEM(caCert)
- return pool, nil
-}
-
-func LoadTLSCertificate(certFile, keyFile, plainPassphase string) (tlsCert []tls.Certificate, err error) {
- certContent, err := ioutil.ReadFile(certFile)
- if err != nil {
- log.Errorf(err, "read cert file %s failed.", certFile)
- return nil, err
- }
-
- keyContent, err := ioutil.ReadFile(keyFile)
- if err != nil {
- log.Errorf(err, "read key file %s failed.", keyFile)
- return nil, err
- }
-
- keyBlock, _ := pem.Decode(keyContent)
- if keyBlock == nil {
- log.Errorf(err, "decode key file %s failed.", keyFile)
- return nil, err
- }
-
- if x509.IsEncryptedPEMBlock(keyBlock) {
- plainPassphaseBytes := util.StringToBytesWithNoCopy(plainPassphase)
- keyData, err := x509.DecryptPEMBlock(keyBlock, plainPassphaseBytes)
- if err != nil {
- log.Errorf(err, "decrypt key file %s failed.", keyFile)
- return nil, err
- }
-
- // 解密成功,重新编码为PEM格式的文件
- plainKeyBlock := &pem.Block{
- Type: "RSA PRIVATE KEY",
- Bytes: keyData,
- }
-
- keyContent = pem.EncodeToMemory(plainKeyBlock)
- }
-
- cert, err := tls.X509KeyPair(certContent, keyContent)
- if err != nil {
- log.Errorf(err, "load X509 key pair from cert file %s with key file %s failed.", certFile, keyFile)
- return nil, err
- }
-
- var certs []tls.Certificate
- certs = append(certs, cert)
-
- return certs, nil
-}
-
-/**
- verifyPeer Whether verify client
- supplyCert Whether send certificate
- verifyCN Whether verify CommonName
-*/
-func GetClientTLSConfig(opts ...SSLConfigOption) (tlsConfig *tls.Config, err error) {
- cfg := toSSLConfig(opts...)
- var pool *x509.CertPool = nil
- var certs []tls.Certificate
- if cfg.VerifyPeer {
- pool, err = GetX509CACertPool(cfg.CACertFile)
- if err != nil {
- return nil, err
- }
- }
-
- if len(cfg.CertFile) > 0 {
- certs, err = LoadTLSCertificate(cfg.CertFile, cfg.KeyFile, cfg.KeyPassphase)
- if err != nil {
- return nil, err
- }
- }
-
- tlsConfig = &tls.Config{
- RootCAs: pool,
- Certificates: certs,
- CipherSuites: cfg.CipherSuites,
- InsecureSkipVerify: !cfg.VerifyPeer || !cfg.VerifyHostName,
- MinVersion: cfg.MinVersion,
- MaxVersion: cfg.MaxVersion,
- }
-
- return tlsConfig, nil
-}
-
-func GetServerTLSConfig(opts ...SSLConfigOption) (tlsConfig *tls.Config, err error) {
- cfg := toSSLConfig(opts...)
- clientAuthMode := tls.NoClientCert
- var pool *x509.CertPool = nil
- if cfg.VerifyPeer {
- pool, err = GetX509CACertPool(cfg.CACertFile)
- if err != nil {
- return nil, err
- }
-
- clientAuthMode = tls.RequireAndVerifyClientCert
- }
-
- var certs []tls.Certificate
- if len(cfg.CertFile) > 0 {
- certs, err = LoadTLSCertificate(cfg.CertFile, cfg.KeyFile, cfg.KeyPassphase)
- if err != nil {
- return nil, err
- }
- }
-
- tlsConfig = &tls.Config{
- ClientCAs: pool,
- Certificates: certs,
- CipherSuites: cfg.CipherSuites,
- CurvePreferences: []tls.CurveID{tls.X25519, tls.CurveP256},
- PreferServerCipherSuites: true,
- ClientAuth: clientAuthMode,
- MinVersion: cfg.MinVersion,
- MaxVersion: cfg.MaxVersion,
- NextProtos: []string{"h2", "http/1.1"},
- }
-
- return tlsConfig, nil
-}
diff --git a/pkg/tlsutil/tlsutil_test.go b/pkg/tlsutil/tlsutil_test.go
deleted file mode 100644
index 6f9e367..0000000
--- a/pkg/tlsutil/tlsutil_test.go
+++ /dev/null
@@ -1,149 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// 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 tlsutil
-
-import (
- "crypto/tls"
- "io/ioutil"
- "testing"
-)
-
-const sslRoot = "../../examples/service_center/ssl/"
-
-func TestParseDefaultSSLCipherSuites(t *testing.T) {
- c := ParseDefaultSSLCipherSuites("")
- if c != nil {
- t.Fatalf("ParseDefaultSSLCipherSuites failed")
- }
- c = ParseDefaultSSLCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA256")
- if len(c) != 1 {
- t.Fatalf("ParseDefaultSSLCipherSuites failed")
- }
- c = ParseDefaultSSLCipherSuites("a")
- if len(c) != 0 {
- t.Fatalf("ParseDefaultSSLCipherSuites failed")
- }
- c = ParseDefaultSSLCipherSuites("a,,b")
- if len(c) != 0 {
- t.Fatalf("ParseDefaultSSLCipherSuites failed")
- }
-}
-
-func TestGetServerTLSConfig(t *testing.T) {
- pw, _ := ioutil.ReadFile(sslRoot + "cert_pwd")
- opts := append(DefaultServerTLSOptions(),
- WithVerifyPeer(true),
- WithVersion(ParseSSLProtocol("TLSv1.0"), tls.VersionTLS12),
- WithCipherSuits(ParseDefaultSSLCipherSuites("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384")),
- WithKeyPass(string(pw)),
- WithCA(sslRoot+"trust.cer"),
- WithCert(sslRoot+"server.cer"),
- WithKey(sslRoot+"server_key.pem"),
- )
- serverTLSConfig, err := GetServerTLSConfig(opts...)
- if err != nil {
- t.Fatalf("GetServerTLSConfig failed")
- }
- if len(serverTLSConfig.Certificates) == 0 {
- t.Fatalf("GetServerTLSConfig failed")
- }
- if serverTLSConfig.ClientCAs == nil {
- t.Fatalf("GetServerTLSConfig failed")
- }
- if len(serverTLSConfig.CipherSuites) != 2 {
- t.Fatalf("GetServerTLSConfig failed")
- }
- if serverTLSConfig.MinVersion != tls.VersionTLS10 {
- t.Fatalf("GetServerTLSConfig failed")
- }
- if serverTLSConfig.MaxVersion != tls.VersionTLS12 {
- t.Fatalf("GetServerTLSConfig failed")
- }
- if serverTLSConfig.ClientAuth != tls.RequireAndVerifyClientCert {
- t.Fatalf("GetServerTLSConfig failed")
- }
-}
-
-func TestGetClientTLSConfig(t *testing.T) {
- pw, _ := ioutil.ReadFile(sslRoot + "cert_pwd")
- opts := append(DefaultServerTLSOptions(),
- WithVerifyPeer(true),
- WithVerifyHostName(false),
- WithVersion(ParseSSLProtocol("TLSv1.0"), tls.VersionTLS12),
- WithCipherSuits(ParseDefaultSSLCipherSuites("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384")),
- WithKeyPass(string(pw)),
- WithCA(sslRoot+"trust.cer"),
- WithCert(sslRoot+"server.cer"),
- WithKey(sslRoot+"server_key.pem"),
- )
- clientTLSConfig, err := GetClientTLSConfig(opts...)
- if err != nil {
- t.Fatalf("GetClientTLSConfig failed")
- }
- if len(clientTLSConfig.Certificates) == 0 {
- t.Fatalf("GetClientTLSConfig failed")
- }
- if clientTLSConfig.RootCAs == nil {
- t.Fatalf("GetClientTLSConfig failed")
- }
- if len(clientTLSConfig.CipherSuites) != 2 {
- t.Fatalf("GetClientTLSConfig failed")
- }
- if clientTLSConfig.MinVersion != tls.VersionTLS10 {
- t.Fatalf("GetClientTLSConfig failed")
- }
- if clientTLSConfig.MaxVersion != tls.VersionTLS12 {
- t.Fatalf("GetClientTLSConfig failed")
- }
- if clientTLSConfig.InsecureSkipVerify != true {
- t.Fatalf("GetClientTLSConfig failed")
- }
-
- // verify peer and peer host
- opts = append(opts,
- WithVerifyPeer(false),
- WithVerifyHostName(true),
- )
- clientTLSConfig, err = GetClientTLSConfig(opts...)
- if err != nil {
- t.Fatalf("GetClientTLSConfig failed")
- }
- if clientTLSConfig.RootCAs != nil || !clientTLSConfig.InsecureSkipVerify {
- t.Fatalf("GetClientTLSConfig failed")
- }
- opts = append(opts,
- WithVerifyPeer(true),
- WithVerifyHostName(false),
- )
- clientTLSConfig, err = GetClientTLSConfig(opts...)
- if err != nil {
- t.Fatalf("GetClientTLSConfig failed")
- }
- if clientTLSConfig.RootCAs == nil || !clientTLSConfig.InsecureSkipVerify {
- t.Fatalf("GetClientTLSConfig failed")
- }
- opts = append(opts,
- WithVerifyPeer(true),
- WithVerifyHostName(true),
- )
- clientTLSConfig, err = GetClientTLSConfig(opts...)
- if err != nil {
- t.Fatalf("GetClientTLSConfig failed")
- }
- if clientTLSConfig.RootCAs == nil || clientTLSConfig.InsecureSkipVerify {
- t.Fatalf("GetClientTLSConfig failed")
- }
-}
diff --git a/pkg/util/context_grpc.go b/pkg/util/context_grpc.go
index bbb10f8..388accc 100644
--- a/pkg/util/context_grpc.go
+++ b/pkg/util/context_grpc.go
@@ -17,6 +17,7 @@ package util
import (
"context"
+
"google.golang.org/grpc/metadata"
)
diff --git a/pkg/util/context_grpc_test.go b/pkg/util/context_grpc_test.go
index e97b7c0..e3e5a92 100644
--- a/pkg/util/context_grpc_test.go
+++ b/pkg/util/context_grpc_test.go
@@ -18,8 +18,9 @@ package util
import (
"context"
- "google.golang.org/grpc/metadata"
"testing"
+
+ "google.golang.org/grpc/metadata"
)
func TestFromMetadata(t *testing.T) {
diff --git a/pkg/util/sys.go b/pkg/util/sys.go
index ad705a3..dcc48b5 100644
--- a/pkg/util/sys.go
+++ b/pkg/util/sys.go
@@ -18,10 +18,11 @@
package util
import (
- "github.com/prometheus/procfs"
"os"
"strconv"
"unsafe"
+
+ "github.com/prometheus/procfs"
)
const intSize = int(unsafe.Sizeof(0))
@@ -77,8 +78,9 @@ func GetEnvString(name string, def string) string {
func GetProcCPUUsage() (pt float64, ct float64) {
p, _ := procfs.NewProc(os.Getpid())
- stat, _ := procfs.NewStat()
- pstat, _ := p.NewStat()
+ fs, _ := procfs.NewDefaultFS()
+ stat, _ := fs.Stat()
+ pstat, _ := p.Stat()
ct = stat.CPUTotal.User + stat.CPUTotal.Nice + stat.CPUTotal.System +
stat.CPUTotal.Idle + stat.CPUTotal.Iowait + stat.CPUTotal.IRQ +
stat.CPUTotal.SoftIRQ + stat.CPUTotal.Steal + stat.CPUTotal.Guest
diff --git a/pkg/util/uuid.go b/pkg/util/uuid.go
index 53375b0..c553c8e 100644
--- a/pkg/util/uuid.go
+++ b/pkg/util/uuid.go
@@ -18,12 +18,13 @@
package util
import (
- "github.com/satori/go.uuid"
"strings"
+
+ uuid "github.com/satori/go.uuid"
)
const DASH = "-"
func GenerateUUID() string {
- return strings.Replace(uuid.NewV1().String(), string(DASH), "", -1)
+ return strings.Replace(uuid.NewV1().String(), DASH, "", -1)
}
diff --git a/pkg/validate/rule.go b/pkg/validate/rule.go
index c43cf70..abae379 100644
--- a/pkg/validate/rule.go
+++ b/pkg/validate/rule.go
@@ -19,9 +19,10 @@ package validate
import (
"fmt"
- "github.com/apache/servicecomb-service-center/pkg/util"
"reflect"
"unicode/utf8"
+
+ "github.com/apache/servicecomb-service-center/pkg/util"
)
type Rule struct {
diff --git a/pkg/validate/validator.go b/pkg/validate/validator.go
index 6eb1650..60b02af 100644
--- a/pkg/validate/validator.go
+++ b/pkg/validate/validator.go
@@ -20,9 +20,10 @@ package validate
import (
"errors"
"fmt"
- "github.com/apache/servicecomb-service-center/pkg/util"
"reflect"
"sync"
+
+ "github.com/apache/servicecomb-service-center/pkg/util"
)
type Validator struct {
diff --git a/scctl/bootstrap/bootstrap.go b/scctl/bootstrap/bootstrap.go
index 6bd12ae..0b41917 100644
--- a/scctl/bootstrap/bootstrap.go
+++ b/scctl/bootstrap/bootstrap.go
@@ -15,10 +15,12 @@
package bootstrap
-import _ "github.com/apache/servicecomb-service-center/scctl/pkg/plugin/version"
-import _ "github.com/apache/servicecomb-service-center/scctl/pkg/plugin/diagnose"
-import _ "github.com/apache/servicecomb-service-center/scctl/pkg/plugin/get/service"
-import _ "github.com/apache/servicecomb-service-center/scctl/pkg/plugin/get/instance"
-import _ "github.com/apache/servicecomb-service-center/scctl/pkg/plugin/get/schema"
-import _ "github.com/apache/servicecomb-service-center/scctl/pkg/plugin/get/cluster"
-import _ "github.com/apache/servicecomb-service-center/scctl/pkg/plugin/health"
+import (
+ _ "github.com/apache/servicecomb-service-center/scctl/pkg/plugin/diagnose"
+ _ "github.com/apache/servicecomb-service-center/scctl/pkg/plugin/get/cluster"
+ _ "github.com/apache/servicecomb-service-center/scctl/pkg/plugin/get/instance"
+ _ "github.com/apache/servicecomb-service-center/scctl/pkg/plugin/get/schema"
+ _ "github.com/apache/servicecomb-service-center/scctl/pkg/plugin/get/service"
+ _ "github.com/apache/servicecomb-service-center/scctl/pkg/plugin/health"
+ _ "github.com/apache/servicecomb-service-center/scctl/pkg/plugin/version"
+)
diff --git a/scctl/etcd/client.go b/scctl/etcd/client.go
index c8eb312..29f1555 100644
--- a/scctl/etcd/client.go
+++ b/scctl/etcd/client.go
@@ -17,11 +17,12 @@ package etcd
import (
"crypto/tls"
- "github.com/apache/servicecomb-service-center/pkg/tlsutil"
- "github.com/coreos/etcd/clientv3"
"io/ioutil"
"strings"
"time"
+
+ "github.com/coreos/etcd/clientv3"
+ "github.com/go-chassis/foundation/tlsutil"
)
func NewEtcdClient(cfg Config) (*clientv3.Client, error) {
diff --git a/scctl/pkg/cmd/cmd.go b/scctl/pkg/cmd/cmd.go
index 2ad24e0..dd10ccd 100644
--- a/scctl/pkg/cmd/cmd.go
+++ b/scctl/pkg/cmd/cmd.go
@@ -17,12 +17,13 @@ package cmd
import (
"fmt"
+ "os"
+ "time"
+
"github.com/apache/servicecomb-service-center/client"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/scctl/pkg/version"
"github.com/spf13/cobra"
- "os"
- "time"
)
const (
diff --git a/scctl/pkg/cmd/help.go b/scctl/pkg/cmd/help.go
index d36df6a..dd4a74e 100644
--- a/scctl/pkg/cmd/help.go
+++ b/scctl/pkg/cmd/help.go
@@ -18,14 +18,15 @@ package cmd
import (
"bytes"
"fmt"
- "github.com/apache/servicecomb-service-center/scctl/pkg/version"
- "github.com/spf13/cobra"
- "github.com/spf13/pflag"
"io"
"os"
"strings"
"text/tabwriter"
"text/template"
+
+ "github.com/apache/servicecomb-service-center/scctl/pkg/version"
+ "github.com/spf13/cobra"
+ "github.com/spf13/pflag"
)
var (
diff --git a/scctl/pkg/model/types.go b/scctl/pkg/model/types.go
index 022c5ec..8a4689c 100644
--- a/scctl/pkg/model/types.go
+++ b/scctl/pkg/model/types.go
@@ -16,12 +16,13 @@
package model
import (
+ "strconv"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/model"
"github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/core"
- "strconv"
- "time"
)
func GetDomainProject(resource interface{}) (domainProject string) {
diff --git a/scctl/pkg/plugin/diagnose/cmd.go b/scctl/pkg/plugin/diagnose/cmd.go
index a0e5f3d..3e6b98f 100644
--- a/scctl/pkg/plugin/diagnose/cmd.go
+++ b/scctl/pkg/plugin/diagnose/cmd.go
@@ -16,11 +16,12 @@
package diagnose
import (
+ "path/filepath"
+
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/scctl/etcd"
root "github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
"github.com/spf13/cobra"
- "path/filepath"
)
var EtcdClientConfig etcd.Config
diff --git a/scctl/pkg/plugin/diagnose/compare_holder.go b/scctl/pkg/plugin/diagnose/compare_holder.go
index dffa797..95f1ff5 100644
--- a/scctl/pkg/plugin/diagnose/compare_holder.go
+++ b/scctl/pkg/plugin/diagnose/compare_holder.go
@@ -18,6 +18,7 @@ package diagnose
import (
"context"
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/model"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
diff --git a/scctl/pkg/plugin/diagnose/compare_holder_test.go b/scctl/pkg/plugin/diagnose/compare_holder_test.go
index caf68bd..b1fe607 100644
--- a/scctl/pkg/plugin/diagnose/compare_holder_test.go
+++ b/scctl/pkg/plugin/diagnose/compare_holder_test.go
@@ -16,10 +16,11 @@
package diagnose
import (
+ "testing"
+
model2 "github.com/apache/servicecomb-service-center/pkg/model"
"github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/coreos/etcd/mvcc/mvccpb"
- "testing"
)
func TestAbstractCompareHolder_Compare(t *testing.T) {
diff --git a/scctl/pkg/plugin/diagnose/diagnose.go b/scctl/pkg/plugin/diagnose/diagnose.go
index cf6cc78..dec4a59 100644
--- a/scctl/pkg/plugin/diagnose/diagnose.go
+++ b/scctl/pkg/plugin/diagnose/diagnose.go
@@ -19,6 +19,7 @@ import (
"bytes"
"context"
"fmt"
+
"github.com/apache/servicecomb-service-center/client"
"github.com/apache/servicecomb-service-center/pkg/model"
"github.com/apache/servicecomb-service-center/scctl/etcd"
diff --git a/scctl/pkg/plugin/diagnose/diagnose_test.go b/scctl/pkg/plugin/diagnose/diagnose_test.go
index 05e7c45..a3a47d5 100644
--- a/scctl/pkg/plugin/diagnose/diagnose_test.go
+++ b/scctl/pkg/plugin/diagnose/diagnose_test.go
@@ -17,10 +17,11 @@ package diagnose
import (
"fmt"
+ "testing"
+
model2 "github.com/apache/servicecomb-service-center/pkg/model"
"github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/coreos/etcd/mvcc/mvccpb"
- "testing"
)
func TestNewDiagnoseCommand(t *testing.T) {
diff --git a/scctl/pkg/plugin/get/cluster/cluster_cmd.go b/scctl/pkg/plugin/get/cluster/cluster_cmd.go
index f98b0c1..2493334 100644
--- a/scctl/pkg/plugin/get/cluster/cluster_cmd.go
+++ b/scctl/pkg/plugin/get/cluster/cluster_cmd.go
@@ -17,6 +17,7 @@ package cluster
import (
"context"
+
"github.com/apache/servicecomb-service-center/client"
"github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
"github.com/apache/servicecomb-service-center/scctl/pkg/plugin/get"
diff --git a/scctl/pkg/plugin/get/instance/instance_cmd.go b/scctl/pkg/plugin/get/instance/instance_cmd.go
index 4dd06fb..3007547 100644
--- a/scctl/pkg/plugin/get/instance/instance_cmd.go
+++ b/scctl/pkg/plugin/get/instance/instance_cmd.go
@@ -17,6 +17,8 @@ package instance
import (
"context"
+ "strings"
+
"github.com/apache/servicecomb-service-center/client"
model2 "github.com/apache/servicecomb-service-center/pkg/model"
"github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
@@ -25,7 +27,6 @@ import (
"github.com/apache/servicecomb-service-center/scctl/pkg/writer"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/spf13/cobra"
- "strings"
)
func init() {
diff --git a/scctl/pkg/plugin/get/instance/printer.go b/scctl/pkg/plugin/get/instance/printer.go
index a6bde87..d1a1344 100644
--- a/scctl/pkg/plugin/get/instance/printer.go
+++ b/scctl/pkg/plugin/get/instance/printer.go
@@ -16,10 +16,11 @@
package instance
import (
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/scctl/pkg/model"
"github.com/apache/servicecomb-service-center/scctl/pkg/writer"
- "time"
)
const neverExpire = "Never"
diff --git a/scctl/pkg/plugin/get/schema/schema_cmd.go b/scctl/pkg/plugin/get/schema/schema_cmd.go
index 97b1941..9877a81 100644
--- a/scctl/pkg/plugin/get/schema/schema_cmd.go
+++ b/scctl/pkg/plugin/get/schema/schema_cmd.go
@@ -18,20 +18,21 @@ package schema
import (
"context"
"fmt"
+ "io"
+ "io/ioutil"
+ "os"
+ "path/filepath"
+ "strings"
+
"github.com/apache/servicecomb-service-center/client"
model2 "github.com/apache/servicecomb-service-center/pkg/model"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
"github.com/apache/servicecomb-service-center/scctl/pkg/model"
"github.com/apache/servicecomb-service-center/scctl/pkg/plugin/get"
- "github.com/apache/servicecomb-service-center/scctl/pkg/progress-bar"
+ pb "github.com/apache/servicecomb-service-center/scctl/pkg/progress-bar"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/spf13/cobra"
- "io"
- "io/ioutil"
- "os"
- "path/filepath"
- "strings"
)
var (
diff --git a/scctl/pkg/plugin/get/schema/writer.go b/scctl/pkg/plugin/get/schema/writer.go
index 097831e..1777760 100644
--- a/scctl/pkg/plugin/get/schema/writer.go
+++ b/scctl/pkg/plugin/get/schema/writer.go
@@ -16,9 +16,10 @@
package schema
import (
- pb "github.com/apache/servicecomb-service-center/pkg/registry"
"os"
"path/filepath"
+
+ pb "github.com/apache/servicecomb-service-center/pkg/registry"
)
type Config struct {
diff --git a/scctl/pkg/plugin/get/service/service_cmd.go b/scctl/pkg/plugin/get/service/service_cmd.go
index b7145d0..66039f0 100644
--- a/scctl/pkg/plugin/get/service/service_cmd.go
+++ b/scctl/pkg/plugin/get/service/service_cmd.go
@@ -17,6 +17,8 @@ package service
import (
"context"
+ "strings"
+
"github.com/apache/servicecomb-service-center/client"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
@@ -25,7 +27,6 @@ import (
"github.com/apache/servicecomb-service-center/scctl/pkg/writer"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/spf13/cobra"
- "strings"
)
func init() {
diff --git a/scctl/pkg/plugin/health/cmd.go b/scctl/pkg/plugin/health/cmd.go
index 4431bc4..452c8dc 100644
--- a/scctl/pkg/plugin/health/cmd.go
+++ b/scctl/pkg/plugin/health/cmd.go
@@ -17,6 +17,7 @@ package health
import (
"context"
+
"github.com/apache/servicecomb-service-center/client"
"github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
diff --git a/scctl/pkg/plugin/version/cmd.go b/scctl/pkg/plugin/version/cmd.go
index 925a4e4..de9b58b 100644
--- a/scctl/pkg/plugin/version/cmd.go
+++ b/scctl/pkg/plugin/version/cmd.go
@@ -18,6 +18,7 @@ package version
import (
"context"
"fmt"
+
"github.com/apache/servicecomb-service-center/client"
"github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
"github.com/apache/servicecomb-service-center/scctl/pkg/version"
diff --git a/scctl/pkg/progress-bar/progress-bar.go b/scctl/pkg/progress-bar/progress-bar.go
index 96acae9..e426ab2 100644
--- a/scctl/pkg/progress-bar/progress-bar.go
+++ b/scctl/pkg/progress-bar/progress-bar.go
@@ -16,8 +16,9 @@
package pb
import (
- "github.com/cheggaaa/pb"
"io"
+
+ "github.com/cheggaaa/pb"
)
func NewProgressBar(count int, w io.Writer) *pb.ProgressBar {
diff --git a/scctl/pkg/writer/writer.go b/scctl/pkg/writer/writer.go
index 310ba57..4cd62b2 100644
--- a/scctl/pkg/writer/writer.go
+++ b/scctl/pkg/writer/writer.go
@@ -16,11 +16,12 @@
package writer
import (
- "github.com/olekukonko/tablewriter"
"os"
"sort"
"strconv"
"time"
+
+ "github.com/olekukonko/tablewriter"
)
const Day = time.Hour * 24
diff --git a/server/alarm/common.go b/server/alarm/common.go
index 49f8fd0..f74fe36 100644
--- a/server/alarm/common.go
+++ b/server/alarm/common.go
@@ -17,6 +17,7 @@ package alarm
import (
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/event"
"github.com/apache/servicecomb-service-center/server/alarm/model"
)
diff --git a/server/alarm/service.go b/server/alarm/service.go
index 3ef5e07..6b3cc1b 100644
--- a/server/alarm/service.go
+++ b/server/alarm/service.go
@@ -16,12 +16,13 @@
package alarm
import (
+ "sync"
+
nf "github.com/apache/servicecomb-service-center/pkg/event"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/alarm/model"
"github.com/apache/servicecomb-service-center/server/event"
- "sync"
)
var (
diff --git a/server/api.go b/server/api.go
index a98b9ad..ef1474f 100644
--- a/server/api.go
+++ b/server/api.go
@@ -20,6 +20,9 @@ package server
import (
"context"
"fmt"
+ "net"
+ "strconv"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/grace"
"github.com/apache/servicecomb-service-center/pkg/log"
@@ -28,8 +31,6 @@ import (
"github.com/apache/servicecomb-service-center/server/core/backend"
rs "github.com/apache/servicecomb-service-center/server/rest"
"github.com/apache/servicecomb-service-center/server/service"
- "net"
- "strconv"
)
var apiServer *APIServer
diff --git a/server/bootstrap/bootstrap.go b/server/bootstrap/bootstrap.go
index 847cc8a..e1898d2 100644
--- a/server/bootstrap/bootstrap.go
+++ b/server/bootstrap/bootstrap.go
@@ -17,59 +17,64 @@
package bootstrap
//rest v3 api
-import _ "github.com/apache/servicecomb-service-center/server/rest/controller/v3"
+import (
+ _ "github.com/apache/servicecomb-service-center/server/rest/controller/v3"
-// rest v4 api
-import _ "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
+ // rest v4 api
+ _ "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
-//registry is buildin
-import _ "github.com/apache/servicecomb-service-center/server/plugin/registry/buildin"
+ //registry is buildin
+ _ "github.com/apache/servicecomb-service-center/server/plugin/registry/buildin"
-//registry etcd
-import _ "github.com/apache/servicecomb-service-center/server/plugin/registry/etcd"
+ //registry etcd
+ _ "github.com/apache/servicecomb-service-center/server/plugin/registry/etcd"
-//registry etcd
-import _ "github.com/apache/servicecomb-service-center/server/plugin/registry/embededetcd"
+ //registry etcd
+ _ "github.com/apache/servicecomb-service-center/server/plugin/registry/embededetcd"
-//discovery
-import _ "github.com/apache/servicecomb-service-center/server/plugin/discovery/aggregate"
-import _ "github.com/apache/servicecomb-service-center/server/plugin/discovery/servicecenter"
-import _ "github.com/apache/servicecomb-service-center/server/plugin/discovery/etcd"
-import _ "github.com/apache/servicecomb-service-center/server/plugin/discovery/k8s"
+ //discovery
+ _ "github.com/apache/servicecomb-service-center/server/plugin/discovery/aggregate"
-//cipher
-import _ "github.com/apache/servicecomb-service-center/server/plugin/security/buildin"
+ _ "github.com/apache/servicecomb-service-center/server/plugin/discovery/servicecenter"
-//quota
-import _ "github.com/apache/servicecomb-service-center/server/plugin/quota/buildin"
-import _ "github.com/apache/servicecomb-service-center/server/plugin/quota/unlimit"
+ _ "github.com/apache/servicecomb-service-center/server/plugin/discovery/etcd"
-//auth
-import _ "github.com/apache/servicecomb-service-center/server/plugin/auth/buildin"
+ _ "github.com/apache/servicecomb-service-center/server/plugin/discovery/k8s"
-//uuid
-import _ "github.com/apache/servicecomb-service-center/server/plugin/uuid/buildin"
-import _ "github.com/apache/servicecomb-service-center/server/plugin/uuid/context"
+ //cipher
+ _ "github.com/apache/servicecomb-service-center/server/plugin/security/buildin"
-//tracing
-import _ "github.com/apache/servicecomb-service-center/server/plugin/tracing/pzipkin"
+ //quota
+ _ "github.com/apache/servicecomb-service-center/server/plugin/quota/buildin"
-//tls
-import _ "github.com/apache/servicecomb-service-center/server/plugin/tls/buildin"
+ _ "github.com/apache/servicecomb-service-center/server/plugin/quota/unlimit"
-//module 'govern'
-import _ "github.com/apache/servicecomb-service-center/server/rest/govern"
+ //auth
+ _ "github.com/apache/servicecomb-service-center/server/plugin/auth/buildin"
-//module 'broker'
-import _ "github.com/apache/servicecomb-service-center/server/broker"
+ //uuid
+ _ "github.com/apache/servicecomb-service-center/server/plugin/uuid/buildin"
-//module 'admin'
-import _ "github.com/apache/servicecomb-service-center/server/rest/admin"
+ _ "github.com/apache/servicecomb-service-center/server/plugin/uuid/context"
-//metrics
-import _ "github.com/apache/servicecomb-service-center/server/metric"
+ //tracing
+ _ "github.com/apache/servicecomb-service-center/server/plugin/tracing/pzipkin"
+
+ //tls
+ _ "github.com/apache/servicecomb-service-center/server/plugin/tls/buildin"
+
+ //module 'govern'
+ _ "github.com/apache/servicecomb-service-center/server/rest/govern"
+
+ //module 'broker'
+ _ "github.com/apache/servicecomb-service-center/server/broker"
+
+ //module 'admin'
+ _ "github.com/apache/servicecomb-service-center/server/rest/admin"
+
+ //metrics
+ _ "github.com/apache/servicecomb-service-center/server/metric"
-import (
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/server/handler/accesslog"
"github.com/apache/servicecomb-service-center/server/handler/auth"
diff --git a/server/broker/broker_suite_test.go b/server/broker/broker_suite_test.go
index 24a5341..3b6b050 100644
--- a/server/broker/broker_suite_test.go
+++ b/server/broker/broker_suite_test.go
@@ -16,16 +16,19 @@
*/
package broker_test
-import _ "github.com/apache/servicecomb-service-center/server/bootstrap"
import (
+ "testing"
+
+ _ "github.com/apache/servicecomb-service-center/server/bootstrap"
+
+ . "github.com/onsi/ginkgo"
+ . "github.com/onsi/gomega"
+
"github.com/apache/servicecomb-service-center/server/broker"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/service"
"github.com/astaxie/beego"
- . "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
- . "github.com/onsi/gomega"
- "testing"
)
func init() {
diff --git a/server/broker/controller.go b/server/broker/controller.go
index a5c1063..d99f8c7 100644
--- a/server/broker/controller.go
+++ b/server/broker/controller.go
@@ -19,11 +19,12 @@ package broker
import (
"encoding/json"
- "github.com/apache/servicecomb-service-center/pkg/log"
"io/ioutil"
"net/http"
"strconv"
+ "github.com/apache/servicecomb-service-center/pkg/log"
+
"github.com/apache/servicecomb-service-center/pkg/rest"
"github.com/apache/servicecomb-service-center/server/broker/brokerpb"
"github.com/apache/servicecomb-service-center/server/rest/controller"
diff --git a/server/broker/service.go b/server/broker/service.go
index 02c3e5a..93941ab 100644
--- a/server/broker/service.go
+++ b/server/broker/service.go
@@ -20,13 +20,15 @@ package broker
import (
"crypto/sha1"
"encoding/json"
- "github.com/apache/servicecomb-service-center/server/core/proto"
"math"
"strconv"
"strings"
"time"
+ "github.com/apache/servicecomb-service-center/server/core/proto"
+
"context"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/server/broker/service_test.go b/server/broker/service_test.go
index 63c79d4..4be6409 100644
--- a/server/broker/service_test.go
+++ b/server/broker/service_test.go
@@ -18,9 +18,11 @@ package broker_test
import (
"fmt"
+
"github.com/apache/servicecomb-service-center/server/core/proto"
"context"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/broker"
diff --git a/server/broker/util.go b/server/broker/util.go
index 000971a..9f738b2 100644
--- a/server/broker/util.go
+++ b/server/broker/util.go
@@ -20,13 +20,16 @@ package broker
import (
"context"
"encoding/json"
- "github.com/apache/servicecomb-service-center/server/core/proto"
- "github.com/apache/servicecomb-service-center/server/service/kv"
"math"
"net/url"
"strconv"
"strings"
+ "github.com/apache/servicecomb-service-center/server/core/proto"
+ "github.com/apache/servicecomb-service-center/server/service/kv"
+
+ "path/filepath"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
@@ -36,7 +39,6 @@ import (
"github.com/apache/servicecomb-service-center/server/plugin/registry"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
- "path/filepath"
)
var PactLogger *log.Logger
diff --git a/server/connection/grpc/stream.go b/server/connection/grpc/stream.go
index 0e5415e..690813c 100644
--- a/server/connection/grpc/stream.go
+++ b/server/connection/grpc/stream.go
@@ -20,12 +20,13 @@ package grpc
import (
"context"
"errors"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/connection"
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/event"
- "time"
)
const GRPC = "gRPC"
diff --git a/server/connection/grpc/stream_test.go b/server/connection/grpc/stream_test.go
index c549b65..ea07c3d 100644
--- a/server/connection/grpc/stream_test.go
+++ b/server/connection/grpc/stream_test.go
@@ -18,14 +18,15 @@ package grpc_test
import (
"context"
+ "testing"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
simple "github.com/apache/servicecomb-service-center/pkg/time"
stream "github.com/apache/servicecomb-service-center/server/connection/grpc"
"github.com/apache/servicecomb-service-center/server/event"
"google.golang.org/grpc"
- "testing"
- "time"
)
type grpcWatchServer struct {
diff --git a/server/connection/metrics.go b/server/connection/metrics.go
index a83b229..26f34e0 100644
--- a/server/connection/metrics.go
+++ b/server/connection/metrics.go
@@ -18,10 +18,11 @@
package connection
import (
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/event"
"github.com/apache/servicecomb-service-center/server/metric"
"github.com/prometheus/client_golang/prometheus"
- "time"
)
const (
diff --git a/server/connection/ws/broker.go b/server/connection/ws/broker.go
index e4901ff..12aa5e4 100644
--- a/server/connection/ws/broker.go
+++ b/server/connection/ws/broker.go
@@ -21,6 +21,7 @@ import (
"context"
"encoding/json"
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/server/connection/ws/broker_test.go b/server/connection/ws/broker_test.go
index a3597c3..2c95501 100644
--- a/server/connection/ws/broker_test.go
+++ b/server/connection/ws/broker_test.go
@@ -19,10 +19,11 @@ package ws_test
import (
"context"
+ "testing"
+
"github.com/apache/servicecomb-service-center/server/connection/ws"
"github.com/apache/servicecomb-service-center/server/event"
"github.com/stretchr/testify/assert"
- "testing"
)
func TestNewBroker(t *testing.T) {
diff --git a/server/connection/ws/common.go b/server/connection/ws/common.go
index 0132202..e41e8a1 100644
--- a/server/connection/ws/common.go
+++ b/server/connection/ws/common.go
@@ -20,6 +20,7 @@ package ws
import (
"context"
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/server/connection/ws/health_check_test.go b/server/connection/ws/health_check_test.go
index 7ab0578..9928f3e 100644
--- a/server/connection/ws/health_check_test.go
+++ b/server/connection/ws/health_check_test.go
@@ -18,9 +18,10 @@
package ws_test
import (
+ "testing"
+
"github.com/apache/servicecomb-service-center/server/connection/ws"
"github.com/stretchr/testify/assert"
- "testing"
)
func TestNewHealthCheck(t *testing.T) {
diff --git a/server/connection/ws/websocket_test.go b/server/connection/ws/websocket_test.go
index cd4ad8b..1964b6e 100644
--- a/server/connection/ws/websocket_test.go
+++ b/server/connection/ws/websocket_test.go
@@ -17,8 +17,6 @@
package ws_test
import (
- _ "github.com/apache/servicecomb-service-center/test"
-
"context"
"net/http"
"net/http/httptest"
@@ -26,6 +24,8 @@ import (
"testing"
"time"
+ _ "github.com/apache/servicecomb-service-center/test"
+
wss "github.com/apache/servicecomb-service-center/server/connection/ws"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/event"
diff --git a/server/core/backend/common.go b/server/core/backend/common.go
index 53fa826..290eb00 100644
--- a/server/core/backend/common.go
+++ b/server/core/backend/common.go
@@ -16,10 +16,11 @@
package backend
import (
+ "time"
+
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
- "time"
)
const (
diff --git a/server/core/backend/defer_instance.go b/server/core/backend/defer_instance.go
index ffd801d..ed83d05 100644
--- a/server/core/backend/defer_instance.go
+++ b/server/core/backend/defer_instance.go
@@ -19,13 +19,14 @@ package backend
import (
"context"
+ "sync"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
- "sync"
- "time"
)
type deferItem struct {
diff --git a/server/core/backend/defer_instance_test.go b/server/core/backend/defer_instance_test.go
index fbefa28..23c9a40 100644
--- a/server/core/backend/defer_instance_test.go
+++ b/server/core/backend/defer_instance_test.go
@@ -18,11 +18,12 @@ package backend
import (
"fmt"
+ "testing"
+ "time"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
- "testing"
- "time"
)
type mockCache struct {
diff --git a/server/core/backend/defer_lease.go b/server/core/backend/defer_lease.go
index 332456e..d047e6b 100644
--- a/server/core/backend/defer_lease.go
+++ b/server/core/backend/defer_lease.go
@@ -21,6 +21,8 @@ import (
"context"
"encoding/json"
"fmt"
+ "sync"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
rmodel "github.com/apache/servicecomb-service-center/pkg/registry"
@@ -28,7 +30,6 @@ import (
apt "github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
- "sync"
)
type LeaseEventDeferHandler struct {
diff --git a/server/core/backend/discovery.go b/server/core/backend/discovery.go
index 304847c..c2c8b3b 100644
--- a/server/core/backend/discovery.go
+++ b/server/core/backend/discovery.go
@@ -20,6 +20,8 @@ package backend
import (
"context"
"errors"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/task"
@@ -28,7 +30,6 @@ import (
"github.com/apache/servicecomb-service-center/server/plugin"
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
- "time"
)
var store = &KvStore{}
diff --git a/server/core/backend/discovery_test.go b/server/core/backend/discovery_test.go
index f5ddd01..936172f 100644
--- a/server/core/backend/discovery_test.go
+++ b/server/core/backend/discovery_test.go
@@ -19,10 +19,11 @@ package backend
import (
"context"
"errors"
+ "testing"
+
"github.com/apache/servicecomb-service-center/pkg/task"
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
- "testing"
)
var closedCh = make(chan struct{})
diff --git a/server/core/backend/lease.go b/server/core/backend/lease.go
index 39b3691..48db8a4 100644
--- a/server/core/backend/lease.go
+++ b/server/core/backend/lease.go
@@ -19,12 +19,13 @@ package backend
import (
"context"
+ "time"
+
errorsEx "github.com/apache/servicecomb-service-center/pkg/errors"
"github.com/apache/servicecomb-service-center/pkg/log"
simple "github.com/apache/servicecomb-service-center/pkg/time"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
- "time"
)
type LeaseTask struct {
diff --git a/server/core/backend/lease_test.go b/server/core/backend/lease_test.go
index 4765c51..ac20a9e 100644
--- a/server/core/backend/lease_test.go
+++ b/server/core/backend/lease_test.go
@@ -19,11 +19,12 @@ package backend
import (
"context"
"fmt"
+ "testing"
+ "time"
+
errorsEx "github.com/apache/servicecomb-service-center/pkg/errors"
simple "github.com/apache/servicecomb-service-center/pkg/time"
"github.com/apache/servicecomb-service-center/server/plugin/registry/buildin"
- "testing"
- "time"
)
type mockRegistry struct {
diff --git a/server/core/backend/metrics.go b/server/core/backend/metrics.go
index e9f8e0b..07170c5 100644
--- a/server/core/backend/metrics.go
+++ b/server/core/backend/metrics.go
@@ -18,9 +18,10 @@
package backend
import (
+ "time"
+
"github.com/apache/servicecomb-service-center/server/metric"
"github.com/prometheus/client_golang/prometheus"
- "time"
)
const (
diff --git a/server/core/backend/registry.go b/server/core/backend/registry.go
index 31a0789..6525868 100644
--- a/server/core/backend/registry.go
+++ b/server/core/backend/registry.go
@@ -21,6 +21,9 @@ import (
"context"
"errors"
"fmt"
+ "sync"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/backoff"
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
@@ -28,8 +31,6 @@ import (
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/plugin"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
- "sync"
- "time"
)
var (
diff --git a/server/core/config.go b/server/core/config.go
index 2759ee9..a3457bb 100644
--- a/server/core/config.go
+++ b/server/core/config.go
@@ -18,12 +18,13 @@
package core
import (
- "github.com/apache/servicecomb-service-center/server/core/proto"
- "github.com/go-chassis/go-archaius"
"os"
"runtime"
"time"
+ "github.com/apache/servicecomb-service-center/server/core/proto"
+ "github.com/go-chassis/go-archaius"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/plugin"
"github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/server/core/core.go b/server/core/core.go
index 69d00ff..d2374dc 100644
--- a/server/core/core.go
+++ b/server/core/core.go
@@ -19,14 +19,16 @@ package core
import (
"flag"
- // import the grace package and parse grace cmd line
- _ "github.com/apache/servicecomb-service-center/pkg/grace"
- "github.com/apache/servicecomb-service-center/pkg/log"
- "github.com/apache/servicecomb-service-center/version"
"os"
"os/signal"
"syscall"
"time"
+
+ // import the grace package and parse grace cmd line
+ _ "github.com/apache/servicecomb-service-center/pkg/grace"
+
+ "github.com/apache/servicecomb-service-center/pkg/log"
+ "github.com/apache/servicecomb-service-center/version"
)
func Initialize() {
diff --git a/server/core/key_convertor.go b/server/core/key_convertor.go
index d0efac7..ffbb87a 100644
--- a/server/core/key_convertor.go
+++ b/server/core/key_convertor.go
@@ -17,9 +17,10 @@ package core
import (
"fmt"
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
- "strings"
)
func KvToResponse(key []byte) (keys []string) {
diff --git a/server/core/key_convertor_test.go b/server/core/key_convertor_test.go
index a716607..454a9f6 100644
--- a/server/core/key_convertor_test.go
+++ b/server/core/key_convertor_test.go
@@ -17,8 +17,9 @@
package core
import (
- "github.com/apache/servicecomb-service-center/pkg/registry"
"testing"
+
+ "github.com/apache/servicecomb-service-center/pkg/registry"
)
func TestGetInfoFromKV(t *testing.T) {
diff --git a/server/core/key_generator_test.go b/server/core/key_generator_test.go
index fc8999d..86784cd 100644
--- a/server/core/key_generator_test.go
+++ b/server/core/key_generator_test.go
@@ -16,9 +16,10 @@
package core
import (
+ "testing"
+
"github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/stretchr/testify/assert"
- "testing"
)
func TestGenerateAccountKey(t *testing.T) {
diff --git a/server/core/microservice.go b/server/core/microservice.go
index 18de54d..ee48121 100644
--- a/server/core/microservice.go
+++ b/server/core/microservice.go
@@ -19,13 +19,14 @@ package core
import (
"context"
+ "os"
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/version"
"github.com/astaxie/beego"
- "os"
- "strings"
)
var (
diff --git a/server/core/microservice_test.go b/server/core/microservice_test.go
index b125af2..36d5939 100644
--- a/server/core/microservice_test.go
+++ b/server/core/microservice_test.go
@@ -17,10 +17,11 @@ package core
import (
"context"
- "github.com/apache/servicecomb-service-center/pkg/registry"
- "github.com/astaxie/beego"
"os"
"testing"
+
+ "github.com/apache/servicecomb-service-center/pkg/registry"
+ "github.com/astaxie/beego"
)
func TestPrepareSelfRegistration(t *testing.T) {
diff --git a/server/core/proto/parser.go b/server/core/proto/parser.go
index ec7e408..6a48dd3 100644
--- a/server/core/proto/parser.go
+++ b/server/core/proto/parser.go
@@ -18,13 +18,14 @@ package proto
import (
"encoding/json"
"errors"
+
"github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
)
var (
- errParseNilPoint = errors.New("parse nil point")
- errTargetNilPoint = errors.New("target is nil point")
+ ErrParseNilPoint = errors.New("parse nil point")
+ ErrTargetNilPoint = errors.New("target is nil point")
)
// new
@@ -47,16 +48,16 @@ type ParseValueFunc func(src []byte, dist interface{}) error
var (
UnParse ParseValueFunc = func(src []byte, dist interface{}) error {
- if err := check(src, dist); err != nil {
- return err
+ if dist == nil {
+ return ErrTargetNilPoint
}
d := dist.(*interface{})
*d = src
return nil
}
TextUnmarshal ParseValueFunc = func(src []byte, dist interface{}) error {
- if err := check(src, dist); err != nil {
- return err
+ if dist == nil {
+ return ErrTargetNilPoint
}
d := dist.(*interface{})
*d = util.BytesToStringWithNoCopy(src)
@@ -70,7 +71,7 @@ var (
m := (*d).(map[string]string)
return json.Unmarshal(src, &m)
}
- JsonUnmarshal ParseValueFunc = func(src []byte, dist interface{}) error {
+ JSONUnmarshal ParseValueFunc = func(src []byte, dist interface{}) error {
if err := check(src, dist); err != nil {
return err
}
@@ -102,19 +103,19 @@ var (
StringParser = &CommonParser{newString, TextUnmarshal}
MapParser = &CommonParser{newMap, MapUnmarshal}
- ServiceParser = &CommonParser{newService, JsonUnmarshal}
- InstanceParser = &CommonParser{newInstance, JsonUnmarshal}
- RuleParser = &CommonParser{newRule, JsonUnmarshal}
- DependencyRuleParser = &CommonParser{newDependencyRule, JsonUnmarshal}
- DependencyQueueParser = &CommonParser{newDependencyQueue, JsonUnmarshal}
+ ServiceParser = &CommonParser{newService, JSONUnmarshal}
+ InstanceParser = &CommonParser{newInstance, JSONUnmarshal}
+ RuleParser = &CommonParser{newRule, JSONUnmarshal}
+ DependencyRuleParser = &CommonParser{newDependencyRule, JSONUnmarshal}
+ DependencyQueueParser = &CommonParser{newDependencyQueue, JSONUnmarshal}
)
func check(src []byte, dist interface{}) error {
if src == nil {
- return errParseNilPoint
+ return ErrParseNilPoint
}
if dist == nil {
- return errTargetNilPoint
+ return ErrTargetNilPoint
}
return nil
}
diff --git a/server/core/proto/parser_test.go b/server/core/proto/parser_test.go
index 1c0b4f6..da970ba 100644
--- a/server/core/proto/parser_test.go
+++ b/server/core/proto/parser_test.go
@@ -14,77 +14,60 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package proto
+package proto_test
import (
+ "testing"
+
"github.com/apache/servicecomb-service-center/pkg/registry"
+ parser "github.com/apache/servicecomb-service-center/server/core/proto"
+ "github.com/go-chassis/cari/discovery"
"github.com/stretchr/testify/assert"
- "testing"
)
func TestParseInnerValueTypeFunc(t *testing.T) {
- r, err := BytesParser.Unmarshal(nil)
- if err == nil {
- t.Fatalf("BytesParser.Unmarshal failed")
- }
- r, err = BytesParser.Unmarshal([]byte("a"))
- if err != nil {
- t.Fatalf("BytesParser.Unmarshal failed, %s", err.Error())
- }
- if v, ok := r.([]byte); !ok || v[0] != 'a' {
- t.Fatalf("BytesParser.Unmarshal failed, %s", v)
- }
+ r, err := parser.BytesParser.Unmarshal(nil)
+ assert.NoError(t, err)
+ assert.Nil(t, r.([]byte))
- r, err = StringParser.Unmarshal(nil)
- if err == nil {
- t.Fatalf("StringParser.Unmarshal failed")
- }
- r, err = StringParser.Unmarshal([]byte("abc"))
- if err != nil {
- t.Fatalf("StringParser.Unmarshal failed, %s", err.Error())
- }
- if v, ok := r.(string); !ok || v != "abc" {
- t.Fatalf("StringParser.Unmarshal failed, %s", v)
- }
+ r, err = parser.BytesParser.Unmarshal([]byte("a"))
+ assert.NoError(t, err)
+ assert.Equal(t, []byte("a"), r.([]byte))
- r, err = MapParser.Unmarshal(nil)
- if err == nil {
- t.Fatalf("MapParser.Unmarshal failed")
- }
- r, err = MapParser.Unmarshal([]byte(`{"a": "abc"}`))
- if err != nil {
- t.Fatalf("MapParser.Unmarshal failed, %s", err.Error())
- }
- if v, ok := r.(map[string]string); !ok || v["a"] != "abc" {
- t.Fatalf("MapParser.Unmarshal failed, %s", v)
- }
+ r, err = parser.StringParser.Unmarshal(nil)
+ assert.NoError(t, err)
+ assert.Equal(t, "", r.(string))
- r, err = MapParser.Unmarshal([]byte(`xxx`))
- if err == nil {
- t.Fatalf("MapParser.Unmarshal failed")
- }
+ r, err = parser.StringParser.Unmarshal([]byte("abc"))
+ assert.NoError(t, err)
+ assert.Equal(t, "abc", r.(string))
- var m interface{} = new(registry.MicroService)
- err = JsonUnmarshal(nil, nil)
- if err == nil {
- t.Fatalf("JsonUnmarshal failed")
- }
- err = JsonUnmarshal([]byte(`{"serviceName": "abc"}`), &m)
- if err != nil {
- t.Fatalf("MapParser.Unmarshal failed, %v", err)
- }
- if m.(*registry.MicroService).ServiceName != "abc" {
- t.Fatalf("MapParser.Unmarshal failed, %s", m)
- }
+ r, err = parser.MapParser.Unmarshal(nil)
+ assert.ErrorIs(t, parser.ErrParseNilPoint, err)
+
+ r, err = parser.MapParser.Unmarshal([]byte(`{"a": "abc"}`))
+ assert.NoError(t, err)
+ assert.Equal(t, map[string]string{"a": "abc"}, r.(map[string]string))
+
+ r, err = parser.MapParser.Unmarshal([]byte(`xxx`))
+ assert.Error(t, err)
+
+ var m interface{} = new(discovery.MicroService)
+ err = parser.JSONUnmarshal(nil, nil)
+ assert.ErrorIs(t, parser.ErrParseNilPoint, err)
+
+ err = parser.JSONUnmarshal([]byte(`{"serviceName": "abc"}`), &m)
+ assert.NoError(t, err)
+ assert.Equal(t, "abc", m.(*discovery.MicroService).ServiceName)
}
func TestParseValueTypeFunc(t *testing.T) {
- r, err := ServiceParser.Unmarshal([]byte(`xxx`))
+ r, err := parser.ServiceParser.Unmarshal([]byte(`xxx`))
if err == nil || r != nil {
t.Fatalf("ServiceParser.Unmarshal failed")
}
- r, err = ServiceParser.Unmarshal([]byte(`{"serviceName": "abc"}`))
+ r, err = parser.ServiceParser.Unmarshal([]byte(`{"serviceName": "abc"}`))
if err != nil {
t.Fatalf("ServiceParser.Unmarshal failed, %s", err.Error())
}
@@ -92,7 +75,7 @@ func TestParseValueTypeFunc(t *testing.T) {
assert.True(t, ok)
assert.Equal(t, "abc", v.ServiceName)
- r, err = InstanceParser.Unmarshal([]byte(`{"hostName": "abc"}`))
+ r, err = parser.InstanceParser.Unmarshal([]byte(`{"hostName": "abc"}`))
if err != nil {
t.Fatalf("InstanceParser.Unmarshal failed, %s", err.Error())
}
@@ -100,7 +83,7 @@ func TestParseValueTypeFunc(t *testing.T) {
assert.True(t, ok)
assert.Equal(t, "abc", mi.HostName)
- r, err = RuleParser.Unmarshal([]byte(`{"ruleId": "abc"}`))
+ r, err = parser.RuleParser.Unmarshal([]byte(`{"ruleId": "abc"}`))
if err != nil {
t.Fatalf("RuleParser.Unmarshal failed, %s", err.Error())
}
@@ -108,7 +91,7 @@ func TestParseValueTypeFunc(t *testing.T) {
t.Fatalf("RuleParser.Unmarshal failed, %s", v)
}
- r, err = DependencyRuleParser.Unmarshal([]byte(`{"Dependency":[{"tenant":"opsadm/southchina","appId":"csezhq","serviceName":"zhqClient","version":"1.0.0"}]}`))
+ r, err = parser.DependencyRuleParser.Unmarshal([]byte(`{"Dependency":[{"tenant":"opsadm/southchina","appId":"csezhq","serviceName":"zhqClient","version":"1.0.0"}]}`))
if err != nil {
t.Fatalf("DependencyRuleParser.Unmarshal failed, %s", err.Error())
}
diff --git a/server/core/proto/services.go b/server/core/proto/services.go
index 37d82a1..c39303c 100644
--- a/server/core/proto/services.go
+++ b/server/core/proto/services.go
@@ -18,6 +18,7 @@ package proto
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/gorilla/websocket"
)
diff --git a/server/core/proto/services.pb.go b/server/core/proto/services.pb.go
index 61f32f8..0232233 100644
--- a/server/core/proto/services.pb.go
+++ b/server/core/proto/services.pb.go
@@ -19,6 +19,7 @@ package proto
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/registry"
"google.golang.org/grpc"
)
diff --git a/server/event/instance_subscriber.go b/server/event/instance_subscriber.go
index f270fcb..62790ae 100644
--- a/server/event/instance_subscriber.go
+++ b/server/event/instance_subscriber.go
@@ -19,6 +19,7 @@ package event
import (
"errors"
+
"github.com/apache/servicecomb-service-center/pkg/event"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/server/connection"
diff --git a/server/handler/auth/auth.go b/server/handler/auth/auth.go
index 2b63263..28a6292 100644
--- a/server/handler/auth/auth.go
+++ b/server/handler/auth/auth.go
@@ -18,13 +18,14 @@
package auth
import (
+ "net/http"
+
"github.com/apache/servicecomb-service-center/pkg/chain"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/rest"
"github.com/apache/servicecomb-service-center/server/plugin"
"github.com/apache/servicecomb-service-center/server/rest/controller"
"github.com/apache/servicecomb-service-center/server/scerror"
- "net/http"
)
type Handler struct {
diff --git a/server/handler/cache/cache.go b/server/handler/cache/cache.go
index 8d3072f..fff98dd 100644
--- a/server/handler/cache/cache.go
+++ b/server/handler/cache/cache.go
@@ -18,10 +18,11 @@
package cache
import (
+ "net/http"
+
"github.com/apache/servicecomb-service-center/pkg/chain"
"github.com/apache/servicecomb-service-center/pkg/rest"
"github.com/apache/servicecomb-service-center/pkg/util"
- "net/http"
)
type Handler struct {
diff --git a/server/handler/context/context.go b/server/handler/context/context.go
index 87f55d3..caf0558 100644
--- a/server/handler/context/context.go
+++ b/server/handler/context/context.go
@@ -18,10 +18,11 @@
package context
import (
+ "net/http"
+
"github.com/apache/servicecomb-service-center/pkg/chain"
roa "github.com/apache/servicecomb-service-center/pkg/rest"
"github.com/apache/servicecomb-service-center/pkg/util"
- "net/http"
)
type Handler struct {
diff --git a/server/handler/context/v3.go b/server/handler/context/v3.go
index 6c838e9..453e1e1 100644
--- a/server/handler/context/v3.go
+++ b/server/handler/context/v3.go
@@ -18,10 +18,11 @@
package context
import (
- "github.com/apache/servicecomb-service-center/pkg/util"
- "github.com/apache/servicecomb-service-center/server/core"
"net/http"
"strings"
+
+ "github.com/apache/servicecomb-service-center/pkg/util"
+ "github.com/apache/servicecomb-service-center/server/core"
)
type v3Context struct {
diff --git a/server/handler/context/v4.go b/server/handler/context/v4.go
index 6f10157..b4723a9 100644
--- a/server/handler/context/v4.go
+++ b/server/handler/context/v4.go
@@ -18,10 +18,11 @@
package context
import (
- "github.com/apache/servicecomb-service-center/pkg/util"
- "github.com/apache/servicecomb-service-center/server/core"
"net/http"
"strings"
+
+ "github.com/apache/servicecomb-service-center/pkg/util"
+ "github.com/apache/servicecomb-service-center/server/core"
)
type v4Context struct {
diff --git a/server/handler/maxbody/maxbody.go b/server/handler/maxbody/maxbody.go
index 58c08ad..c2fa7fa 100644
--- a/server/handler/maxbody/maxbody.go
+++ b/server/handler/maxbody/maxbody.go
@@ -18,10 +18,11 @@
package maxbody
import (
+ "net/http"
+
"github.com/apache/servicecomb-service-center/pkg/chain"
"github.com/apache/servicecomb-service-center/pkg/rest"
"github.com/apache/servicecomb-service-center/server/core"
- "net/http"
)
const (
diff --git a/server/handler/metric/metric.go b/server/handler/metric/metric.go
index abd8e85..339a5ff 100644
--- a/server/handler/metric/metric.go
+++ b/server/handler/metric/metric.go
@@ -18,13 +18,14 @@
package metric
import (
+ "net/http"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/chain"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/rest"
"github.com/apache/servicecomb-service-center/server/metric/prometheus"
svr "github.com/apache/servicecomb-service-center/server/rest"
- "net/http"
- "time"
)
type MetricsHandler struct {
diff --git a/server/handler/tracing/tracing.go b/server/handler/tracing/tracing.go
index 4ff9366..12c84e2 100644
--- a/server/handler/tracing/tracing.go
+++ b/server/handler/tracing/tracing.go
@@ -18,11 +18,12 @@
package tracing
import (
+ "net/http"
+ "strconv"
+
"github.com/apache/servicecomb-service-center/pkg/chain"
"github.com/apache/servicecomb-service-center/pkg/rest"
"github.com/apache/servicecomb-service-center/server/plugin"
- "net/http"
- "strconv"
)
type Handler struct {
diff --git a/server/health/health.go b/server/health/health.go
index cbbc19e..59fc5b0 100644
--- a/server/health/health.go
+++ b/server/health/health.go
@@ -17,6 +17,7 @@ package health
import (
"errors"
+
"github.com/apache/servicecomb-service-center/server/alarm"
)
diff --git a/server/health/health_test.go b/server/health/health_test.go
index 804df1e..8e82f16 100644
--- a/server/health/health_test.go
+++ b/server/health/health_test.go
@@ -16,10 +16,11 @@
package health
import (
- "github.com/apache/servicecomb-service-center/server/alarm"
- "github.com/apache/servicecomb-service-center/server/event"
"testing"
"time"
+
+ "github.com/apache/servicecomb-service-center/server/alarm"
+ "github.com/apache/servicecomb-service-center/server/event"
)
func TestDefaultHealthChecker_Healthy(t *testing.T) {
diff --git a/server/health/metrics.go b/server/health/metrics.go
index 79e0d6a..2959aa0 100644
--- a/server/health/metrics.go
+++ b/server/health/metrics.go
@@ -17,12 +17,13 @@ package health
import (
"context"
+ "runtime"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/metric"
"github.com/prometheus/client_golang/prometheus"
- "runtime"
- "time"
)
const durationReportCPUUsage = 3 * time.Second
diff --git a/server/interceptor/access/access.go b/server/interceptor/access/access.go
index 55fe4e8..5260617 100644
--- a/server/interceptor/access/access.go
+++ b/server/interceptor/access/access.go
@@ -19,11 +19,12 @@ package access
import (
"fmt"
+ "net/http"
+
"github.com/apache/servicecomb-service-center/pkg/rest"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/pkg/validate"
"github.com/apache/servicecomb-service-center/server/core"
- "net/http"
)
var (
diff --git a/server/interceptor/cors/cors.go b/server/interceptor/cors/cors.go
index df868b2..9d3ded8 100644
--- a/server/interceptor/cors/cors.go
+++ b/server/interceptor/cors/cors.go
@@ -19,9 +19,10 @@ package cors
import (
"errors"
+ "net/http"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/rs/cors"
- "net/http"
)
var CORS *cors.Cors
diff --git a/server/interceptor/interceptors.go b/server/interceptor/interceptors.go
index 5ae4958..4e7dad2 100644
--- a/server/interceptor/interceptors.go
+++ b/server/interceptor/interceptors.go
@@ -18,10 +18,11 @@
package interceptor
import (
+ "net/http"
+
errorsEx "github.com/apache/servicecomb-service-center/pkg/errors"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
- "net/http"
)
var interceptors []*Interception
diff --git a/server/metric/calculator_test.go b/server/metric/calculator_test.go
index 41ce510..e4a356a 100644
--- a/server/metric/calculator_test.go
+++ b/server/metric/calculator_test.go
@@ -17,8 +17,9 @@
package metric
import (
- dto "github.com/prometheus/client_model/go"
"testing"
+
+ dto "github.com/prometheus/client_model/go"
)
func TestCommonCalculator_Calc(t *testing.T) {
diff --git a/server/metric/common.go b/server/metric/common.go
index 91ee450..9358283 100644
--- a/server/metric/common.go
+++ b/server/metric/common.go
@@ -18,12 +18,13 @@
package metric
import (
- "github.com/apache/servicecomb-service-center/pkg/util"
- "github.com/astaxie/beego"
"net"
"os"
"sync"
"time"
+
+ "github.com/apache/servicecomb-service-center/pkg/util"
+ "github.com/astaxie/beego"
)
const (
diff --git a/server/metric/common_test.go b/server/metric/common_test.go
index 2652bff..6de7968 100644
--- a/server/metric/common_test.go
+++ b/server/metric/common_test.go
@@ -17,10 +17,11 @@
package metric
import (
- "github.com/astaxie/beego"
"os"
"testing"
"time"
+
+ "github.com/astaxie/beego"
)
func TestInstanceName(t *testing.T) {
diff --git a/server/metric/gatherer.go b/server/metric/gatherer.go
index 7948a9d..37b58bf 100644
--- a/server/metric/gatherer.go
+++ b/server/metric/gatherer.go
@@ -19,12 +19,13 @@ package metric
import (
"context"
- "github.com/apache/servicecomb-service-center/pkg/gopool"
- "github.com/apache/servicecomb-service-center/pkg/log"
- "github.com/prometheus/client_golang/prometheus"
"strings"
"sync"
"time"
+
+ "github.com/apache/servicecomb-service-center/pkg/gopool"
+ "github.com/apache/servicecomb-service-center/pkg/log"
+ "github.com/prometheus/client_golang/prometheus"
)
// Gatherer is the reader of sc metrics
diff --git a/server/metric/metrics_test.go b/server/metric/metrics_test.go
index fd678c5..2a7c463 100644
--- a/server/metric/metrics_test.go
+++ b/server/metric/metrics_test.go
@@ -17,9 +17,10 @@
package metric
import (
- dto "github.com/prometheus/client_model/go"
"reflect"
"testing"
+
+ dto "github.com/prometheus/client_model/go"
)
func TestDetails_ForEach(t *testing.T) {
diff --git a/server/mux/mux.go b/server/mux/mux.go
index c4f9d79..6f3a33e 100644
--- a/server/mux/mux.go
+++ b/server/mux/mux.go
@@ -18,9 +18,10 @@
package mux
import (
- "github.com/apache/servicecomb-service-center/pkg/etcdsync"
"reflect"
"unsafe"
+
+ "github.com/apache/servicecomb-service-center/pkg/etcdsync"
)
type Type string
diff --git a/server/plugin/auth/buildin/buidlin_test.go b/server/plugin/auth/buildin/buidlin_test.go
index 39f09a3..61d8171 100644
--- a/server/plugin/auth/buildin/buidlin_test.go
+++ b/server/plugin/auth/buildin/buidlin_test.go
@@ -19,6 +19,11 @@ package buildin_test
import (
"context"
+ "io/ioutil"
+ "net/http"
+ "net/http/httptest"
+ "testing"
+
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
mgr "github.com/apache/servicecomb-service-center/server/plugin"
"github.com/apache/servicecomb-service-center/server/plugin/auth/buildin"
@@ -34,10 +39,6 @@ import (
"github.com/go-chassis/go-chassis/security/secret"
"github.com/go-chassis/go-chassis/server/restful"
"github.com/stretchr/testify/assert"
- "io/ioutil"
- "net/http"
- "net/http/httptest"
- "testing"
)
func init() {
diff --git a/server/plugin/auth/buildin/buildin.go b/server/plugin/auth/buildin/buildin.go
index a6640ee..0b288bd 100644
--- a/server/plugin/auth/buildin/buildin.go
+++ b/server/plugin/auth/buildin/buildin.go
@@ -20,6 +20,9 @@ package buildin
import (
"context"
"errors"
+ "net/http"
+ "strings"
+
errorsEx "github.com/apache/servicecomb-service-center/pkg/errors"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
@@ -28,8 +31,6 @@ import (
"github.com/apache/servicecomb-service-center/server/service/rbac"
"github.com/go-chassis/go-chassis/security/authr"
"github.com/go-chassis/go-chassis/server/restful"
- "net/http"
- "strings"
)
func init() {
diff --git a/server/plugin/common.go b/server/plugin/common.go
index d23a3c4..911ad54 100644
--- a/server/plugin/common.go
+++ b/server/plugin/common.go
@@ -16,9 +16,10 @@
package plugin
import (
+ pg "plugin"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/plugin"
- pg "plugin"
)
const (
diff --git a/server/plugin/discovery/aggregate/common.go b/server/plugin/discovery/aggregate/common.go
index 20f43d9..296e2a8 100644
--- a/server/plugin/discovery/aggregate/common.go
+++ b/server/plugin/discovery/aggregate/common.go
@@ -16,9 +16,10 @@
package aggregate
import (
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/astaxie/beego"
- "strings"
)
const (
diff --git a/server/plugin/discovery/aggregate/conflict_checker.go b/server/plugin/discovery/aggregate/conflict_checker.go
index 2596d2b..ae0314b 100644
--- a/server/plugin/discovery/aggregate/conflict_checker.go
+++ b/server/plugin/discovery/aggregate/conflict_checker.go
@@ -17,11 +17,12 @@ package aggregate
import (
"context"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
- "time"
)
type ConflictChecker struct {
diff --git a/server/plugin/discovery/cache_kv.go b/server/plugin/discovery/cache_kv.go
index d8b1955..711720d 100644
--- a/server/plugin/discovery/cache_kv.go
+++ b/server/plugin/discovery/cache_kv.go
@@ -17,9 +17,10 @@
package discovery
import (
- "github.com/apache/servicecomb-service-center/pkg/util"
"strings"
"sync"
+
+ "github.com/apache/servicecomb-service-center/pkg/util"
)
// KvCache implements Cache.
diff --git a/server/plugin/discovery/cacher_test.go b/server/plugin/discovery/cacher_test.go
index 97426d9..56ad9f8 100644
--- a/server/plugin/discovery/cacher_test.go
+++ b/server/plugin/discovery/cacher_test.go
@@ -16,8 +16,9 @@
package discovery
import (
- "github.com/apache/servicecomb-service-center/pkg/registry"
"testing"
+
+ "github.com/apache/servicecomb-service-center/pkg/registry"
)
func TestNewCommonCacher(t *testing.T) {
diff --git a/server/plugin/discovery/config.go b/server/plugin/discovery/config.go
index d0e53f0..b72b060 100644
--- a/server/plugin/discovery/config.go
+++ b/server/plugin/discovery/config.go
@@ -18,8 +18,9 @@ package discovery
import (
"fmt"
- "github.com/apache/servicecomb-service-center/server/core/proto"
"time"
+
+ "github.com/apache/servicecomb-service-center/server/core/proto"
)
type Config struct {
diff --git a/server/plugin/discovery/config_test.go b/server/plugin/discovery/config_test.go
index 4a39dc3..1f646ae 100644
--- a/server/plugin/discovery/config_test.go
+++ b/server/plugin/discovery/config_test.go
@@ -16,9 +16,10 @@
package discovery
import (
- "github.com/apache/servicecomb-service-center/server/core/proto"
"testing"
"time"
+
+ "github.com/apache/servicecomb-service-center/server/core/proto"
)
type mockDeferHandler struct {
diff --git a/server/plugin/discovery/etcd/adaptor_test.go b/server/plugin/discovery/etcd/adaptor_test.go
index da04c07..d0ab894 100644
--- a/server/plugin/discovery/etcd/adaptor_test.go
+++ b/server/plugin/discovery/etcd/adaptor_test.go
@@ -17,9 +17,10 @@
package etcd
import (
+ "testing"
+
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
- "testing"
)
func TestNewKvEntity(t *testing.T) {
diff --git a/server/plugin/discovery/etcd/cacher_kv.go b/server/plugin/discovery/etcd/cacher_kv.go
index 5a9beea..10e731b 100644
--- a/server/plugin/discovery/etcd/cacher_kv.go
+++ b/server/plugin/discovery/etcd/cacher_kv.go
@@ -20,6 +20,9 @@ import (
"context"
"errors"
"fmt"
+ "sync"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/backoff"
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
@@ -30,8 +33,6 @@ import (
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
"github.com/coreos/etcd/mvcc/mvccpb"
- "sync"
- "time"
)
// KvCacher implements discovery.Cacher.
diff --git a/server/plugin/discovery/etcd/cacher_kv_test.go b/server/plugin/discovery/etcd/cacher_kv_test.go
index 4819a30..ed7eec4 100644
--- a/server/plugin/discovery/etcd/cacher_kv_test.go
+++ b/server/plugin/discovery/etcd/cacher_kv_test.go
@@ -20,6 +20,10 @@ import (
"context"
"encoding/json"
"fmt"
+ "math/rand"
+ "strconv"
+ "testing"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
@@ -27,9 +31,6 @@ import (
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
"github.com/coreos/etcd/mvcc/mvccpb"
- "math/rand"
- "strconv"
- "testing"
)
type mockCache struct {
diff --git a/server/plugin/discovery/etcd/common.go b/server/plugin/discovery/etcd/common.go
index 31d060f..7ad8323 100644
--- a/server/plugin/discovery/etcd/common.go
+++ b/server/plugin/discovery/etcd/common.go
@@ -16,10 +16,11 @@
package etcd
import (
+ "time"
+
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
"github.com/coreos/etcd/mvcc/mvccpb"
- "time"
)
const (
diff --git a/server/plugin/discovery/etcd/indexer_etcd.go b/server/plugin/discovery/etcd/indexer_etcd.go
index 3f5c8ff..d40e9f9 100644
--- a/server/plugin/discovery/etcd/indexer_etcd.go
+++ b/server/plugin/discovery/etcd/indexer_etcd.go
@@ -18,9 +18,10 @@ package etcd
import (
"fmt"
- "github.com/apache/servicecomb-service-center/server/core/proto"
"strings"
+ "github.com/apache/servicecomb-service-center/server/core/proto"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/core/backend"
@@ -45,7 +46,7 @@ func (i *Indexer) CheckPrefix(key string) error {
return nil
}
-func (i *Indexer) Search(ctx context.Context, opts ...registry.PluginOpOption) (r *discovery.Response, err error) {
+func (i *Indexer) Search(ctx context.Context, opts ...registry.PluginOpOption) (*discovery.Response, error) {
op := registry.OpGet(opts...)
key := util.BytesToStringWithNoCopy(op.Key)
@@ -60,10 +61,10 @@ func (i *Indexer) Search(ctx context.Context, opts ...registry.PluginOpOption) (
return nil, err
}
- r = new(discovery.Response)
+ r := new(discovery.Response)
r.Count = resp.Count
if len(resp.Kvs) == 0 || op.CountOnly {
- return
+ return r, nil
}
p := i.Parser
@@ -74,13 +75,13 @@ func (i *Indexer) Search(ctx context.Context, opts ...registry.PluginOpOption) (
kvs := make([]*discovery.KeyValue, 0, len(resp.Kvs))
for _, src := range resp.Kvs {
kv := discovery.NewKeyValue()
- if err = FromEtcdKeyValue(kv, src, p); err != nil {
+ if err := FromEtcdKeyValue(kv, src, p); err != nil {
continue
}
kvs = append(kvs, kv)
}
r.Kvs = kvs
- return
+ return r, nil
}
// Creditable implements discovery.Indexer.Creditable.
diff --git a/server/plugin/discovery/etcd/indexer_test.go b/server/plugin/discovery/etcd/indexer_test.go
index 57cd156..7fa3405 100644
--- a/server/plugin/discovery/etcd/indexer_test.go
+++ b/server/plugin/discovery/etcd/indexer_test.go
@@ -18,11 +18,12 @@ package etcd
import (
"context"
+ "testing"
+
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
"github.com/coreos/etcd/mvcc/mvccpb"
- "testing"
)
func TestEtcdIndexer_Search(t *testing.T) {
diff --git a/server/plugin/discovery/etcd/listwatch.go b/server/plugin/discovery/etcd/listwatch.go
index b7f7470..15db358 100644
--- a/server/plugin/discovery/etcd/listwatch.go
+++ b/server/plugin/discovery/etcd/listwatch.go
@@ -19,8 +19,9 @@ package etcd
import (
"context"
"fmt"
- "github.com/apache/servicecomb-service-center/server/plugin/registry"
"time"
+
+ "github.com/apache/servicecomb-service-center/server/plugin/registry"
)
type ListWatchConfig struct {
diff --git a/server/plugin/discovery/etcd/listwatch_inner.go b/server/plugin/discovery/etcd/listwatch_inner.go
index e7aa7f8..f0f8b1a 100644
--- a/server/plugin/discovery/etcd/listwatch_inner.go
+++ b/server/plugin/discovery/etcd/listwatch_inner.go
@@ -19,6 +19,7 @@ package etcd
import (
"context"
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
)
diff --git a/server/plugin/discovery/etcd/listwatch_test.go b/server/plugin/discovery/etcd/listwatch_test.go
index c1e1b83..ea0b157 100644
--- a/server/plugin/discovery/etcd/listwatch_test.go
+++ b/server/plugin/discovery/etcd/listwatch_test.go
@@ -19,11 +19,12 @@ package etcd
import (
"context"
"fmt"
+ "testing"
+ "time"
+
"github.com/apache/servicecomb-service-center/server/plugin/registry"
"github.com/apache/servicecomb-service-center/server/plugin/registry/buildin"
"github.com/coreos/etcd/mvcc/mvccpb"
- "testing"
- "time"
)
type mockRegistry struct {
diff --git a/server/plugin/discovery/etcd/metrics_test.go b/server/plugin/discovery/etcd/metrics_test.go
index 261a33f..9265f15 100644
--- a/server/plugin/discovery/etcd/metrics_test.go
+++ b/server/plugin/discovery/etcd/metrics_test.go
@@ -17,9 +17,10 @@
package etcd
import (
+ "testing"
+
"github.com/apache/servicecomb-service-center/server/metric"
"github.com/astaxie/beego"
- "testing"
)
func init() {
diff --git a/server/plugin/discovery/etcd/watcher_inner.go b/server/plugin/discovery/etcd/watcher_inner.go
index 87ed82e..87c684d 100644
--- a/server/plugin/discovery/etcd/watcher_inner.go
+++ b/server/plugin/discovery/etcd/watcher_inner.go
@@ -18,10 +18,11 @@ package etcd
import (
"context"
+ "sync"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
- "sync"
)
type innerWatcher struct {
diff --git a/server/plugin/discovery/etcd/watcher_test.go b/server/plugin/discovery/etcd/watcher_test.go
index 2576193..0cf1d11 100644
--- a/server/plugin/discovery/etcd/watcher_test.go
+++ b/server/plugin/discovery/etcd/watcher_test.go
@@ -19,9 +19,10 @@ package etcd
import (
"context"
"fmt"
- "github.com/apache/servicecomb-service-center/server/plugin/registry"
"testing"
"time"
+
+ "github.com/apache/servicecomb-service-center/server/plugin/registry"
)
type mockWatcher struct {
diff --git a/server/plugin/discovery/event_proxy.go b/server/plugin/discovery/event_proxy.go
index cd1a781..02aba16 100644
--- a/server/plugin/discovery/event_proxy.go
+++ b/server/plugin/discovery/event_proxy.go
@@ -17,9 +17,10 @@
package discovery
import (
+ "sync"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
- "sync"
)
var (
diff --git a/server/plugin/discovery/indexer_test.go b/server/plugin/discovery/indexer_test.go
index 9adaa3c..e8342ff 100644
--- a/server/plugin/discovery/indexer_test.go
+++ b/server/plugin/discovery/indexer_test.go
@@ -17,8 +17,9 @@ package discovery
import (
"context"
- "github.com/apache/servicecomb-service-center/server/plugin/registry"
"testing"
+
+ "github.com/apache/servicecomb-service-center/server/plugin/registry"
)
type mockCache struct {
diff --git a/server/plugin/discovery/k8s/adaptor/cacher_instance.go b/server/plugin/discovery/k8s/adaptor/cacher_instance.go
index 8a502d4..018d654 100644
--- a/server/plugin/discovery/k8s/adaptor/cacher_instance.go
+++ b/server/plugin/discovery/k8s/adaptor/cacher_instance.go
@@ -16,14 +16,15 @@
package adaptor
import (
+ "reflect"
+ "strconv"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
"k8s.io/api/core/v1"
- "reflect"
- "strconv"
)
type InstanceCacher struct {
diff --git a/server/plugin/discovery/k8s/adaptor/common.go b/server/plugin/discovery/k8s/adaptor/common.go
index ae5992a..7714659 100644
--- a/server/plugin/discovery/k8s/adaptor/common.go
+++ b/server/plugin/discovery/k8s/adaptor/common.go
@@ -17,6 +17,9 @@ package adaptor
import (
"context"
+ "strings"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/queue"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/core"
@@ -27,8 +30,6 @@ import (
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
- "strings"
- "time"
)
const (
diff --git a/server/plugin/discovery/k8s/adaptor/convertor.go b/server/plugin/discovery/k8s/adaptor/convertor.go
index 95be1e1..e00f8de 100644
--- a/server/plugin/discovery/k8s/adaptor/convertor.go
+++ b/server/plugin/discovery/k8s/adaptor/convertor.go
@@ -16,14 +16,15 @@
package adaptor
import (
+ "net/url"
+ "strconv"
+ "strings"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
- "k8s.io/api/core/v1"
- "net/url"
- "strconv"
- "strings"
+ v1 "k8s.io/api/core/v1"
)
func getLabel(labels map[string]string, key, def string) string {
diff --git a/server/plugin/discovery/k8s/adaptor/kube_client.go b/server/plugin/discovery/k8s/adaptor/kube_client.go
index 502cc30..9c4cedc 100644
--- a/server/plugin/discovery/k8s/adaptor/kube_client.go
+++ b/server/plugin/discovery/k8s/adaptor/kube_client.go
@@ -17,18 +17,19 @@ package adaptor
import (
"context"
+ "os"
+ "sync"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/alarm"
- "k8s.io/api/core/v1"
+ v1 "k8s.io/api/core/v1"
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/cache"
- "os"
- "sync"
- "time"
)
var (
diff --git a/server/plugin/discovery/k8s/adaptor/listwatcher.go b/server/plugin/discovery/k8s/adaptor/listwatcher.go
index 02874d0..01cae20 100644
--- a/server/plugin/discovery/k8s/adaptor/listwatcher.go
+++ b/server/plugin/discovery/k8s/adaptor/listwatcher.go
@@ -17,11 +17,12 @@ package adaptor
import (
"context"
+ "reflect"
+
"github.com/apache/servicecomb-service-center/pkg/queue"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/types"
"k8s.io/client-go/tools/cache"
- "reflect"
)
type K8sEvent struct {
diff --git a/server/plugin/discovery/metrics.go b/server/plugin/discovery/metrics.go
index ce434ca..2dfec76 100644
--- a/server/plugin/discovery/metrics.go
+++ b/server/plugin/discovery/metrics.go
@@ -17,9 +17,10 @@
package discovery
import (
+ "time"
+
"github.com/apache/servicecomb-service-center/server/metric"
"github.com/prometheus/client_golang/prometheus"
- "time"
)
var (
diff --git a/server/plugin/discovery/servicecenter/aggregate.go b/server/plugin/discovery/servicecenter/aggregate.go
index 3ccbd82..70816e2 100644
--- a/server/plugin/discovery/servicecenter/aggregate.go
+++ b/server/plugin/discovery/servicecenter/aggregate.go
@@ -18,6 +18,9 @@ package servicecenter
import (
"context"
"crypto/tls"
+ "strings"
+ "sync"
+
client2 "github.com/apache/servicecomb-service-center/client"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/model"
@@ -27,8 +30,6 @@ import (
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
- "strings"
- "sync"
)
var (
diff --git a/server/plugin/discovery/servicecenter/aggregate_test.go b/server/plugin/discovery/servicecenter/aggregate_test.go
index 793809e..7ca50f7 100644
--- a/server/plugin/discovery/servicecenter/aggregate_test.go
+++ b/server/plugin/discovery/servicecenter/aggregate_test.go
@@ -16,8 +16,9 @@
package servicecenter
import (
- "github.com/apache/servicecomb-service-center/server/plugin/registry"
"testing"
+
+ "github.com/apache/servicecomb-service-center/server/plugin/registry"
)
func TestNewSCClientAggregate(t *testing.T) {
diff --git a/server/plugin/discovery/servicecenter/indexer.go b/server/plugin/discovery/servicecenter/indexer.go
index f7f67ec..3455c6b 100644
--- a/server/plugin/discovery/servicecenter/indexer.go
+++ b/server/plugin/discovery/servicecenter/indexer.go
@@ -16,6 +16,8 @@
package servicecenter
import (
+ "strings"
+
"github.com/apache/servicecomb-service-center/client"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
@@ -24,7 +26,6 @@ import (
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
- "strings"
"context"
)
diff --git a/server/plugin/discovery/servicecenter/syncer.go b/server/plugin/discovery/servicecenter/syncer.go
index 769968b..2663510 100644
--- a/server/plugin/discovery/servicecenter/syncer.go
+++ b/server/plugin/discovery/servicecenter/syncer.go
@@ -17,11 +17,12 @@ package servicecenter
import (
"fmt"
- "github.com/apache/servicecomb-service-center/pkg/model"
- proto "github.com/apache/servicecomb-service-center/pkg/registry"
"sync"
"time"
+ "github.com/apache/servicecomb-service-center/pkg/model"
+ proto "github.com/apache/servicecomb-service-center/pkg/registry"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/server/plugin/discovery/servicecenter/syncer_test.go b/server/plugin/discovery/servicecenter/syncer_test.go
index 2b116f3..fb05ff3 100644
--- a/server/plugin/discovery/servicecenter/syncer_test.go
+++ b/server/plugin/discovery/servicecenter/syncer_test.go
@@ -17,12 +17,13 @@ package servicecenter
import (
"fmt"
+ "testing"
+
"github.com/apache/servicecomb-service-center/pkg/log"
model2 "github.com/apache/servicecomb-service-center/pkg/model"
registry2 "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
- "testing"
)
func TestClusterIndexer_Sync(t *testing.T) {
diff --git a/server/plugin/discovery/types.go b/server/plugin/discovery/types.go
index f5be39b..ed9415d 100644
--- a/server/plugin/discovery/types.go
+++ b/server/plugin/discovery/types.go
@@ -18,12 +18,13 @@ package discovery
import (
"encoding/json"
"fmt"
+ "strconv"
+ "time"
+
simple "github.com/apache/servicecomb-service-center/pkg/time"
"github.com/apache/servicecomb-service-center/pkg/types"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
- "strconv"
- "time"
)
var (
diff --git a/server/plugin/export.go b/server/plugin/export.go
index 8e40c40..abad1f3 100644
--- a/server/plugin/export.go
+++ b/server/plugin/export.go
@@ -24,7 +24,7 @@ import (
"github.com/apache/servicecomb-service-center/server/plugin/tls"
"github.com/apache/servicecomb-service-center/server/plugin/tracing"
"github.com/apache/servicecomb-service-center/server/plugin/uuid"
- "github.com/go-chassis/foundation/security"
+ "github.com/go-chassis/cari/security"
)
const (
diff --git a/server/plugin/quota/buildin/buildin.go b/server/plugin/quota/buildin/buildin.go
index 63194fc..3c5e10d 100644
--- a/server/plugin/quota/buildin/buildin.go
+++ b/server/plugin/quota/buildin/buildin.go
@@ -19,6 +19,7 @@ package buildin
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/log"
mgr "github.com/apache/servicecomb-service-center/server/plugin"
"github.com/apache/servicecomb-service-center/server/plugin/quota"
diff --git a/server/plugin/quota/buildin/common_test.go b/server/plugin/quota/buildin/common_test.go
index 9c1cb22..4e595b6 100644
--- a/server/plugin/quota/buildin/common_test.go
+++ b/server/plugin/quota/buildin/common_test.go
@@ -18,8 +18,9 @@ package buildin
import (
"context"
"errors"
- "github.com/apache/servicecomb-service-center/server/plugin/quota"
"testing"
+
+ "github.com/apache/servicecomb-service-center/server/plugin/quota"
)
func TestCommonQuotaCheck(t *testing.T) {
diff --git a/server/plugin/quota/counter/event.go b/server/plugin/quota/counter/event.go
index 52e2b37..898478e 100644
--- a/server/plugin/quota/counter/event.go
+++ b/server/plugin/quota/counter/event.go
@@ -17,6 +17,7 @@ package counter
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/server/plugin/quota/counter/event_test.go b/server/plugin/quota/counter/event_test.go
index 846b8d1..7ad6699 100644
--- a/server/plugin/quota/counter/event_test.go
+++ b/server/plugin/quota/counter/event_test.go
@@ -16,11 +16,12 @@
package counter
import (
+ "testing"
+
registry2 "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/core/backend"
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
- "testing"
)
type mockCounter struct {
diff --git a/server/plugin/quota/quota.go b/server/plugin/quota/quota.go
index 5642c15..f627f8e 100644
--- a/server/plugin/quota/quota.go
+++ b/server/plugin/quota/quota.go
@@ -19,9 +19,10 @@ package quota
import (
"context"
+ "strconv"
+
"github.com/apache/servicecomb-service-center/pkg/util"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
- "strconv"
)
const (
diff --git a/server/plugin/quota/unlimit/unlimit.go b/server/plugin/quota/unlimit/unlimit.go
index 79f41b6..da07b6f 100644
--- a/server/plugin/quota/unlimit/unlimit.go
+++ b/server/plugin/quota/unlimit/unlimit.go
@@ -19,6 +19,7 @@ package unlimit
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/log"
mgr "github.com/apache/servicecomb-service-center/server/plugin"
"github.com/apache/servicecomb-service-center/server/plugin/quota"
diff --git a/server/plugin/registry/buildin/buildin.go b/server/plugin/registry/buildin/buildin.go
index 989201f..b3ceaed 100644
--- a/server/plugin/registry/buildin/buildin.go
+++ b/server/plugin/registry/buildin/buildin.go
@@ -19,6 +19,7 @@ package buildin
import (
"context"
+
mgr "github.com/apache/servicecomb-service-center/server/plugin"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
)
diff --git a/server/plugin/registry/config.go b/server/plugin/registry/config.go
index 991c236..2d17f34 100644
--- a/server/plugin/registry/config.go
+++ b/server/plugin/registry/config.go
@@ -16,13 +16,14 @@
package registry
import (
+ "strings"
+ "sync"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/types"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/astaxie/beego"
- "strings"
- "sync"
- "time"
)
var (
diff --git a/server/plugin/registry/embededetcd/embededetcd.go b/server/plugin/registry/embededetcd/embededetcd.go
index 140a530..c4f4666 100644
--- a/server/plugin/registry/embededetcd/embededetcd.go
+++ b/server/plugin/registry/embededetcd/embededetcd.go
@@ -21,6 +21,10 @@ import (
"context"
"errors"
"fmt"
+ "net/url"
+ "strings"
+ "time"
+
errorsEx "github.com/apache/servicecomb-service-center/pkg/errors"
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
@@ -34,9 +38,6 @@ import (
"github.com/coreos/etcd/etcdserver/etcdserverpb"
"github.com/coreos/etcd/lease"
"github.com/coreos/etcd/mvcc/mvccpb"
- "net/url"
- "strings"
- "time"
)
func init() {
diff --git a/server/plugin/registry/etcd/etcd.go b/server/plugin/registry/etcd/etcd.go
index 159204f..157bf62 100644
--- a/server/plugin/registry/etcd/etcd.go
+++ b/server/plugin/registry/etcd/etcd.go
@@ -36,6 +36,7 @@ import (
"github.com/apache/servicecomb-service-center/server/plugin/registry"
"context"
+
"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
"github.com/coreos/etcd/etcdserver/etcdserverpb"
diff --git a/server/plugin/registry/etcd/etcd_test.go b/server/plugin/registry/etcd/etcd_test.go
index bfdee00..b1191a5 100644
--- a/server/plugin/registry/etcd/etcd_test.go
+++ b/server/plugin/registry/etcd/etcd_test.go
@@ -17,13 +17,7 @@
package etcd
import (
- _ "github.com/apache/servicecomb-service-center/server/plugin/tracing/pzipkin"
- "github.com/stretchr/testify/assert"
-)
-import _ "github.com/apache/servicecomb-service-center/server/plugin/security/buildin"
-import _ "github.com/apache/servicecomb-service-center/server/plugin/tls/buildin"
-import (
- context2 "context"
+ "context"
"fmt"
"strconv"
"strings"
@@ -31,12 +25,15 @@ import (
"testing"
"time"
- "github.com/apache/servicecomb-service-center/server/plugin/registry"
+ _ "github.com/apache/servicecomb-service-center/server/plugin/security/buildin"
+ _ "github.com/apache/servicecomb-service-center/server/plugin/tls/buildin"
+ _ "github.com/apache/servicecomb-service-center/server/plugin/tracing/pzipkin"
- "context"
+ "github.com/apache/servicecomb-service-center/server/plugin/registry"
"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/etcdserver/etcdserverpb"
"github.com/coreos/etcd/mvcc/mvccpb"
+ "github.com/stretchr/testify/assert"
)
const (
@@ -749,11 +746,11 @@ type mockKVForPagine struct {
rangeResp2 *clientv3.GetResponse
}
-func (m *mockKVForPagine) Put(ctx context2.Context, key, val string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error) {
+func (m *mockKVForPagine) Put(ctx context.Context, key, val string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error) {
return nil, nil
}
-func (m *mockKVForPagine) Get(ctx context2.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error) {
+func (m *mockKVForPagine) Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error) {
op := &clientv3.Op{}
for _, o := range opts {
o(op)
@@ -768,19 +765,19 @@ func (m *mockKVForPagine) Get(ctx context2.Context, key string, opts ...clientv3
return m.rangeResp2, nil
}
-func (m *mockKVForPagine) Delete(ctx context2.Context, key string, opts ...clientv3.OpOption) (*clientv3.DeleteResponse, error) {
+func (m *mockKVForPagine) Delete(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.DeleteResponse, error) {
return nil, nil
}
-func (m *mockKVForPagine) Compact(ctx context2.Context, rev int64, opts ...clientv3.CompactOption) (*clientv3.CompactResponse, error) {
+func (m *mockKVForPagine) Compact(ctx context.Context, rev int64, opts ...clientv3.CompactOption) (*clientv3.CompactResponse, error) {
return nil, nil
}
-func (m *mockKVForPagine) Do(ctx context2.Context, op clientv3.Op) (clientv3.OpResponse, error) {
+func (m *mockKVForPagine) Do(ctx context.Context, op clientv3.Op) (clientv3.OpResponse, error) {
return clientv3.OpResponse{}, nil
}
-func (m *mockKVForPagine) Txn(ctx context2.Context) clientv3.Txn {
+func (m *mockKVForPagine) Txn(ctx context.Context) clientv3.Txn {
return nil
}
@@ -828,7 +825,7 @@ func TestEtcdClient_paging(t *testing.T) {
Offset: -1,
Limit: registry.DefaultPageCount,
}
- r, err := c.paging(context2.Background(), op)
+ r, err := c.paging(context.Background(), op)
if err != nil {
t.Fatalf("TestEtcdClient_paging failed, %#v", err)
}
diff --git a/server/plugin/registry/etcd/logger.go b/server/plugin/registry/etcd/logger.go
index 5f698c9..20828c0 100644
--- a/server/plugin/registry/etcd/logger.go
+++ b/server/plugin/registry/etcd/logger.go
@@ -19,10 +19,11 @@ package etcd
import (
"fmt"
+ "runtime"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/coreos/pkg/capnslog"
- "runtime"
)
const grpcCallerSkip = 2
diff --git a/server/plugin/registry/etcd/tracing.go b/server/plugin/registry/etcd/tracing.go
index df65540..37b352f 100644
--- a/server/plugin/registry/etcd/tracing.go
+++ b/server/plugin/registry/etcd/tracing.go
@@ -19,10 +19,11 @@ package etcd
import (
"context"
+ "net/http"
+
"github.com/apache/servicecomb-service-center/server/plugin"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
"github.com/apache/servicecomb-service-center/server/plugin/tracing"
- "net/http"
)
func TracingBegin(ctx context.Context, operationName string, op registry.PluginOp) tracing.Span {
diff --git a/server/plugin/registry/metrics.go b/server/plugin/registry/metrics.go
index b1943ea..565e837 100644
--- a/server/plugin/registry/metrics.go
+++ b/server/plugin/registry/metrics.go
@@ -18,9 +18,10 @@
package registry
import (
+ "time"
+
"github.com/apache/servicecomb-service-center/server/metric"
"github.com/prometheus/client_golang/prometheus"
- "time"
)
const (
diff --git a/server/plugin/registry/types.go b/server/plugin/registry/types.go
index 35458cd..f463bff 100644
--- a/server/plugin/registry/types.go
+++ b/server/plugin/registry/types.go
@@ -17,8 +17,9 @@ package registry
import (
"fmt"
- "github.com/coreos/etcd/mvcc/mvccpb"
"strconv"
+
+ "github.com/coreos/etcd/mvcc/mvccpb"
)
type ActionType int
diff --git a/server/plugin/tls/buildin/buildin.go b/server/plugin/tls/buildin/buildin.go
index 2adb8d1..0039ba9 100644
--- a/server/plugin/tls/buildin/buildin.go
+++ b/server/plugin/tls/buildin/buildin.go
@@ -19,6 +19,7 @@ package buildin
import (
"crypto/tls"
+
mgr "github.com/apache/servicecomb-service-center/server/plugin"
)
diff --git a/server/plugin/tls/buildin/tls.go b/server/plugin/tls/buildin/tls.go
index fc969d9..3bd27ad 100644
--- a/server/plugin/tls/buildin/tls.go
+++ b/server/plugin/tls/buildin/tls.go
@@ -19,16 +19,17 @@ package buildin
import (
"crypto/tls"
+ "io/ioutil"
+ "os"
+ "path/filepath"
+ "sync"
+
"github.com/apache/servicecomb-service-center/pkg/log"
- "github.com/apache/servicecomb-service-center/pkg/tlsutil"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/service/cipher"
"github.com/astaxie/beego"
- "io/ioutil"
- "os"
- "path/filepath"
- "sync"
+ "github.com/go-chassis/foundation/tlsutil"
)
var (
diff --git a/server/plugin/tls/buildin/tls_test.go b/server/plugin/tls/buildin/tls_test.go
index 4805dd2..5b1e439 100644
--- a/server/plugin/tls/buildin/tls_test.go
+++ b/server/plugin/tls/buildin/tls_test.go
@@ -18,12 +18,14 @@ package buildin_test
import (
"crypto/tls"
- "github.com/apache/servicecomb-service-center/server/core"
+ "os"
+ "testing"
+
_ "github.com/apache/servicecomb-service-center/server/plugin/security/buildin"
+
+ "github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/plugin/tls/buildin"
"github.com/stretchr/testify/assert"
- "os"
- "testing"
)
func init() {
diff --git a/server/plugin/tracing/pzipkin/buildin.go b/server/plugin/tracing/pzipkin/buildin.go
index 1cfbc00..b8f9080 100644
--- a/server/plugin/tracing/pzipkin/buildin.go
+++ b/server/plugin/tracing/pzipkin/buildin.go
@@ -19,6 +19,10 @@ package pzipkin
import (
"context"
+ "net/http"
+ "net/url"
+ "sync"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
mgr "github.com/apache/servicecomb-service-center/server/plugin"
@@ -26,9 +30,6 @@ import (
"github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"
"github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore"
- "net/http"
- "net/url"
- "sync"
)
var once sync.Once
diff --git a/server/plugin/tracing/pzipkin/buildin_test.go b/server/plugin/tracing/pzipkin/buildin_test.go
index fcecf4d..504f7f9 100644
--- a/server/plugin/tracing/pzipkin/buildin_test.go
+++ b/server/plugin/tracing/pzipkin/buildin_test.go
@@ -18,12 +18,13 @@ package pzipkin
import (
"context"
- "github.com/apache/servicecomb-service-center/server/core"
- "github.com/apache/servicecomb-service-center/server/plugin/registry"
- "github.com/apache/servicecomb-service-center/server/plugin/tracing"
"net/http"
"os"
"testing"
+
+ "github.com/apache/servicecomb-service-center/server/core"
+ "github.com/apache/servicecomb-service-center/server/plugin/registry"
+ "github.com/apache/servicecomb-service-center/server/plugin/tracing"
)
func TestZipkin_XBegin(t *testing.T) {
diff --git a/server/plugin/tracing/pzipkin/common.go b/server/plugin/tracing/pzipkin/common.go
index f8ac3b1..7ac0548 100644
--- a/server/plugin/tracing/pzipkin/common.go
+++ b/server/plugin/tracing/pzipkin/common.go
@@ -19,15 +19,16 @@ package pzipkin
import (
"fmt"
+ "os"
+ "path/filepath"
+ "strconv"
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/metric"
"github.com/opentracing/opentracing-go"
zipkin "github.com/openzipkin/zipkin-go-opentracing"
- "os"
- "path/filepath"
- "strconv"
- "strings"
)
const (
diff --git a/server/plugin/tracing/pzipkin/common_test.go b/server/plugin/tracing/pzipkin/common_test.go
index fb005a0..db34038 100644
--- a/server/plugin/tracing/pzipkin/common_test.go
+++ b/server/plugin/tracing/pzipkin/common_test.go
@@ -16,10 +16,11 @@
package pzipkin
import (
- "github.com/openzipkin/zipkin-go-opentracing"
"os"
"path/filepath"
"testing"
+
+ zipkintracer "github.com/openzipkin/zipkin-go-opentracing"
)
func TestGetFilePath(t *testing.T) {
diff --git a/server/plugin/tracing/pzipkin/file_collector.go b/server/plugin/tracing/pzipkin/file_collector.go
index b77adec..2fdf6f2 100644
--- a/server/plugin/tracing/pzipkin/file_collector.go
+++ b/server/plugin/tracing/pzipkin/file_collector.go
@@ -22,14 +22,15 @@ import (
"context"
"encoding/json"
"fmt"
+ "os"
+ "strings"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore"
- "os"
- "strings"
- "time"
)
type FileCollector struct {
diff --git a/server/plugin/tracing/pzipkin/file_collector_test.go b/server/plugin/tracing/pzipkin/file_collector_test.go
index 93a4895..53d4000 100644
--- a/server/plugin/tracing/pzipkin/file_collector_test.go
+++ b/server/plugin/tracing/pzipkin/file_collector_test.go
@@ -19,11 +19,12 @@ package pzipkin
import (
"context"
"fmt"
- "github.com/apache/servicecomb-service-center/pkg/gopool"
- "github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore"
"os"
"testing"
"time"
+
+ "github.com/apache/servicecomb-service-center/pkg/gopool"
+ "github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore"
)
func TestFileCollector_Collect(t *testing.T) {
diff --git a/server/plugin/tracing/pzipkin/span.go b/server/plugin/tracing/pzipkin/span.go
index 9f4d45c..5517251 100644
--- a/server/plugin/tracing/pzipkin/span.go
+++ b/server/plugin/tracing/pzipkin/span.go
@@ -18,10 +18,11 @@
package pzipkin
import (
+ "strconv"
+
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore"
"github.com/openzipkin/zipkin-go-opentracing/types"
- "strconv"
)
type Span struct {
diff --git a/server/plugin/tracing/pzipkin/span_test.go b/server/plugin/tracing/pzipkin/span_test.go
index 93b80a2..b6c6a29 100644
--- a/server/plugin/tracing/pzipkin/span_test.go
+++ b/server/plugin/tracing/pzipkin/span_test.go
@@ -19,8 +19,9 @@ package pzipkin
import (
"encoding/json"
"fmt"
- "github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore"
"testing"
+
+ "github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore"
)
var sample = []byte(`{
diff --git a/server/plugin/tracing/tracing.go b/server/plugin/tracing/tracing.go
index 309eeb4..5b2514c 100644
--- a/server/plugin/tracing/tracing.go
+++ b/server/plugin/tracing/tracing.go
@@ -19,6 +19,7 @@ package tracing
import (
"context"
+
"github.com/apache/servicecomb-service-center/server/plugin/registry"
)
diff --git a/server/plugin/uuid/buildin/buildin.go b/server/plugin/uuid/buildin/buildin.go
index b0a2cf4..4675b84 100644
--- a/server/plugin/uuid/buildin/buildin.go
+++ b/server/plugin/uuid/buildin/buildin.go
@@ -19,6 +19,7 @@ package buildin
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/util"
mgr "github.com/apache/servicecomb-service-center/server/plugin"
)
diff --git a/server/plugin/uuid/context/context.go b/server/plugin/uuid/context/context.go
index b69b0ad..8c8a837 100644
--- a/server/plugin/uuid/context/context.go
+++ b/server/plugin/uuid/context/context.go
@@ -21,6 +21,7 @@ import (
"context"
"crypto/sha1"
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/util"
mgr "github.com/apache/servicecomb-service-center/server/plugin"
"github.com/apache/servicecomb-service-center/server/plugin/uuid"
diff --git a/server/rest/admin/controller_v4.go b/server/rest/admin/controller_v4.go
index 5f24b6f..4167c78 100644
--- a/server/rest/admin/controller_v4.go
+++ b/server/rest/admin/controller_v4.go
@@ -18,12 +18,14 @@
package admin
import (
- "github.com/apache/servicecomb-service-center/pkg/model"
"net/http"
+ "github.com/apache/servicecomb-service-center/pkg/model"
+
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/rest"
"github.com/apache/servicecomb-service-center/server/rest/controller"
- "strings"
)
// Service 治理相关接口服务
diff --git a/server/rest/admin/service.go b/server/rest/admin/service.go
index e652e6b..d68815d 100644
--- a/server/rest/admin/service.go
+++ b/server/rest/admin/service.go
@@ -19,6 +19,9 @@ package admin
import (
"context"
+ "os"
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/model"
@@ -32,8 +35,6 @@ import (
scerr "github.com/apache/servicecomb-service-center/server/scerror"
"github.com/apache/servicecomb-service-center/version"
"github.com/astaxie/beego"
- "os"
- "strings"
)
var (
diff --git a/server/rest/admin/service_test.go b/server/rest/admin/service_test.go
index 07ee87d..c7599d4 100644
--- a/server/rest/admin/service_test.go
+++ b/server/rest/admin/service_test.go
@@ -18,6 +18,8 @@ package admin_test
import (
"context"
+ "testing"
+
model2 "github.com/apache/servicecomb-service-center/pkg/model"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/core/proto"
@@ -28,7 +30,6 @@ import (
scerr "github.com/apache/servicecomb-service-center/server/scerror"
"github.com/astaxie/beego"
"github.com/stretchr/testify/assert"
- "testing"
)
func init() {
diff --git a/server/rest/controller/rest_util.go b/server/rest/controller/rest_util.go
index 7ca6284..f702975 100644
--- a/server/rest/controller/rest_util.go
+++ b/server/rest/controller/rest_util.go
@@ -20,6 +20,9 @@ package controller
import (
"encoding/json"
"fmt"
+ "net/http"
+ "strconv"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/rest"
@@ -27,8 +30,6 @@ import (
"github.com/apache/servicecomb-service-center/server/alarm"
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/scerror"
- "net/http"
- "strconv"
)
func WriteError(w http.ResponseWriter, code int32, detail string) {
diff --git a/server/rest/controller/v3/dependency_controller.go b/server/rest/controller/v3/dependency_controller.go
index 11b7351..1560d1d 100644
--- a/server/rest/controller/v3/dependency_controller.go
+++ b/server/rest/controller/v3/dependency_controller.go
@@ -18,7 +18,7 @@ package v3
import (
"github.com/apache/servicecomb-service-center/pkg/rest"
- "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
+ v4 "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
)
type DependencyService struct {
diff --git a/server/rest/controller/v3/instance_controller.go b/server/rest/controller/v3/instance_controller.go
index 2dc8b73..1436f3e 100644
--- a/server/rest/controller/v3/instance_controller.go
+++ b/server/rest/controller/v3/instance_controller.go
@@ -18,7 +18,7 @@ package v3
import (
"github.com/apache/servicecomb-service-center/pkg/rest"
- "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
+ v4 "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
)
type MicroServiceInstanceService struct {
diff --git a/server/rest/controller/v3/instance_watcher.go b/server/rest/controller/v3/instance_watcher.go
index 6d0690b..885c1f9 100644
--- a/server/rest/controller/v3/instance_watcher.go
+++ b/server/rest/controller/v3/instance_watcher.go
@@ -18,7 +18,7 @@ package v3
import (
"github.com/apache/servicecomb-service-center/pkg/rest"
- "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
+ v4 "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
)
type WatchService struct {
diff --git a/server/rest/controller/v3/main_controller.go b/server/rest/controller/v3/main_controller.go
index 54f693a..b7f15df 100644
--- a/server/rest/controller/v3/main_controller.go
+++ b/server/rest/controller/v3/main_controller.go
@@ -18,13 +18,14 @@ package v3
import (
"encoding/json"
+ "net/http"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/rest"
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/rest/controller"
- "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
+ v4 "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
"github.com/apache/servicecomb-service-center/version"
- "net/http"
)
var (
diff --git a/server/rest/controller/v3/microservice_controller.go b/server/rest/controller/v3/microservice_controller.go
index 11a8c6a..23585af 100644
--- a/server/rest/controller/v3/microservice_controller.go
+++ b/server/rest/controller/v3/microservice_controller.go
@@ -18,7 +18,7 @@ package v3
import (
"github.com/apache/servicecomb-service-center/pkg/rest"
- "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
+ v4 "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
)
type MicroServiceService struct {
diff --git a/server/rest/controller/v3/query_rule_controller.go b/server/rest/controller/v3/query_rule_controller.go
index 4501661..810a6d9 100644
--- a/server/rest/controller/v3/query_rule_controller.go
+++ b/server/rest/controller/v3/query_rule_controller.go
@@ -18,7 +18,7 @@ package v3
import (
"github.com/apache/servicecomb-service-center/pkg/rest"
- "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
+ v4 "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
)
type RuleService struct {
diff --git a/server/rest/controller/v3/schema_controller.go b/server/rest/controller/v3/schema_controller.go
index 5c3f1e0..6f8a7ce 100644
--- a/server/rest/controller/v3/schema_controller.go
+++ b/server/rest/controller/v3/schema_controller.go
@@ -18,7 +18,7 @@ package v3
import (
"github.com/apache/servicecomb-service-center/pkg/rest"
- "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
+ v4 "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
)
type SchemaService struct {
diff --git a/server/rest/controller/v3/tag_controller.go b/server/rest/controller/v3/tag_controller.go
index 552b838..fd41a39 100644
--- a/server/rest/controller/v3/tag_controller.go
+++ b/server/rest/controller/v3/tag_controller.go
@@ -18,7 +18,7 @@ package v3
import (
"github.com/apache/servicecomb-service-center/pkg/rest"
- "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
+ v4 "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
)
type TagService struct {
diff --git a/server/rest/controller/v4/auth_resource.go b/server/rest/controller/v4/auth_resource.go
index dd93f4a..d926316 100644
--- a/server/rest/controller/v4/auth_resource.go
+++ b/server/rest/controller/v4/auth_resource.go
@@ -20,6 +20,9 @@ package v4
import (
"context"
"encoding/json"
+ "io/ioutil"
+ "net/http"
+
errorsEx "github.com/apache/servicecomb-service-center/pkg/errors"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
@@ -31,8 +34,6 @@ import (
"github.com/apache/servicecomb-service-center/server/service/rbac"
"github.com/apache/servicecomb-service-center/server/service/rbac/dao"
"github.com/go-chassis/go-chassis/security/authr"
- "io/ioutil"
- "net/http"
)
type AuthResource struct {
diff --git a/server/rest/controller/v4/auth_resource_test.go b/server/rest/controller/v4/auth_resource_test.go
index 63f0349..43becb1 100644
--- a/server/rest/controller/v4/auth_resource_test.go
+++ b/server/rest/controller/v4/auth_resource_test.go
@@ -23,6 +23,15 @@ import (
"bytes"
"context"
"encoding/json"
+ "io/ioutil"
+ "net/http"
+ "net/http/httptest"
+ "testing"
+ "time"
+
+ _ "github.com/apache/servicecomb-service-center/server/handler/auth"
+ _ "github.com/apache/servicecomb-service-center/test"
+
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
"github.com/apache/servicecomb-service-center/pkg/rest"
v4 "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
@@ -33,14 +42,6 @@ import (
"github.com/go-chassis/go-chassis/security/secret"
"github.com/go-chassis/go-chassis/server/restful"
"github.com/stretchr/testify/assert"
- "io/ioutil"
- "net/http"
- "net/http/httptest"
- "testing"
- "time"
-
- _ "github.com/apache/servicecomb-service-center/server/handler/auth"
- _ "github.com/apache/servicecomb-service-center/test"
)
func init() {
diff --git a/server/rest/controller/v4/dependency_controller.go b/server/rest/controller/v4/dependency_controller.go
index d4bee4a..251b072 100644
--- a/server/rest/controller/v4/dependency_controller.go
+++ b/server/rest/controller/v4/dependency_controller.go
@@ -19,6 +19,9 @@ package v4
import (
"encoding/json"
+ "io/ioutil"
+ "net/http"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/rest"
@@ -26,8 +29,6 @@ import (
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/rest/controller"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
- "io/ioutil"
- "net/http"
)
type DependencyService struct {
diff --git a/server/rest/controller/v4/instance_controller.go b/server/rest/controller/v4/instance_controller.go
index 6f5306c..2b67c79 100644
--- a/server/rest/controller/v4/instance_controller.go
+++ b/server/rest/controller/v4/instance_controller.go
@@ -20,6 +20,10 @@ package v4
import (
"encoding/json"
"fmt"
+ "io/ioutil"
+ "net/http"
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/rest"
@@ -28,9 +32,6 @@ import (
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/rest/controller"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
- "io/ioutil"
- "net/http"
- "strings"
)
type MicroServiceInstanceService struct {
diff --git a/server/rest/controller/v4/instance_watcher.go b/server/rest/controller/v4/instance_watcher.go
index 347603f..48149f3 100644
--- a/server/rest/controller/v4/instance_watcher.go
+++ b/server/rest/controller/v4/instance_watcher.go
@@ -18,12 +18,13 @@
package v4
import (
+ "net/http"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/rest"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/gorilla/websocket"
- "net/http"
)
type WatchService struct {
diff --git a/server/rest/controller/v4/main_controller.go b/server/rest/controller/v4/main_controller.go
index a310d48..80fceee 100644
--- a/server/rest/controller/v4/main_controller.go
+++ b/server/rest/controller/v4/main_controller.go
@@ -19,14 +19,15 @@ package v4
import (
"encoding/json"
+ "net/http"
+ "sync"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/rest"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/rest/controller"
"github.com/apache/servicecomb-service-center/version"
- "net/http"
- "sync"
)
var (
diff --git a/server/rest/controller/v4/microservice_controller.go b/server/rest/controller/v4/microservice_controller.go
index 84bb594..dbda2e1 100644
--- a/server/rest/controller/v4/microservice_controller.go
+++ b/server/rest/controller/v4/microservice_controller.go
@@ -19,6 +19,9 @@ package v4
import (
"encoding/json"
+ "io/ioutil"
+ "net/http"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/rest"
@@ -26,8 +29,6 @@ import (
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/rest/controller"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
- "io/ioutil"
- "net/http"
)
var trueOrFalse = map[string]bool{"true": true, "false": false, "1": true, "0": false}
diff --git a/server/rest/controller/v4/query_rule_controller.go b/server/rest/controller/v4/query_rule_controller.go
index 1b7dbb6..4a0dfcc 100644
--- a/server/rest/controller/v4/query_rule_controller.go
+++ b/server/rest/controller/v4/query_rule_controller.go
@@ -19,6 +19,10 @@ package v4
import (
"encoding/json"
+ "io/ioutil"
+ "net/http"
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/rest"
@@ -26,9 +30,6 @@ import (
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/rest/controller"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
- "io/ioutil"
- "net/http"
- "strings"
)
type RuleService struct {
diff --git a/server/rest/controller/v4/schema_controller.go b/server/rest/controller/v4/schema_controller.go
index 63f570f..3955864 100644
--- a/server/rest/controller/v4/schema_controller.go
+++ b/server/rest/controller/v4/schema_controller.go
@@ -19,6 +19,10 @@ package v4
import (
"encoding/json"
+ "io/ioutil"
+ "net/http"
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/rest"
@@ -26,9 +30,6 @@ import (
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/rest/controller"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
- "io/ioutil"
- "net/http"
- "strings"
)
type SchemaService struct {
diff --git a/server/rest/controller/v4/tag_controller.go b/server/rest/controller/v4/tag_controller.go
index 7aad092..130c26c 100644
--- a/server/rest/controller/v4/tag_controller.go
+++ b/server/rest/controller/v4/tag_controller.go
@@ -19,6 +19,10 @@ package v4
import (
"encoding/json"
+ "io/ioutil"
+ "net/http"
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/rest"
@@ -26,9 +30,6 @@ import (
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/rest/controller"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
- "io/ioutil"
- "net/http"
- "strings"
)
type TagService struct {
diff --git a/server/rest/govern/controller_v4.go b/server/rest/govern/controller_v4.go
index 2011b0e..b0b6ea2 100644
--- a/server/rest/govern/controller_v4.go
+++ b/server/rest/govern/controller_v4.go
@@ -18,9 +18,12 @@
package govern
import (
- "github.com/apache/servicecomb-service-center/server/core/proto"
"net/http"
+ "github.com/apache/servicecomb-service-center/server/core/proto"
+
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/rest"
@@ -28,7 +31,6 @@ import (
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/rest/controller"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
- "strings"
)
// Service 治理相关接口服务
diff --git a/server/rest/govern/govern_suite_test.go b/server/rest/govern/govern_suite_test.go
index e75166b..45579f0 100644
--- a/server/rest/govern/govern_suite_test.go
+++ b/server/rest/govern/govern_suite_test.go
@@ -18,20 +18,21 @@ package govern_test
// initialize
import (
- _ "github.com/apache/servicecomb-service-center/server/bootstrap"
- "github.com/apache/servicecomb-service-center/server/core/proto"
-)
-import (
"context"
+ "testing"
+
+ _ "github.com/apache/servicecomb-service-center/server/bootstrap"
+
+ . "github.com/onsi/ginkgo"
+ . "github.com/onsi/gomega"
+
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/core"
+ "github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/rest/govern"
"github.com/apache/servicecomb-service-center/server/service"
"github.com/astaxie/beego"
- . "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
- . "github.com/onsi/gomega"
- "testing"
)
func init() {
diff --git a/server/rest/govern/service.go b/server/rest/govern/service.go
index b5d03e1..c3e3ca0 100644
--- a/server/rest/govern/service.go
+++ b/server/rest/govern/service.go
@@ -19,6 +19,7 @@ package govern
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
diff --git a/server/rest/govern/service_test.go b/server/rest/govern/service_test.go
index 38c3297..d1d9de5 100644
--- a/server/rest/govern/service_test.go
+++ b/server/rest/govern/service_test.go
@@ -18,15 +18,16 @@ package govern_test
import (
"bytes"
+ "io/ioutil"
+ "net/http"
+ "net/http/httptest"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/rest/govern"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
- "io/ioutil"
- "net/http"
- "net/http/httptest"
)
type mockGovernHandler struct {
diff --git a/server/rest/pprof.go b/server/rest/pprof.go
index 22d401d..4463735 100644
--- a/server/rest/pprof.go
+++ b/server/rest/pprof.go
@@ -18,9 +18,10 @@
package rest
import (
- "github.com/apache/servicecomb-service-center/server/core"
"net/http"
"net/http/pprof"
+
+ "github.com/apache/servicecomb-service-center/server/core"
)
func init() {
diff --git a/server/rest/server.go b/server/rest/server.go
index 6a73118..14cbc1c 100644
--- a/server/rest/server.go
+++ b/server/rest/server.go
@@ -19,10 +19,11 @@ package rest
import (
"crypto/tls"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/rest"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/plugin"
- "time"
)
func LoadConfig() (srvCfg *rest.ServerConfig, err error) {
diff --git a/server/rest/server_mux.go b/server/rest/server_mux.go
index 129bcf5..64a9417 100644
--- a/server/rest/server_mux.go
+++ b/server/rest/server_mux.go
@@ -18,9 +18,10 @@
package rest
import (
+ "net/http"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
- "net/http"
)
// The rest middleware design:
diff --git a/server/scerror/error.go b/server/scerror/error.go
index 0607e4c..548cdc5 100644
--- a/server/scerror/error.go
+++ b/server/scerror/error.go
@@ -20,6 +20,7 @@ package scerror
import (
"encoding/json"
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/log"
)
diff --git a/server/server.go b/server/server.go
index 3d77456..2e257f5 100644
--- a/server/server.go
+++ b/server/server.go
@@ -18,16 +18,14 @@
package server
import (
- //plugin
- _ "github.com/apache/servicecomb-service-center/server/service/event"
- "github.com/apache/servicecomb-service-center/server/service/rbac"
-)
-import (
+ "context"
"fmt"
"os"
"time"
- "context"
+ //plugin
+ _ "github.com/apache/servicecomb-service-center/server/service/event"
+
nf "github.com/apache/servicecomb-service-center/pkg/event"
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
@@ -36,6 +34,7 @@ import (
"github.com/apache/servicecomb-service-center/server/event"
"github.com/apache/servicecomb-service-center/server/mux"
"github.com/apache/servicecomb-service-center/server/plugin"
+ "github.com/apache/servicecomb-service-center/server/service/rbac"
serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
"github.com/apache/servicecomb-service-center/version"
"github.com/astaxie/beego"
diff --git a/server/service/auth/datasource.go b/server/service/auth/datasource.go
index 3f081ed..e689d4e 100644
--- a/server/service/auth/datasource.go
+++ b/server/service/auth/datasource.go
@@ -17,6 +17,7 @@ package auth
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
)
diff --git a/server/service/auth/etcd/etcd.go b/server/service/auth/etcd/etcd.go
index 89d3420..7d510af 100644
--- a/server/service/auth/etcd/etcd.go
+++ b/server/service/auth/etcd/etcd.go
@@ -19,6 +19,7 @@ import (
"context"
"encoding/json"
"errors"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
"github.com/apache/servicecomb-service-center/server/core/backend"
diff --git a/server/service/auth/etcd/etcd_test.go b/server/service/auth/etcd/etcd_test.go
index 7e2b418..935556a 100644
--- a/server/service/auth/etcd/etcd_test.go
+++ b/server/service/auth/etcd/etcd_test.go
@@ -21,6 +21,8 @@ package etcd
import (
"context"
+ "testing"
+
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
mgr "github.com/apache/servicecomb-service-center/server/plugin"
"github.com/apache/servicecomb-service-center/server/plugin/discovery/etcd"
@@ -29,7 +31,6 @@ import (
"github.com/apache/servicecomb-service-center/server/service/auth"
"github.com/astaxie/beego"
"github.com/stretchr/testify/assert"
- "testing"
)
var (
diff --git a/server/service/auth/etcd/key_generator_test.go b/server/service/auth/etcd/key_generator_test.go
index 80d4a3a..c2cac44 100644
--- a/server/service/auth/etcd/key_generator_test.go
+++ b/server/service/auth/etcd/key_generator_test.go
@@ -20,8 +20,9 @@
package etcd
import (
- "github.com/stretchr/testify/assert"
"testing"
+
+ "github.com/stretchr/testify/assert"
)
func TestGenerateETCDAccountKey(t *testing.T) {
diff --git a/server/service/auth/manager.go b/server/service/auth/manager.go
index c772e23..e978130 100644
--- a/server/service/auth/manager.go
+++ b/server/service/auth/manager.go
@@ -17,6 +17,7 @@ package auth
import (
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/log"
)
diff --git a/server/service/auth/manager_test.go b/server/service/auth/manager_test.go
index 40c77a9..9c1c53e 100644
--- a/server/service/auth/manager_test.go
+++ b/server/service/auth/manager_test.go
@@ -16,10 +16,11 @@
package auth
import (
+ "testing"
+
"github.com/apache/servicecomb-service-center/server/service/auth/etcd"
"github.com/go-chassis/go-archaius"
"github.com/stretchr/testify/assert"
- "testing"
)
func TestInit(t *testing.T) {
diff --git a/server/service/cache/dependency.go b/server/service/cache/dependency.go
index b717617..5573ce7 100644
--- a/server/service/cache/dependency.go
+++ b/server/service/cache/dependency.go
@@ -19,6 +19,7 @@ package cache
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/cache"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/server/service/cache/filter_consistency.go b/server/service/cache/filter_consistency.go
index 94725d1..055123f 100644
--- a/server/service/cache/filter_consistency.go
+++ b/server/service/cache/filter_consistency.go
@@ -20,6 +20,7 @@ package cache
import (
"context"
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/cache"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/server/service/cache/filter_consumer.go b/server/service/cache/filter_consumer.go
index b8252c7..420f258 100644
--- a/server/service/cache/filter_consumer.go
+++ b/server/service/cache/filter_consumer.go
@@ -19,6 +19,7 @@ package cache
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/cache"
)
diff --git a/server/service/cache/filter_instances.go b/server/service/cache/filter_instances.go
index 389dbb7..e62e009 100644
--- a/server/service/cache/filter_instances.go
+++ b/server/service/cache/filter_instances.go
@@ -20,6 +20,8 @@ package cache
import (
"context"
"fmt"
+ "sort"
+
"github.com/apache/servicecomb-service-center/pkg/cache"
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
@@ -27,7 +29,6 @@ import (
"github.com/apache/servicecomb-service-center/server/core/backend"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
- "sort"
)
var clustersIndex = make(map[string]int)
diff --git a/server/service/cache/filter_permission.go b/server/service/cache/filter_permission.go
index 3298255..4951c78 100644
--- a/server/service/cache/filter_permission.go
+++ b/server/service/cache/filter_permission.go
@@ -20,6 +20,7 @@ package cache
import (
"context"
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/cache"
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
diff --git a/server/service/cache/filter_service.go b/server/service/cache/filter_service.go
index 0b9e3bd..948a0dd 100644
--- a/server/service/cache/filter_service.go
+++ b/server/service/cache/filter_service.go
@@ -19,6 +19,7 @@ package cache
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/cache"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/server/service/cache/filter_tags.go b/server/service/cache/filter_tags.go
index b1ecec7..9ab5230 100644
--- a/server/service/cache/filter_tags.go
+++ b/server/service/cache/filter_tags.go
@@ -20,13 +20,14 @@ package cache
import (
"context"
"fmt"
+ "sort"
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/cache"
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
- "sort"
- "strings"
)
type TagsFilter struct {
diff --git a/server/service/cache/filter_version.go b/server/service/cache/filter_version.go
index 837927c..b490818 100644
--- a/server/service/cache/filter_version.go
+++ b/server/service/cache/filter_version.go
@@ -20,6 +20,7 @@ package cache
import (
"context"
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/cache"
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
diff --git a/server/service/cache/instance.go b/server/service/cache/instance.go
index 259738e..2144872 100644
--- a/server/service/cache/instance.go
+++ b/server/service/cache/instance.go
@@ -19,10 +19,11 @@ package cache
import (
"context"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/cache"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
- "time"
)
var FindInstances = &FindInstancesCache{
diff --git a/server/service/dep/etcd/util.go b/server/service/dep/etcd/util.go
index 96b083c..9c5ce25 100644
--- a/server/service/dep/etcd/util.go
+++ b/server/service/dep/etcd/util.go
@@ -17,6 +17,7 @@ package etcd
import (
"encoding/json"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
apt "github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
diff --git a/server/service/dep/manager.go b/server/service/dep/manager.go
index 1ff12ed..854e1a9 100644
--- a/server/service/dep/manager.go
+++ b/server/service/dep/manager.go
@@ -17,6 +17,7 @@ package dep
import (
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/log"
)
diff --git a/server/service/dep/manager_test.go b/server/service/dep/manager_test.go
index f51cffb..5b04734 100644
--- a/server/service/dep/manager_test.go
+++ b/server/service/dep/manager_test.go
@@ -16,10 +16,11 @@
package dep
import (
+ "testing"
+
"github.com/apache/servicecomb-service-center/server/service/dep/etcd"
"github.com/go-chassis/go-archaius"
"github.com/stretchr/testify/assert"
- "testing"
)
func TestInit(t *testing.T) {
diff --git a/server/service/dependency.go b/server/service/dependency.go
index c65a6b1..0100423 100644
--- a/server/service/dependency.go
+++ b/server/service/dependency.go
@@ -21,6 +21,7 @@ import (
"context"
"encoding/json"
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/server/service/dependency_test.go b/server/service/dependency_test.go
index b80c321..991b1cf 100644
--- a/server/service/dependency_test.go
+++ b/server/service/dependency_test.go
@@ -17,13 +17,14 @@
package service_test
import (
+ "strconv"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/server/core/proto"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
"github.com/apache/servicecomb-service-center/server/service/event"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
- "strconv"
)
var deh event.DependencyEventHandler
diff --git a/server/service/dependency_validator.go b/server/service/dependency_validator.go
index 8bd0df8..e65cd2e 100644
--- a/server/service/dependency_validator.go
+++ b/server/service/dependency_validator.go
@@ -18,9 +18,10 @@
package service
import (
+ "regexp"
+
"github.com/apache/servicecomb-service-center/pkg/validate"
serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
- "regexp"
)
var (
diff --git a/server/service/event/dependency_event_handler.go b/server/service/event/dependency_event_handler.go
index ec5847d..97b5d22 100644
--- a/server/service/event/dependency_event_handler.go
+++ b/server/service/event/dependency_event_handler.go
@@ -19,6 +19,8 @@ package event
import (
"context"
"fmt"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/backoff"
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
@@ -32,7 +34,6 @@ import (
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
- "time"
)
const defaultEventHandleInterval = 5 * time.Minute
diff --git a/server/service/event/dependency_rule_event_handler_test.go b/server/service/event/dependency_rule_event_handler_test.go
index cb4e839..56e8913 100644
--- a/server/service/event/dependency_rule_event_handler_test.go
+++ b/server/service/event/dependency_rule_event_handler_test.go
@@ -18,11 +18,12 @@ package event
import (
"context"
+ "testing"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
"github.com/apache/servicecomb-service-center/server/service/cache"
- "testing"
)
func TestNewDependencyRuleEventHandler(t *testing.T) {
diff --git a/server/service/event/rule_event_handler.go b/server/service/event/rule_event_handler.go
index d719800..961b662 100644
--- a/server/service/event/rule_event_handler.go
+++ b/server/service/event/rule_event_handler.go
@@ -19,6 +19,7 @@ package event
import (
"context"
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/task"
diff --git a/server/service/event/schema_summary_event_handler.go b/server/service/event/schema_summary_event_handler.go
index d526eaf..4aba1c0 100644
--- a/server/service/event/schema_summary_event_handler.go
+++ b/server/service/event/schema_summary_event_handler.go
@@ -17,12 +17,13 @@
package event
import (
+ "strings"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/core/backend"
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
"github.com/apache/servicecomb-service-center/server/service/metrics"
- "strings"
)
// SchemaSummaryEventHandler report schema metrics
diff --git a/server/service/event/service_event_handler.go b/server/service/event/service_event_handler.go
index 54aa54e..e45fab0 100644
--- a/server/service/event/service_event_handler.go
+++ b/server/service/event/service_event_handler.go
@@ -18,6 +18,8 @@ package event
import (
"context"
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/server/core"
@@ -27,7 +29,6 @@ import (
"github.com/apache/servicecomb-service-center/server/service/cache"
"github.com/apache/servicecomb-service-center/server/service/metrics"
serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
- "strings"
)
// ServiceEventHandler is the handler to handle:
diff --git a/server/service/event/tag_event_handler.go b/server/service/event/tag_event_handler.go
index 7416f2d..344dcae 100644
--- a/server/service/event/tag_event_handler.go
+++ b/server/service/event/tag_event_handler.go
@@ -19,6 +19,7 @@ package event
import (
"context"
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/task"
diff --git a/server/service/instance.go b/server/service/instance.go
index aafa7b4..398f015 100644
--- a/server/service/instance.go
+++ b/server/service/instance.go
@@ -22,6 +22,10 @@ import (
"encoding/json"
"errors"
"fmt"
+ "os"
+ "strconv"
+ "time"
+
errorsEx "github.com/apache/servicecomb-service-center/pkg/errors"
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
@@ -37,9 +41,6 @@ import (
scerr "github.com/apache/servicecomb-service-center/server/scerror"
"github.com/apache/servicecomb-service-center/server/service/cache"
serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
- "os"
- "strconv"
- "time"
)
var (
diff --git a/server/service/instance_test.go b/server/service/instance_test.go
index 52df22f..cfd3c9c 100644
--- a/server/service/instance_test.go
+++ b/server/service/instance_test.go
@@ -17,6 +17,11 @@
package service_test
import (
+ "math"
+ "os"
+ "strconv"
+ "strings"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/core"
@@ -24,10 +29,6 @@ import (
scerr "github.com/apache/servicecomb-service-center/server/scerror"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
- "math"
- "os"
- "strconv"
- "strings"
)
var (
diff --git a/server/service/instance_validator.go b/server/service/instance_validator.go
index c50a5bb..4324d03 100644
--- a/server/service/instance_validator.go
+++ b/server/service/instance_validator.go
@@ -18,11 +18,12 @@
package service
import (
+ "math"
+ "regexp"
+
"github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/pkg/validate"
- "math"
- "regexp"
)
var (
diff --git a/server/service/kv/store.go b/server/service/kv/store.go
index f47a42c..d115c77 100644
--- a/server/service/kv/store.go
+++ b/server/service/kv/store.go
@@ -21,6 +21,7 @@ package kv
import (
"context"
"errors"
+
"github.com/coreos/etcd/mvcc/mvccpb"
"github.com/apache/servicecomb-service-center/server/core/backend"
diff --git a/server/service/kv/store_test.go b/server/service/kv/store_test.go
index 3b27937..b98866f 100644
--- a/server/service/kv/store_test.go
+++ b/server/service/kv/store_test.go
@@ -19,6 +19,8 @@ package kv_test
import (
"context"
+ "testing"
+
mgr "github.com/apache/servicecomb-service-center/server/plugin"
"github.com/apache/servicecomb-service-center/server/plugin/discovery/etcd"
etcd2 "github.com/apache/servicecomb-service-center/server/plugin/registry/etcd"
@@ -26,7 +28,6 @@ import (
"github.com/apache/servicecomb-service-center/server/service/kv"
"github.com/astaxie/beego"
"github.com/stretchr/testify/assert"
- "testing"
)
func init() {
diff --git a/server/service/lock/etcd/etcd.go b/server/service/lock/etcd/etcd.go
index 106a102..359d741 100644
--- a/server/service/lock/etcd/etcd.go
+++ b/server/service/lock/etcd/etcd.go
@@ -20,6 +20,10 @@ package etcd
import (
"context"
"fmt"
+ "os"
+ "sync"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
@@ -27,9 +31,6 @@ import (
"github.com/apache/servicecomb-service-center/server/plugin/registry"
"github.com/apache/servicecomb-service-center/server/service/lock"
"github.com/coreos/etcd/client"
- "os"
- "sync"
- "time"
)
const (
diff --git a/server/service/lock/etcd/etcd_test.go b/server/service/lock/etcd/etcd_test.go
index 23ce36d..18008a1 100644
--- a/server/service/lock/etcd/etcd_test.go
+++ b/server/service/lock/etcd/etcd_test.go
@@ -21,12 +21,14 @@ package etcd
import (
"fmt"
+ "testing"
+
_ "github.com/apache/servicecomb-service-center/server/plugin/registry/etcd"
_ "github.com/apache/servicecomb-service-center/server/plugin/tracing/pzipkin"
+
"github.com/apache/servicecomb-service-center/server/service/lock"
"github.com/astaxie/beego"
"github.com/stretchr/testify/assert"
- "testing"
)
func init() {
diff --git a/server/service/lock/manager.go b/server/service/lock/manager.go
index 3798428..a7171de 100644
--- a/server/service/lock/manager.go
+++ b/server/service/lock/manager.go
@@ -17,6 +17,7 @@ package lock
import (
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/log"
)
diff --git a/server/service/microservice.go b/server/service/microservice.go
index 9e9fea6..7c7afc8 100644
--- a/server/service/microservice.go
+++ b/server/service/microservice.go
@@ -21,10 +21,11 @@ import (
"encoding/json"
"errors"
"fmt"
- "github.com/apache/servicecomb-service-center/server/core/proto"
"strconv"
"time"
+ "github.com/apache/servicecomb-service-center/server/core/proto"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
diff --git a/server/service/microservice_test.go b/server/service/microservice_test.go
index ce8b0ba..69d8b39 100644
--- a/server/service/microservice_test.go
+++ b/server/service/microservice_test.go
@@ -17,6 +17,9 @@
package service_test
import (
+ "strconv"
+ "strings"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/core/proto"
@@ -24,8 +27,6 @@ import (
scerr "github.com/apache/servicecomb-service-center/server/scerror"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
- "strconv"
- "strings"
)
var (
diff --git a/server/service/microservice_validator.go b/server/service/microservice_validator.go
index acc8315..3b2e6a1 100644
--- a/server/service/microservice_validator.go
+++ b/server/service/microservice_validator.go
@@ -18,12 +18,13 @@
package service
import (
+ "regexp"
+
"github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/pkg/validate"
"github.com/apache/servicecomb-service-center/server/plugin/quota"
serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
- "regexp"
)
var (
diff --git a/server/service/ms/datasource.go b/server/service/ms/datasource.go
index 1c93b82..00677ee 100644
--- a/server/service/ms/datasource.go
+++ b/server/service/ms/datasource.go
@@ -17,6 +17,7 @@ package ms
import (
"context"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
)
diff --git a/server/service/ms/etcd/etcd.go b/server/service/ms/etcd/etcd.go
index a9671f8..0d12ec8 100644
--- a/server/service/ms/etcd/etcd.go
+++ b/server/service/ms/etcd/etcd.go
@@ -20,6 +20,9 @@ import (
"encoding/json"
"errors"
"fmt"
+ "strconv"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
@@ -33,8 +36,6 @@ import (
depUtil "github.com/apache/servicecomb-service-center/server/service/dep/etcd"
"github.com/apache/servicecomb-service-center/server/service/ms"
serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
- "strconv"
- "time"
)
// TODO: define error with names here
diff --git a/server/service/ms/etcd/etcd_suite_test.go b/server/service/ms/etcd/etcd_suite_test.go
index e956a6d..dc45d5d 100644
--- a/server/service/ms/etcd/etcd_suite_test.go
+++ b/server/service/ms/etcd/etcd_suite_test.go
@@ -18,17 +18,18 @@ package etcd_test
// initialize
import (
- _ "github.com/apache/servicecomb-service-center/server/bootstrap"
-)
-import (
"context"
+ "testing"
+
+ _ "github.com/apache/servicecomb-service-center/server/bootstrap"
+
+ . "github.com/onsi/ginkgo"
+ . "github.com/onsi/gomega"
+
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/astaxie/beego"
- . "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
- . "github.com/onsi/gomega"
- "testing"
)
func init() {
diff --git a/server/service/ms/etcd/etcd_test.go b/server/service/ms/etcd/etcd_test.go
index 8811f1f..c958b8a 100644
--- a/server/service/ms/etcd/etcd_test.go
+++ b/server/service/ms/etcd/etcd_test.go
@@ -16,6 +16,11 @@
package etcd_test
import (
+ "strconv"
+ "strings"
+ "testing"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/server/core/proto"
@@ -26,10 +31,6 @@ import (
"github.com/apache/servicecomb-service-center/server/service/ms/etcd"
"github.com/go-chassis/go-archaius"
"github.com/stretchr/testify/assert"
- "strconv"
- "strings"
- "testing"
- "time"
)
func TestInit(t *testing.T) {
diff --git a/server/service/ms/etcd/util.go b/server/service/ms/etcd/util.go
index ef8e321..8af0fc3 100644
--- a/server/service/ms/etcd/util.go
+++ b/server/service/ms/etcd/util.go
@@ -19,6 +19,10 @@ import (
"context"
"encoding/json"
"errors"
+ "strconv"
+ "strings"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
@@ -31,9 +35,6 @@ import (
"github.com/apache/servicecomb-service-center/server/plugin/uuid"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
- "strconv"
- "strings"
- "time"
)
var (
diff --git a/server/service/ms/manager.go b/server/service/ms/manager.go
index 0453020..4304728 100644
--- a/server/service/ms/manager.go
+++ b/server/service/ms/manager.go
@@ -17,6 +17,7 @@ package ms
import (
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/log"
)
diff --git a/server/service/ms/manager_test.go b/server/service/ms/manager_test.go
index 4ac3031..738e7b6 100644
--- a/server/service/ms/manager_test.go
+++ b/server/service/ms/manager_test.go
@@ -16,14 +16,15 @@
package ms_test
import (
+ "strconv"
+ "strings"
+ "testing"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/server/service/ms"
"github.com/apache/servicecomb-service-center/server/service/ms/etcd"
"github.com/go-chassis/go-archaius"
"github.com/stretchr/testify/assert"
- "strconv"
- "strings"
- "testing"
)
func TestInit(t *testing.T) {
diff --git a/server/service/rbac/authr_plugin.go b/server/service/rbac/authr_plugin.go
index 3f4f013..7eb4a7d 100644
--- a/server/service/rbac/authr_plugin.go
+++ b/server/service/rbac/authr_plugin.go
@@ -20,6 +20,7 @@ package rbac
import (
"context"
"errors"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/privacy"
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
diff --git a/server/service/rbac/blocker_test.go b/server/service/rbac/blocker_test.go
index ce27b68..82e21ce 100644
--- a/server/service/rbac/blocker_test.go
+++ b/server/service/rbac/blocker_test.go
@@ -18,10 +18,11 @@
package rbac_test
import (
- "github.com/apache/servicecomb-service-center/server/service/rbac"
- "github.com/stretchr/testify/assert"
"testing"
"time"
+
+ "github.com/apache/servicecomb-service-center/server/service/rbac"
+ "github.com/stretchr/testify/assert"
)
func TestCountFailure(t *testing.T) {
diff --git a/server/service/rbac/dao/account_dao.go b/server/service/rbac/dao/account_dao.go
index df0af4e..d4b79a2 100644
--- a/server/service/rbac/dao/account_dao.go
+++ b/server/service/rbac/dao/account_dao.go
@@ -23,6 +23,7 @@ import (
"encoding/json"
"errors"
"fmt"
+
"github.com/apache/servicecomb-service-center/pkg/etcdsync"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/privacy"
diff --git a/server/service/rbac/dao/account_dao_test.go b/server/service/rbac/dao/account_dao_test.go
index 06c5b7d..f3b47f1 100644
--- a/server/service/rbac/dao/account_dao_test.go
+++ b/server/service/rbac/dao/account_dao_test.go
@@ -19,6 +19,8 @@ package dao_test
import (
"context"
+ "testing"
+
"github.com/apache/servicecomb-service-center/pkg/privacy"
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
mgr "github.com/apache/servicecomb-service-center/server/plugin"
@@ -28,7 +30,6 @@ import (
"github.com/apache/servicecomb-service-center/server/service/rbac/dao"
"github.com/astaxie/beego"
"github.com/stretchr/testify/assert"
- "testing"
)
func init() {
diff --git a/server/service/rbac/dao/role_dao.go b/server/service/rbac/dao/role_dao.go
index a31c486..efc730d 100644
--- a/server/service/rbac/dao/role_dao.go
+++ b/server/service/rbac/dao/role_dao.go
@@ -19,6 +19,7 @@ package dao
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
)
diff --git a/server/service/rbac/decision.go b/server/service/rbac/decision.go
index 6df1206..4567b1b 100644
--- a/server/service/rbac/decision.go
+++ b/server/service/rbac/decision.go
@@ -19,6 +19,7 @@ package rbac
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/server/service/rbac/dao"
)
diff --git a/server/service/rbac/decision_test.go b/server/service/rbac/decision_test.go
index 5dc1bce..12305c8 100644
--- a/server/service/rbac/decision_test.go
+++ b/server/service/rbac/decision_test.go
@@ -19,9 +19,10 @@ package rbac_test
import (
"context"
+ "testing"
+
"github.com/apache/servicecomb-service-center/server/service/rbac"
"github.com/stretchr/testify/assert"
- "testing"
)
func TestAllow(t *testing.T) {
diff --git a/server/service/rbac/password.go b/server/service/rbac/password.go
index 644b3d5..e893f9c 100644
--- a/server/service/rbac/password.go
+++ b/server/service/rbac/password.go
@@ -19,6 +19,7 @@ package rbac
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/privacy"
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
diff --git a/server/service/rbac/rbac.go b/server/service/rbac/rbac.go
index c2fe080..d9cde42 100644
--- a/server/service/rbac/rbac.go
+++ b/server/service/rbac/rbac.go
@@ -21,6 +21,8 @@ import (
"context"
"crypto/rsa"
"errors"
+ "io/ioutil"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
"github.com/apache/servicecomb-service-center/server/core"
@@ -31,7 +33,6 @@ import (
"github.com/go-chassis/go-archaius"
"github.com/go-chassis/go-chassis/security/authr"
"github.com/go-chassis/go-chassis/security/secret"
- "io/ioutil"
)
const (
diff --git a/server/service/rbac/rbca_test.go b/server/service/rbac/rbca_test.go
index 50a2667..3a3e7f3 100644
--- a/server/service/rbac/rbca_test.go
+++ b/server/service/rbac/rbca_test.go
@@ -20,18 +20,20 @@ package rbac_test
import (
"context"
"fmt"
+ "io/ioutil"
+ "testing"
+
+ _ "github.com/apache/servicecomb-service-center/test"
+
"github.com/apache/servicecomb-service-center/pkg/privacy"
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
"github.com/apache/servicecomb-service-center/server/service/rbac"
"github.com/apache/servicecomb-service-center/server/service/rbac/dao"
- _ "github.com/apache/servicecomb-service-center/test"
"github.com/astaxie/beego"
"github.com/go-chassis/go-archaius"
"github.com/go-chassis/go-chassis/security/authr"
"github.com/go-chassis/go-chassis/security/secret"
"github.com/stretchr/testify/assert"
- "io/ioutil"
- "testing"
)
func init() {
diff --git a/server/service/rule.go b/server/service/rule.go
index 40592a3..019134c 100644
--- a/server/service/rule.go
+++ b/server/service/rule.go
@@ -20,6 +20,9 @@ package service
import (
"context"
"encoding/json"
+ "strconv"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
@@ -31,8 +34,6 @@ import (
"github.com/apache/servicecomb-service-center/server/plugin/registry"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
- "strconv"
- "time"
)
func (s *MicroServiceService) AddRule(ctx context.Context, in *pb.AddServiceRulesRequest) (*pb.AddServiceRulesResponse, error) {
diff --git a/server/service/rule_test.go b/server/service/rule_test.go
index 4700d9c..12318f7 100644
--- a/server/service/rule_test.go
+++ b/server/service/rule_test.go
@@ -17,13 +17,14 @@
package service_test
import (
+ "strconv"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/plugin/quota"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
- "strconv"
)
var _ = Describe("'Rule' service", func() {
diff --git a/server/service/rule_validator.go b/server/service/rule_validator.go
index 4d0cc08..306ee5d 100644
--- a/server/service/rule_validator.go
+++ b/server/service/rule_validator.go
@@ -18,9 +18,10 @@
package service
import (
+ "regexp"
+
"github.com/apache/servicecomb-service-center/pkg/validate"
"github.com/apache/servicecomb-service-center/server/plugin/quota"
- "regexp"
)
var (
diff --git a/server/service/schema.go b/server/service/schema.go
index 36e1748..8cb5e6d 100644
--- a/server/service/schema.go
+++ b/server/service/schema.go
@@ -19,9 +19,10 @@ package service
import (
"fmt"
- "github.com/apache/servicecomb-service-center/server/core/proto"
"strings"
+ "github.com/apache/servicecomb-service-center/server/core/proto"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/server/service/schema_test.go b/server/service/schema_test.go
index d9b76da..fa5e56e 100644
--- a/server/service/schema_test.go
+++ b/server/service/schema_test.go
@@ -17,10 +17,11 @@
package service_test
import (
- "github.com/apache/servicecomb-service-center/server/core/proto"
"strconv"
"strings"
+ "github.com/apache/servicecomb-service-center/server/core/proto"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/server/plugin/quota"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
diff --git a/server/service/schema_validator.go b/server/service/schema_validator.go
index 1b0518d..07392d2 100644
--- a/server/service/schema_validator.go
+++ b/server/service/schema_validator.go
@@ -18,9 +18,10 @@
package service
import (
+ "regexp"
+
"github.com/apache/servicecomb-service-center/pkg/validate"
"github.com/apache/servicecomb-service-center/server/plugin/quota"
- "regexp"
)
var (
diff --git a/server/service/service.go b/server/service/service.go
index 7b470b9..a2e2ef5 100644
--- a/server/service/service.go
+++ b/server/service/service.go
@@ -18,8 +18,9 @@
package service
import (
- "github.com/apache/servicecomb-service-center/server/core/proto"
"os"
+
+ "github.com/apache/servicecomb-service-center/server/core/proto"
)
var (
diff --git a/server/service/service_suite_test.go b/server/service/service_suite_test.go
index c4fed07..ab352c2 100644
--- a/server/service/service_suite_test.go
+++ b/server/service/service_suite_test.go
@@ -18,19 +18,20 @@ package service_test
// initialize
import (
- _ "github.com/apache/servicecomb-service-center/server/bootstrap"
- "github.com/apache/servicecomb-service-center/server/core/proto"
-)
-import (
"context"
+ "testing"
+
+ _ "github.com/apache/servicecomb-service-center/server/bootstrap"
+
+ . "github.com/onsi/ginkgo"
+ . "github.com/onsi/gomega"
+
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/core"
+ "github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/service"
"github.com/astaxie/beego"
- . "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
- . "github.com/onsi/gomega"
- "testing"
)
var serviceResource proto.ServiceCtrlServer
diff --git a/server/service/tag.go b/server/service/tag.go
index 7eed8b4..dd6021e 100644
--- a/server/service/tag.go
+++ b/server/service/tag.go
@@ -20,6 +20,7 @@ package service
import (
"context"
"encoding/json"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/server/service/tag_test.go b/server/service/tag_test.go
index 6206e6c..23c5809 100644
--- a/server/service/tag_test.go
+++ b/server/service/tag_test.go
@@ -18,14 +18,15 @@ package service_test
import (
"fmt"
+ "strconv"
+ "strings"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/plugin/quota"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
- "strconv"
- "strings"
)
var (
diff --git a/server/service/tag_validator.go b/server/service/tag_validator.go
index fdcda74..4acc235 100644
--- a/server/service/tag_validator.go
+++ b/server/service/tag_validator.go
@@ -18,9 +18,10 @@
package service
import (
+ "regexp"
+
"github.com/apache/servicecomb-service-center/pkg/validate"
"github.com/apache/servicecomb-service-center/server/plugin/quota"
- "regexp"
)
var (
diff --git a/server/service/util/dependency.go b/server/service/util/dependency.go
index 7c5c03c..8676804 100644
--- a/server/service/util/dependency.go
+++ b/server/service/util/dependency.go
@@ -19,6 +19,7 @@ package util
import (
"context"
"encoding/json"
+
"github.com/apache/servicecomb-service-center/pkg/log"
rmodel "github.com/apache/servicecomb-service-center/pkg/registry"
apt "github.com/apache/servicecomb-service-center/server/core"
diff --git a/server/service/util/dependency_query.go b/server/service/util/dependency_query.go
index 2659152..ca50245 100644
--- a/server/service/util/dependency_query.go
+++ b/server/service/util/dependency_query.go
@@ -19,6 +19,8 @@ package util
import (
"context"
"fmt"
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
@@ -26,7 +28,6 @@ import (
"github.com/apache/servicecomb-service-center/server/core/backend"
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
- "strings"
)
type DependencyRelationFilterOpt struct {
diff --git a/server/service/util/dependency_test.go b/server/service/util/dependency_test.go
index c550981..339b93a 100644
--- a/server/service/util/dependency_test.go
+++ b/server/service/util/dependency_test.go
@@ -18,8 +18,9 @@ package util
import (
"context"
- "github.com/apache/servicecomb-service-center/pkg/registry"
"testing"
+
+ "github.com/apache/servicecomb-service-center/pkg/registry"
)
func TestDeleteDependencyForService(t *testing.T) {
diff --git a/server/service/util/dependency_util.go b/server/service/util/dependency_util.go
index 7917312..f9c51e9 100644
--- a/server/service/util/dependency_util.go
+++ b/server/service/util/dependency_util.go
@@ -21,6 +21,8 @@ import (
"encoding/json"
"errors"
"fmt"
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
@@ -29,7 +31,6 @@ import (
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
- "strings"
)
func GetConsumerIds(ctx context.Context, domainProject string, provider *pb.MicroService) ([]string, error) {
diff --git a/server/service/util/domain_util.go b/server/service/util/domain_util.go
index 1e92774..b6b065d 100644
--- a/server/service/util/domain_util.go
+++ b/server/service/util/domain_util.go
@@ -18,13 +18,14 @@ package util
import (
"context"
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
apt "github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/core/backend"
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
- "strings"
)
func GetAllDomainRawData(ctx context.Context) ([]*discovery.KeyValue, error) {
diff --git a/server/service/util/heartbeat_util.go b/server/service/util/heartbeat_util.go
index 56afb61..d0fabed 100644
--- a/server/service/util/heartbeat_util.go
+++ b/server/service/util/heartbeat_util.go
@@ -19,6 +19,7 @@ package util
import (
"context"
"errors"
+
apt "github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/core/backend"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
diff --git a/server/service/util/instance_util.go b/server/service/util/instance_util.go
index 2d77dd4..8e683bd 100644
--- a/server/service/util/instance_util.go
+++ b/server/service/util/instance_util.go
@@ -21,6 +21,10 @@ import (
"crypto/sha1"
"encoding/json"
"fmt"
+ "strconv"
+ "strings"
+ "time"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
rmodel "github.com/apache/servicecomb-service-center/pkg/registry"
@@ -31,9 +35,6 @@ import (
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
- "strconv"
- "strings"
- "time"
)
func GetLeaseID(ctx context.Context, domainProject string, serviceID string, instanceID string) (int64, error) {
diff --git a/server/service/util/instance_util_test.go b/server/service/util/instance_util_test.go
index ca075c5..69e79b3 100644
--- a/server/service/util/instance_util_test.go
+++ b/server/service/util/instance_util_test.go
@@ -18,11 +18,12 @@ package util
import (
"context"
+ "testing"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/core/proto"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
- "testing"
)
func TestFormatRevision(t *testing.T) {
diff --git a/server/service/util/microservice_util.go b/server/service/util/microservice_util.go
index 987d60d..7a4a297 100644
--- a/server/service/util/microservice_util.go
+++ b/server/service/util/microservice_util.go
@@ -18,9 +18,10 @@ package util
import (
"encoding/json"
- "github.com/apache/servicecomb-service-center/server/core/proto"
"strings"
+ "github.com/apache/servicecomb-service-center/server/core/proto"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/server/service/util/rule_util.go b/server/service/util/rule_util.go
index 9c40a12..61c4ed8 100644
--- a/server/service/util/rule_util.go
+++ b/server/service/util/rule_util.go
@@ -19,6 +19,10 @@ package util
import (
"context"
"fmt"
+ "reflect"
+ "regexp"
+ "strings"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
@@ -27,9 +31,6 @@ import (
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
scerr "github.com/apache/servicecomb-service-center/server/scerror"
- "reflect"
- "regexp"
- "strings"
)
type RuleFilter struct {
diff --git a/server/service/util/rule_util_test.go b/server/service/util/rule_util_test.go
index 52bbda4..7c4ddea 100644
--- a/server/service/util/rule_util_test.go
+++ b/server/service/util/rule_util_test.go
@@ -18,11 +18,12 @@ package util
import (
"context"
+ "net/http"
+ "testing"
+
"github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/core/proto"
- "net/http"
- "testing"
)
func TestRuleFilter_Filter(t *testing.T) {
diff --git a/server/service/util/schema_util.go b/server/service/util/schema_util.go
index 6fdbc0a..05241f5 100644
--- a/server/service/util/schema_util.go
+++ b/server/service/util/schema_util.go
@@ -18,6 +18,7 @@ package util
import (
"context"
+
"github.com/apache/servicecomb-service-center/server/core/backend"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
)
diff --git a/server/service/util/tag_util.go b/server/service/util/tag_util.go
index b9181c3..82e364c 100644
--- a/server/service/util/tag_util.go
+++ b/server/service/util/tag_util.go
@@ -19,6 +19,7 @@ package util
import (
"context"
"encoding/json"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/util"
apt "github.com/apache/servicecomb-service-center/server/core"
diff --git a/server/service/util/util.go b/server/service/util/util.go
index 2039e6a..2b9ecbe 100644
--- a/server/service/util/util.go
+++ b/server/service/util/util.go
@@ -18,6 +18,7 @@ package util
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
)
diff --git a/server/service/util/util_suite_test.go b/server/service/util/util_suite_test.go
index ac4c2ae..202f467 100644
--- a/server/service/util/util_suite_test.go
+++ b/server/service/util/util_suite_test.go
@@ -17,21 +17,21 @@
package util_test
import (
+ "context"
+ "testing"
+
+ . "github.com/onsi/ginkgo"
+ . "github.com/onsi/gomega"
+
_ "github.com/apache/servicecomb-service-center/server/plugin/discovery/etcd"
_ "github.com/apache/servicecomb-service-center/server/plugin/quota/buildin"
_ "github.com/apache/servicecomb-service-center/server/plugin/registry/buildin"
-)
-import (
- "context"
proto "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
- . "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
- . "github.com/onsi/gomega"
- "testing"
)
func init() {
diff --git a/server/service/util/versionrule.go b/server/service/util/versionrule.go
index 96d392c..867af12 100644
--- a/server/service/util/versionrule.go
+++ b/server/service/util/versionrule.go
@@ -17,12 +17,13 @@
package util
import (
- "github.com/apache/servicecomb-service-center/pkg/util"
- "github.com/apache/servicecomb-service-center/server/plugin/discovery"
"regexp"
"sort"
"strconv"
"strings"
+
+ "github.com/apache/servicecomb-service-center/pkg/util"
+ "github.com/apache/servicecomb-service-center/server/plugin/discovery"
)
type VersionRule func(sorted []string, kvs map[string]*discovery.KeyValue, start, end string) []string
diff --git a/server/service/util/versionrule_test.go b/server/service/util/versionrule_test.go
index 47690b4..b240517 100644
--- a/server/service/util/versionrule_test.go
+++ b/server/service/util/versionrule_test.go
@@ -18,11 +18,12 @@ package util
import (
"fmt"
+ "sort"
+ "testing"
+
"github.com/apache/servicecomb-service-center/server/plugin/discovery"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
- "sort"
- "testing"
)
const VERSIONRULE_BASE = 5000
diff --git a/server/service/validate.go b/server/service/validate.go
index c573ae2..1981cad 100644
--- a/server/service/validate.go
+++ b/server/service/validate.go
@@ -19,12 +19,13 @@ package service
import (
"errors"
+ "reflect"
+ "regexp"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/validate"
- "reflect"
- "regexp"
)
var createAccountValidator = &validate.Validator{}
diff --git a/server/service/watch.go b/server/service/watch.go
index b12cf82..1b6a055 100644
--- a/server/service/watch.go
+++ b/server/service/watch.go
@@ -20,6 +20,7 @@ package service
import (
"context"
"errors"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/server/service/watch_test.go b/server/service/watch_test.go
index 64e3622..690cd89 100644
--- a/server/service/watch_test.go
+++ b/server/service/watch_test.go
@@ -18,13 +18,14 @@ package service_test
import (
"context"
+ "testing"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/service"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"google.golang.org/grpc"
- "testing"
)
type grpcWatchServer struct {
diff --git a/server/task/clear_service.go b/server/task/clear_service.go
index 3d52cef..5184b28 100644
--- a/server/task/clear_service.go
+++ b/server/task/clear_service.go
@@ -18,11 +18,12 @@ package task
import (
"context"
"errors"
- "github.com/apache/servicecomb-service-center/server/core/proto"
"strconv"
"strings"
"time"
+ "github.com/apache/servicecomb-service-center/server/core/proto"
+
"github.com/apache/servicecomb-service-center/pkg/log"
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/server/task/clear_service_test.go b/server/task/clear_service_test.go
index e9b7b05..d7b1df4 100644
--- a/server/task/clear_service_test.go
+++ b/server/task/clear_service_test.go
@@ -17,25 +17,24 @@ package task_test
// initialize
import (
- _ "github.com/apache/servicecomb-service-center/server/bootstrap"
- "github.com/apache/servicecomb-service-center/server/core/proto"
-)
-import _ "github.com/apache/servicecomb-service-center/server"
-
-import (
"context"
"fmt"
"testing"
"time"
+ _ "github.com/apache/servicecomb-service-center/server/bootstrap"
+
+ _ "github.com/apache/servicecomb-service-center/server"
+
+ . "github.com/onsi/ginkgo"
+ . "github.com/onsi/gomega"
+
pb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
apt "github.com/apache/servicecomb-service-center/server/core"
+ "github.com/apache/servicecomb-service-center/server/core/proto"
"github.com/apache/servicecomb-service-center/server/task"
"github.com/astaxie/beego"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
)
func init() {
diff --git a/server/version.go b/server/version.go
index 389ade1..b626668 100644
--- a/server/version.go
+++ b/server/version.go
@@ -20,6 +20,7 @@ package server
import (
"context"
"encoding/json"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/core/backend"
diff --git a/syncer/config/config.go b/syncer/config/config.go
index e71c598..31f79d0 100644
--- a/syncer/config/config.go
+++ b/syncer/config/config.go
@@ -23,6 +23,7 @@ import (
"strconv"
"errors"
+
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/syncer/pkg/utils"
"gopkg.in/yaml.v2"
diff --git a/syncer/config/config_test.go b/syncer/config/config_test.go
index 873238c..dc443fc 100644
--- a/syncer/config/config_test.go
+++ b/syncer/config/config_test.go
@@ -17,12 +17,13 @@
package config
import (
- "github.com/apache/servicecomb-service-center/syncer/pkg/utils"
"io/ioutil"
"os"
"path/filepath"
"testing"
+ "github.com/apache/servicecomb-service-center/syncer/pkg/utils"
+
"github.com/stretchr/testify/assert"
)
diff --git a/syncer/config/verify.go b/syncer/config/verify.go
index 98fa1fc..3158210 100644
--- a/syncer/config/verify.go
+++ b/syncer/config/verify.go
@@ -29,8 +29,8 @@ import (
"time"
"github.com/apache/servicecomb-service-center/pkg/log"
- "github.com/apache/servicecomb-service-center/pkg/tlsutil"
"github.com/apache/servicecomb-service-center/syncer/pkg/utils"
+ "github.com/go-chassis/foundation/tlsutil"
"github.com/pkg/errors"
)
diff --git a/syncer/etcd/option.go b/syncer/etcd/option.go
index 1a951bf..26332a2 100644
--- a/syncer/etcd/option.go
+++ b/syncer/etcd/option.go
@@ -21,7 +21,6 @@ import (
"net/url"
"github.com/apache/servicecomb-service-center/pkg/log"
- "github.com/apache/servicecomb-service-center/pkg/tlsutil"
"github.com/coreos/etcd/compactor"
"github.com/coreos/etcd/embed"
"github.com/coreos/etcd/etcdserver"
@@ -31,7 +30,6 @@ type config struct {
name string
dataDir string
peerAddr string
- tlsConf *tlsutil.SSLConfig
peers map[string]string
}
diff --git a/syncer/pkg/syssig/signal.go b/syncer/pkg/syssig/signal.go
index 13b6251..04bb0ff 100644
--- a/syncer/pkg/syssig/signal.go
+++ b/syncer/pkg/syssig/signal.go
@@ -19,11 +19,12 @@ package syssig
import (
"context"
"fmt"
- "github.com/apache/servicecomb-service-center/pkg/log"
"os"
"os/signal"
"sync"
"syscall"
+
+ "github.com/apache/servicecomb-service-center/pkg/log"
)
var (
diff --git a/syncer/pkg/ticker/ticker.go b/syncer/pkg/ticker/ticker.go
index ac861a4..cd1aeb7 100644
--- a/syncer/pkg/ticker/ticker.go
+++ b/syncer/pkg/ticker/ticker.go
@@ -18,9 +18,10 @@ package ticker
import (
"context"
- "github.com/apache/servicecomb-service-center/pkg/log"
"sync"
"time"
+
+ "github.com/apache/servicecomb-service-center/pkg/log"
)
// TaskTicker task of ticker struct
diff --git a/syncer/plugins/eureka/eureka.go b/syncer/plugins/eureka/eureka.go
index 281920f..6082868 100644
--- a/syncer/plugins/eureka/eureka.go
+++ b/syncer/plugins/eureka/eureka.go
@@ -20,10 +20,11 @@ import (
"context"
"encoding/json"
"errors"
- "github.com/apache/servicecomb-service-center/client"
"io/ioutil"
"net/http"
+ "github.com/apache/servicecomb-service-center/client"
+
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/syncer/plugins"
pb "github.com/apache/servicecomb-service-center/syncer/proto"
diff --git a/syncer/plugins/servicecenter/instance.go b/syncer/plugins/servicecenter/instance.go
index 1837d38..cb78a4d 100644
--- a/syncer/plugins/servicecenter/instance.go
+++ b/syncer/plugins/servicecenter/instance.go
@@ -18,6 +18,7 @@ package servicecenter
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/util"
pb "github.com/apache/servicecomb-service-center/syncer/proto"
)
diff --git a/syncer/plugins/servicecenter/service.go b/syncer/plugins/servicecenter/service.go
index 17adab8..bfd5bfe 100644
--- a/syncer/plugins/servicecenter/service.go
+++ b/syncer/plugins/servicecenter/service.go
@@ -18,6 +18,7 @@ package servicecenter
import (
"context"
+
"github.com/apache/servicecomb-service-center/pkg/log"
scpb "github.com/apache/servicecomb-service-center/pkg/registry"
"github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/syncer/plugins/servicecenter/servicecenter.go b/syncer/plugins/servicecenter/servicecenter.go
index 18612c5..7454471 100644
--- a/syncer/plugins/servicecenter/servicecenter.go
+++ b/syncer/plugins/servicecenter/servicecenter.go
@@ -18,6 +18,7 @@ package servicecenter
import (
"context"
+
sc "github.com/apache/servicecomb-service-center/client"
"github.com/apache/servicecomb-service-center/pkg/log"
diff --git a/syncer/plugins/servicecenter/transform.go b/syncer/plugins/servicecenter/transform.go
index f1a0270..ec72230 100644
--- a/syncer/plugins/servicecenter/transform.go
+++ b/syncer/plugins/servicecenter/transform.go
@@ -17,11 +17,12 @@
package servicecenter
import (
- "github.com/apache/servicecomb-service-center/pkg/model"
"net/url"
"strconv"
"strings"
+ "github.com/apache/servicecomb-service-center/pkg/model"
+
"github.com/apache/servicecomb-service-center/pkg/log"
scpb "github.com/apache/servicecomb-service-center/pkg/registry"
pb "github.com/apache/servicecomb-service-center/syncer/proto"
diff --git a/syncer/proto/syncer.pb.go b/syncer/proto/syncer.pb.go
index d6ca36a..c4800d0 100644
--- a/syncer/proto/syncer.pb.go
+++ b/syncer/proto/syncer.pb.go
@@ -37,12 +37,15 @@ It has these top-level messages:
*/
package proto
-import proto1 "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
import (
+ fmt "fmt"
+
+ proto1 "github.com/golang/protobuf/proto"
+
+ math "math"
+
context "context"
+
grpc "google.golang.org/grpc"
)
diff --git a/syncer/samples/multi-servicecenters/servicecenter/hello-server/servicecenter/servicecenter.go b/syncer/samples/multi-servicecenters/servicecenter/hello-server/servicecenter/servicecenter.go
index fa3e76d..4bde0fc 100644
--- a/syncer/samples/multi-servicecenters/servicecenter/hello-server/servicecenter/servicecenter.go
+++ b/syncer/samples/multi-servicecenters/servicecenter/hello-server/servicecenter/servicecenter.go
@@ -20,14 +20,15 @@ package servicecenter
import (
"context"
"fmt"
- client2 "github.com/apache/servicecomb-service-center/client"
- "github.com/apache/servicecomb-service-center/pkg/log"
- "github.com/apache/servicecomb-service-center/pkg/registry"
- "github.com/apache/servicecomb-service-center/syncer/pkg/ticker"
"net/http"
"net/url"
"sync"
"time"
+
+ client2 "github.com/apache/servicecomb-service-center/client"
+ "github.com/apache/servicecomb-service-center/pkg/log"
+ "github.com/apache/servicecomb-service-center/pkg/registry"
+ "github.com/apache/servicecomb-service-center/syncer/pkg/ticker"
)
var (
diff --git a/syncer/server/convert.go b/syncer/server/convert.go
index 91b6375..7e693e2 100644
--- a/syncer/server/convert.go
+++ b/syncer/server/convert.go
@@ -22,7 +22,6 @@ import (
"strconv"
"strings"
- "github.com/apache/servicecomb-service-center/pkg/tlsutil"
"github.com/apache/servicecomb-service-center/syncer/config"
"github.com/apache/servicecomb-service-center/syncer/etcd"
"github.com/apache/servicecomb-service-center/syncer/grpc"
@@ -30,6 +29,7 @@ import (
"github.com/apache/servicecomb-service-center/syncer/plugins"
"github.com/apache/servicecomb-service-center/syncer/serf"
"github.com/apache/servicecomb-service-center/syncer/task"
+ "github.com/go-chassis/foundation/tlsutil"
)
const (
@@ -115,8 +115,8 @@ func convertSCConfigOption(c *config.Config) []plugins.SCConfigOption {
return opts
}
-func tlsConfigToOptions(t *config.TLSConfig) []tlsutil.SSLConfigOption {
- return []tlsutil.SSLConfigOption{
+func tlsConfigToOptions(t *config.TLSConfig) []tlsutil.TLSOption {
+ return []tlsutil.TLSOption{
tlsutil.WithVerifyPeer(t.VerifyPeer),
tlsutil.WithVersion(tlsutil.ParseSSLProtocol(t.MinVersion), tls.VersionTLS12),
tlsutil.WithCipherSuits(
diff --git a/syncer/server/handler.go b/syncer/server/handler.go
index c8a09fd..e8561f0 100644
--- a/syncer/server/handler.go
+++ b/syncer/server/handler.go
@@ -24,10 +24,10 @@ import (
"strconv"
"github.com/apache/servicecomb-service-center/pkg/log"
- "github.com/apache/servicecomb-service-center/pkg/tlsutil"
"github.com/apache/servicecomb-service-center/pkg/util"
"github.com/apache/servicecomb-service-center/syncer/client"
pb "github.com/apache/servicecomb-service-center/syncer/proto"
+ "github.com/go-chassis/foundation/tlsutil"
)
const (
diff --git a/syncer/server/server.go b/syncer/server/server.go
index 1eb2da0..63f1874 100644
--- a/syncer/server/server.go
+++ b/syncer/server/server.go
@@ -23,6 +23,14 @@ import (
"strconv"
"syscall"
+ // import plugins
+ _ "github.com/apache/servicecomb-service-center/syncer/plugins/eureka"
+ _ "github.com/apache/servicecomb-service-center/syncer/plugins/servicecenter"
+
+ // import task
+ _ "github.com/apache/servicecomb-service-center/syncer/task/idle"
+ _ "github.com/apache/servicecomb-service-center/syncer/task/ticker"
+
"github.com/apache/servicecomb-service-center/pkg/gopool"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/rpc"
@@ -37,14 +45,6 @@ import (
"github.com/apache/servicecomb-service-center/syncer/servicecenter"
"github.com/apache/servicecomb-service-center/syncer/task"
ggrpc "google.golang.org/grpc"
-
- // import plugins
- _ "github.com/apache/servicecomb-service-center/syncer/plugins/eureka"
- _ "github.com/apache/servicecomb-service-center/syncer/plugins/servicecenter"
-
- // import task
- _ "github.com/apache/servicecomb-service-center/syncer/task/idle"
- _ "github.com/apache/servicecomb-service-center/syncer/task/ticker"
)
var stopChanErr = errors.New("stopped syncer by stopCh")
diff --git a/test/test.go b/test/test.go
index e7cf9d7..8c81500 100644
--- a/test/test.go
+++ b/test/test.go
@@ -20,6 +20,7 @@ package test
import (
_ "github.com/apache/servicecomb-service-center/server/bootstrap"
+
"github.com/apache/servicecomb-service-center/server/core"
"github.com/astaxie/beego"
)