From 04b5a4c07ee205dfcfab193c9190848ad3704438 Mon Sep 17 00:00:00 2001 From: Yuxuan Li Date: Mon, 18 Jun 2018 14:03:40 -0700 Subject: [PATCH 1/3] move --- balancer/grpclb/grpclb_remote_balancer.go | 2 +- clientconn.go | 2 +- {channelz => internal/channelz}/funcs.go | 2 -- {channelz => internal/channelz/service}/regenerate.sh | 4 ++-- {channelz => internal/channelz}/service/service.go | 4 +++- {channelz => internal/channelz}/service/service_test.go | 2 +- {channelz => internal/channelz}/types.go | 0 picker_wrapper.go | 2 +- server.go | 2 +- stream.go | 2 +- test/channelz_test.go | 2 +- transport/http2_client.go | 2 +- transport/http2_server.go | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) rename {channelz => internal/channelz}/funcs.go (99%) rename {channelz => internal/channelz/service}/regenerate.sh (88%) rename {channelz => internal/channelz}/service/service.go (99%) rename {channelz => internal/channelz}/service/service_test.go (99%) rename {channelz => internal/channelz}/types.go (100%) diff --git a/balancer/grpclb/grpclb_remote_balancer.go b/balancer/grpclb/grpclb_remote_balancer.go index fb4c117b5c15..b95926650052 100644 --- a/balancer/grpclb/grpclb_remote_balancer.go +++ b/balancer/grpclb/grpclb_remote_balancer.go @@ -29,10 +29,10 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/balancer" lbpb "google.golang.org/grpc/balancer/grpclb/grpc_lb_v1" - "google.golang.org/grpc/channelz" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal" + "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/metadata" "google.golang.org/grpc/resolver" ) diff --git a/clientconn.go b/clientconn.go index afb5fa6854fe..84ba9e5ad72b 100644 --- a/clientconn.go +++ b/clientconn.go @@ -32,13 +32,13 @@ import ( "golang.org/x/net/trace" "google.golang.org/grpc/balancer" _ "google.golang.org/grpc/balancer/roundrobin" // To register roundrobin. - "google.golang.org/grpc/channelz" "google.golang.org/grpc/codes" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/credentials" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/backoff" + "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/resolver" _ "google.golang.org/grpc/resolver/dns" // To register dns resolver. diff --git a/channelz/funcs.go b/internal/channelz/funcs.go similarity index 99% rename from channelz/funcs.go rename to internal/channelz/funcs.go index be5d6de60332..586a0336b473 100644 --- a/channelz/funcs.go +++ b/internal/channelz/funcs.go @@ -16,8 +16,6 @@ * */ -//go:generate ./regenerate.sh - // Package channelz defines APIs for enabling channelz service, entry // registration/deletion, and accessing channelz data. It also defines channelz // metric struct formats. diff --git a/channelz/regenerate.sh b/internal/channelz/service/regenerate.sh similarity index 88% rename from channelz/regenerate.sh rename to internal/channelz/service/regenerate.sh index e749efa1e134..b24505f86a9c 100755 --- a/channelz/regenerate.sh +++ b/internal/channelz/service/regenerate.sh @@ -28,6 +28,6 @@ curl https://raw.githubusercontent.com/grpc/grpc-proto/master/grpc/channelz/v1/c protoc --go_out=plugins=grpc,paths=source_relative:. -I. grpc/channelz/v1/*.proto popd -rm -f grpc_channelz_v1/*.pb.go -cp "$TMP"/grpc/channelz/v1/*.pb.go grpc_channelz_v1/ +rm -f ../../../channelz/grpc_channelz_v1/*.pb.go +cp "$TMP"/grpc/channelz/v1/*.pb.go ../../../channelz/grpc_channelz_v1/ diff --git a/channelz/service/service.go b/internal/channelz/service/service.go similarity index 99% rename from channelz/service/service.go rename to internal/channelz/service/service.go index 9630568890f2..19c016bc7c3a 100644 --- a/channelz/service/service.go +++ b/internal/channelz/service/service.go @@ -16,6 +16,8 @@ * */ +//go:generate ./regenerate.sh + // Package service provides an implementation for channelz service server. package service @@ -26,10 +28,10 @@ import ( wrpb "github.com/golang/protobuf/ptypes/wrappers" "golang.org/x/net/context" "google.golang.org/grpc" - "google.golang.org/grpc/channelz" channelzgrpc "google.golang.org/grpc/channelz/grpc_channelz_v1" channelzpb "google.golang.org/grpc/channelz/grpc_channelz_v1" "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/internal/channelz" ) // RegisterChannelzServiceToServer registers the channelz service to the given server. diff --git a/channelz/service/service_test.go b/internal/channelz/service/service_test.go similarity index 99% rename from channelz/service/service_test.go rename to internal/channelz/service/service_test.go index 4d3973c13df4..398cd6c97a07 100644 --- a/channelz/service/service_test.go +++ b/internal/channelz/service/service_test.go @@ -27,9 +27,9 @@ import ( "github.com/golang/protobuf/ptypes" "golang.org/x/net/context" - "google.golang.org/grpc/channelz" channelzpb "google.golang.org/grpc/channelz/grpc_channelz_v1" "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/internal/channelz" ) func init() { diff --git a/channelz/types.go b/internal/channelz/types.go similarity index 100% rename from channelz/types.go rename to internal/channelz/types.go diff --git a/picker_wrapper.go b/picker_wrapper.go index 654a5c0ee1cc..019e658004eb 100644 --- a/picker_wrapper.go +++ b/picker_wrapper.go @@ -25,9 +25,9 @@ import ( "golang.org/x/net/context" "google.golang.org/grpc/balancer" - "google.golang.org/grpc/channelz" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/metadata" "google.golang.org/grpc/resolver" "google.golang.org/grpc/status" diff --git a/server.go b/server.go index c76bb535fa59..014c72b3f283 100644 --- a/server.go +++ b/server.go @@ -38,13 +38,13 @@ import ( "golang.org/x/net/http2" "golang.org/x/net/trace" - "google.golang.org/grpc/channelz" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/encoding" "google.golang.org/grpc/encoding/proto" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal" + "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/metadata" "google.golang.org/grpc/stats" diff --git a/stream.go b/stream.go index fac6b3886471..152d9eccd62d 100644 --- a/stream.go +++ b/stream.go @@ -27,9 +27,9 @@ import ( "golang.org/x/net/context" "golang.org/x/net/trace" "google.golang.org/grpc/balancer" - "google.golang.org/grpc/channelz" "google.golang.org/grpc/codes" "google.golang.org/grpc/encoding" + "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/metadata" "google.golang.org/grpc/stats" "google.golang.org/grpc/status" diff --git a/test/channelz_test.go b/test/channelz_test.go index 3ab72b053b67..eaa657c4b6a0 100644 --- a/test/channelz_test.go +++ b/test/channelz_test.go @@ -29,8 +29,8 @@ import ( "golang.org/x/net/http2" "google.golang.org/grpc" _ "google.golang.org/grpc/balancer/grpclb" - "google.golang.org/grpc/channelz" "google.golang.org/grpc/codes" + "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/leakcheck" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/resolver" diff --git a/transport/http2_client.go b/transport/http2_client.go index fab25335c9dc..8dc7e3573823 100644 --- a/transport/http2_client.go +++ b/transport/http2_client.go @@ -31,9 +31,9 @@ import ( "golang.org/x/net/http2" "golang.org/x/net/http2/hpack" - "google.golang.org/grpc/channelz" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" + "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" diff --git a/transport/http2_server.go b/transport/http2_server.go index b30c85b3034e..19acedb2b020 100644 --- a/transport/http2_server.go +++ b/transport/http2_server.go @@ -35,10 +35,10 @@ import ( "golang.org/x/net/http2" "golang.org/x/net/http2/hpack" - "google.golang.org/grpc/channelz" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcrand" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/metadata" From 39ca138e9088947bbca19cdb7700afa4422a885d Mon Sep 17 00:00:00 2001 From: Yuxuan Li Date: Mon, 18 Jun 2018 17:26:58 -0700 Subject: [PATCH 2/3] export service --- {internal/channelz => channelz}/service/regenerate.sh | 0 {internal/channelz => channelz}/service/service.go | 0 {internal/channelz => channelz}/service/service_test.go | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {internal/channelz => channelz}/service/regenerate.sh (100%) rename {internal/channelz => channelz}/service/service.go (100%) rename {internal/channelz => channelz}/service/service_test.go (100%) diff --git a/internal/channelz/service/regenerate.sh b/channelz/service/regenerate.sh similarity index 100% rename from internal/channelz/service/regenerate.sh rename to channelz/service/regenerate.sh diff --git a/internal/channelz/service/service.go b/channelz/service/service.go similarity index 100% rename from internal/channelz/service/service.go rename to channelz/service/service.go diff --git a/internal/channelz/service/service_test.go b/channelz/service/service_test.go similarity index 100% rename from internal/channelz/service/service_test.go rename to channelz/service/service_test.go From 0fe0afae76a49782ad46c1769331157b8b320de6 Mon Sep 17 00:00:00 2001 From: Yuxuan Li Date: Mon, 18 Jun 2018 17:33:34 -0700 Subject: [PATCH 3/3] minor --- channelz/service/regenerate.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/channelz/service/regenerate.sh b/channelz/service/regenerate.sh index b24505f86a9c..9c255b12cab1 100755 --- a/channelz/service/regenerate.sh +++ b/channelz/service/regenerate.sh @@ -28,6 +28,6 @@ curl https://raw.githubusercontent.com/grpc/grpc-proto/master/grpc/channelz/v1/c protoc --go_out=plugins=grpc,paths=source_relative:. -I. grpc/channelz/v1/*.proto popd -rm -f ../../../channelz/grpc_channelz_v1/*.pb.go -cp "$TMP"/grpc/channelz/v1/*.pb.go ../../../channelz/grpc_channelz_v1/ +rm -f ../grpc_channelz_v1/*.pb.go +cp "$TMP"/grpc/channelz/v1/*.pb.go ../grpc_channelz_v1/