From d2d6841f020f59c796e928187c5ac0bbed2ec8c6 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Sun, 7 Jul 2019 10:37:34 +0100 Subject: [PATCH] Move transport to network/transport --- client/grpc/grpc.go | 2 +- client/options.go | 2 +- client/options_test.go | 2 +- client/rpc_client.go | 2 +- client/rpc_codec.go | 2 +- client/rpc_pool.go | 2 +- client/rpc_pool_test.go | 4 ++-- client/rpc_response.go | 2 +- config/cmd/cmd.go | 8 ++++---- config/cmd/options.go | 2 +- network/link.go | 2 +- network/node.go | 2 +- {transport => network/transport}/grpc/grpc.go | 4 ++-- {transport => network/transport}/grpc/grpc_test.go | 2 +- {transport => network/transport}/grpc/handler.go | 4 ++-- .../transport}/grpc/proto/transport.micro.go | 2 +- .../transport}/grpc/proto/transport.pb.go | 6 +++--- .../transport}/grpc/proto/transport.proto | 0 {transport => network/transport}/grpc/socket.go | 4 ++-- {transport => network/transport}/http/http.go | 2 +- {transport => network/transport}/http/http_test.go | 2 +- {transport => network/transport}/http/options.go | 2 +- {transport => network/transport}/http_proxy.go | 0 {transport => network/transport}/http_transport.go | 0 {transport => network/transport}/http_transport_test.go | 0 {transport => network/transport}/memory/memory.go | 2 +- {transport => network/transport}/memory/memory_test.go | 2 +- {transport => network/transport}/mucp/listener.go | 2 +- {transport => network/transport}/mucp/network.go | 2 +- {transport => network/transport}/mucp/socket.go | 2 +- {transport => network/transport}/mucp/socket_test.go | 2 +- {transport => network/transport}/options.go | 0 {transport => network/transport}/quic/quic.go | 2 +- {transport => network/transport}/transport.go | 0 network/tunnel/default.go | 2 +- network/tunnel/socket.go | 2 +- network/tunnel/socket_test.go | 2 +- network/tunnel/tunnel.go | 2 +- options.go | 2 +- server/grpc/options.go | 2 +- server/options.go | 2 +- server/rpc_codec.go | 2 +- server/rpc_codec_test.go | 2 +- server/rpc_request.go | 2 +- server/rpc_response.go | 2 +- server/rpc_server.go | 2 +- 46 files changed, 49 insertions(+), 49 deletions(-) rename {transport => network/transport}/grpc/grpc.go (97%) rename {transport => network/transport}/grpc/grpc_test.go (97%) rename {transport => network/transport}/grpc/handler.go (85%) rename {transport => network/transport}/grpc/proto/transport.micro.go (98%) rename {transport => network/transport}/grpc/proto/transport.pb.go (96%) rename {transport => network/transport}/grpc/proto/transport.proto (100%) rename {transport => network/transport}/grpc/socket.go (93%) rename {transport => network/transport}/http/http.go (85%) rename {transport => network/transport}/http/http_test.go (97%) rename {transport => network/transport}/http/options.go (91%) rename {transport => network/transport}/http_proxy.go (100%) rename {transport => network/transport}/http_transport.go (100%) rename {transport => network/transport}/http_transport_test.go (100%) rename {transport => network/transport}/memory/memory.go (98%) rename {transport => network/transport}/memory/memory_test.go (97%) rename {transport => network/transport}/mucp/listener.go (92%) rename {transport => network/transport}/mucp/network.go (99%) rename {transport => network/transport}/mucp/socket.go (96%) rename {transport => network/transport}/mucp/socket_test.go (95%) rename {transport => network/transport}/options.go (100%) rename {transport => network/transport}/quic/quic.go (98%) rename {transport => network/transport}/transport.go (100%) diff --git a/client/grpc/grpc.go b/client/grpc/grpc.go index 9a1843bc..d4d54938 100644 --- a/client/grpc/grpc.go +++ b/client/grpc/grpc.go @@ -17,7 +17,7 @@ import ( "github.com/micro/go-micro/errors" "github.com/micro/go-micro/metadata" "github.com/micro/go-micro/registry" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" "google.golang.org/grpc" "google.golang.org/grpc/credentials" diff --git a/client/options.go b/client/options.go index 9f363d74..00d70ead 100644 --- a/client/options.go +++ b/client/options.go @@ -8,7 +8,7 @@ import ( "github.com/micro/go-micro/client/selector" "github.com/micro/go-micro/codec" "github.com/micro/go-micro/registry" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) type Options struct { diff --git a/client/options_test.go b/client/options_test.go index 9252994c..f7c892ca 100644 --- a/client/options_test.go +++ b/client/options_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) func TestCallOptions(t *testing.T) { diff --git a/client/rpc_client.go b/client/rpc_client.go index c724435a..4061fa40 100644 --- a/client/rpc_client.go +++ b/client/rpc_client.go @@ -18,7 +18,7 @@ import ( "github.com/micro/go-micro/errors" "github.com/micro/go-micro/metadata" "github.com/micro/go-micro/registry" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) type rpcClient struct { diff --git a/client/rpc_codec.go b/client/rpc_codec.go index 6ff84a64..ca390e39 100644 --- a/client/rpc_codec.go +++ b/client/rpc_codec.go @@ -13,7 +13,7 @@ import ( "github.com/micro/go-micro/codec/protorpc" "github.com/micro/go-micro/errors" "github.com/micro/go-micro/registry" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) const ( diff --git a/client/rpc_pool.go b/client/rpc_pool.go index 9fdd7736..9cff2587 100644 --- a/client/rpc_pool.go +++ b/client/rpc_pool.go @@ -4,7 +4,7 @@ import ( "sync" "time" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) type pool struct { diff --git a/client/rpc_pool_test.go b/client/rpc_pool_test.go index 6c5875f1..2f7bcb5e 100644 --- a/client/rpc_pool_test.go +++ b/client/rpc_pool_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/micro/go-micro/transport" - "github.com/micro/go-micro/transport/memory" + "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/network/transport/memory" ) func testPool(t *testing.T, size int, ttl time.Duration) { diff --git a/client/rpc_response.go b/client/rpc_response.go index 08aaa84d..d2fa61f2 100644 --- a/client/rpc_response.go +++ b/client/rpc_response.go @@ -2,7 +2,7 @@ package client import ( "github.com/micro/go-micro/codec" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) type rpcResponse struct { diff --git a/config/cmd/cmd.go b/config/cmd/cmd.go index 8d7c3c03..f2537de7 100644 --- a/config/cmd/cmd.go +++ b/config/cmd/cmd.go @@ -38,10 +38,10 @@ import ( "github.com/micro/go-micro/client/selector/static" // transports - "github.com/micro/go-micro/transport" - tgrpc "github.com/micro/go-micro/transport/grpc" - thttp "github.com/micro/go-micro/transport/http" - tmem "github.com/micro/go-micro/transport/memory" + "github.com/micro/go-micro/network/transport" + tgrpc "github.com/micro/go-micro/network/transport/grpc" + thttp "github.com/micro/go-micro/network/transport/http" + tmem "github.com/micro/go-micro/network/transport/memory" ) type Cmd interface { diff --git a/config/cmd/options.go b/config/cmd/options.go index 1f221f35..3711235c 100644 --- a/config/cmd/options.go +++ b/config/cmd/options.go @@ -8,7 +8,7 @@ import ( "github.com/micro/go-micro/client/selector" "github.com/micro/go-micro/registry" "github.com/micro/go-micro/server" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) type Options struct { diff --git a/network/link.go b/network/link.go index 5b676be5..656abe24 100644 --- a/network/link.go +++ b/network/link.go @@ -10,7 +10,7 @@ import ( "github.com/micro/go-micro/codec" "github.com/micro/go-micro/codec/proto" pb "github.com/micro/go-micro/network/proto" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) type link struct { diff --git a/network/node.go b/network/node.go index 90649f09..440d9c49 100644 --- a/network/node.go +++ b/network/node.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/micro/go-micro/registry" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" "github.com/micro/go-micro/util/addr" "github.com/micro/go-micro/util/log" diff --git a/transport/grpc/grpc.go b/network/transport/grpc/grpc.go similarity index 97% rename from transport/grpc/grpc.go rename to network/transport/grpc/grpc.go index a60ec70e..6b8dc8c8 100644 --- a/transport/grpc/grpc.go +++ b/network/transport/grpc/grpc.go @@ -6,7 +6,7 @@ import ( "crypto/tls" "net" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" maddr "github.com/micro/go-micro/util/addr" mnet "github.com/micro/go-micro/util/net" mls "github.com/micro/go-micro/util/tls" @@ -14,7 +14,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials" - pb "github.com/micro/go-micro/transport/grpc/proto" + pb "github.com/micro/go-micro/network/transport/grpc/proto" ) type grpcTransport struct { diff --git a/transport/grpc/grpc_test.go b/network/transport/grpc/grpc_test.go similarity index 97% rename from transport/grpc/grpc_test.go rename to network/transport/grpc/grpc_test.go index d4e82346..85abf12d 100644 --- a/transport/grpc/grpc_test.go +++ b/network/transport/grpc/grpc_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) func expectedPort(t *testing.T, expected string, lsn transport.Listener) { diff --git a/transport/grpc/handler.go b/network/transport/grpc/handler.go similarity index 85% rename from transport/grpc/handler.go rename to network/transport/grpc/handler.go index 3220f7dd..6dc1b512 100644 --- a/transport/grpc/handler.go +++ b/network/transport/grpc/handler.go @@ -3,8 +3,8 @@ package grpc import ( "runtime/debug" - "github.com/micro/go-micro/transport" - pb "github.com/micro/go-micro/transport/grpc/proto" + "github.com/micro/go-micro/network/transport" + pb "github.com/micro/go-micro/network/transport/grpc/proto" "github.com/micro/go-micro/util/log" "google.golang.org/grpc/peer" ) diff --git a/transport/grpc/proto/transport.micro.go b/network/transport/grpc/proto/transport.micro.go similarity index 98% rename from transport/grpc/proto/transport.micro.go rename to network/transport/grpc/proto/transport.micro.go index 81cf981c..1b8d840e 100644 --- a/transport/grpc/proto/transport.micro.go +++ b/network/transport/grpc/proto/transport.micro.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-micro. DO NOT EDIT. -// source: go-micro/transport/grpc/proto/transport.proto +// source: go-micro/network/transport/grpc/proto/transport.proto package go_micro_grpc_transport diff --git a/transport/grpc/proto/transport.pb.go b/network/transport/grpc/proto/transport.pb.go similarity index 96% rename from transport/grpc/proto/transport.pb.go rename to network/transport/grpc/proto/transport.pb.go index a9702987..c8fb8933 100644 --- a/transport/grpc/proto/transport.pb.go +++ b/network/transport/grpc/proto/transport.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: go-micro/transport/grpc/proto/transport.proto +// source: go-micro/network/transport/grpc/proto/transport.proto package go_micro_grpc_transport @@ -75,7 +75,7 @@ func init() { } func init() { - proto.RegisterFile("go-micro/transport/grpc/proto/transport.proto", fileDescriptor_29b90b9ccd5e0da5) + proto.RegisterFile("go-micro/network/transport/grpc/proto/transport.proto", fileDescriptor_29b90b9ccd5e0da5) } var fileDescriptor_29b90b9ccd5e0da5 = []byte{ @@ -197,5 +197,5 @@ var _Transport_serviceDesc = grpc.ServiceDesc{ ClientStreams: true, }, }, - Metadata: "go-micro/transport/grpc/proto/transport.proto", + Metadata: "go-micro/network/transport/grpc/proto/transport.proto", } diff --git a/transport/grpc/proto/transport.proto b/network/transport/grpc/proto/transport.proto similarity index 100% rename from transport/grpc/proto/transport.proto rename to network/transport/grpc/proto/transport.proto diff --git a/transport/grpc/socket.go b/network/transport/grpc/socket.go similarity index 93% rename from transport/grpc/socket.go rename to network/transport/grpc/socket.go index 2567559d..1d072cbe 100644 --- a/transport/grpc/socket.go +++ b/network/transport/grpc/socket.go @@ -1,8 +1,8 @@ package grpc import ( - "github.com/micro/go-micro/transport" - pb "github.com/micro/go-micro/transport/grpc/proto" + "github.com/micro/go-micro/network/transport" + pb "github.com/micro/go-micro/network/transport/grpc/proto" "google.golang.org/grpc" ) diff --git a/transport/http/http.go b/network/transport/http/http.go similarity index 85% rename from transport/http/http.go rename to network/transport/http/http.go index 672db54c..a3a6bbfc 100644 --- a/transport/http/http.go +++ b/network/transport/http/http.go @@ -2,7 +2,7 @@ package http import ( - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) // NewTransport returns a new http transport using net/http and supporting http2 diff --git a/transport/http/http_test.go b/network/transport/http/http_test.go similarity index 97% rename from transport/http/http_test.go rename to network/transport/http/http_test.go index faaf5215..57445031 100644 --- a/transport/http/http_test.go +++ b/network/transport/http/http_test.go @@ -4,7 +4,7 @@ import ( "sync" "testing" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) func call(b *testing.B, c int) { diff --git a/transport/http/options.go b/network/transport/http/options.go similarity index 91% rename from transport/http/options.go rename to network/transport/http/options.go index 2a6e56c5..3d70f94b 100644 --- a/transport/http/options.go +++ b/network/transport/http/options.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) // Handle registers the handler for the given pattern. diff --git a/transport/http_proxy.go b/network/transport/http_proxy.go similarity index 100% rename from transport/http_proxy.go rename to network/transport/http_proxy.go diff --git a/transport/http_transport.go b/network/transport/http_transport.go similarity index 100% rename from transport/http_transport.go rename to network/transport/http_transport.go diff --git a/transport/http_transport_test.go b/network/transport/http_transport_test.go similarity index 100% rename from transport/http_transport_test.go rename to network/transport/http_transport_test.go diff --git a/transport/memory/memory.go b/network/transport/memory/memory.go similarity index 98% rename from transport/memory/memory.go rename to network/transport/memory/memory.go index ed00ce69..25782d50 100644 --- a/transport/memory/memory.go +++ b/network/transport/memory/memory.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) type memorySocket struct { diff --git a/transport/memory/memory_test.go b/network/transport/memory/memory_test.go similarity index 97% rename from transport/memory/memory_test.go rename to network/transport/memory/memory_test.go index 72952e09..0ff5b31d 100644 --- a/transport/memory/memory_test.go +++ b/network/transport/memory/memory_test.go @@ -3,7 +3,7 @@ package memory import ( "testing" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) func TestMemoryTransport(t *testing.T) { diff --git a/transport/mucp/listener.go b/network/transport/mucp/listener.go similarity index 92% rename from transport/mucp/listener.go rename to network/transport/mucp/listener.go index 6f107323..ceb7aae0 100644 --- a/transport/mucp/listener.go +++ b/network/transport/mucp/listener.go @@ -1,7 +1,7 @@ package mucp import ( - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) type listener struct { diff --git a/transport/mucp/network.go b/network/transport/mucp/network.go similarity index 99% rename from transport/mucp/network.go rename to network/transport/mucp/network.go index 789c5e76..ae0046b9 100644 --- a/transport/mucp/network.go +++ b/network/transport/mucp/network.go @@ -9,7 +9,7 @@ import ( "sync" "github.com/micro/go-micro/network" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) type networkKey struct{} diff --git a/transport/mucp/socket.go b/network/transport/mucp/socket.go similarity index 96% rename from transport/mucp/socket.go rename to network/transport/mucp/socket.go index f21788ec..862da50a 100644 --- a/transport/mucp/socket.go +++ b/network/transport/mucp/socket.go @@ -3,7 +3,7 @@ package mucp import ( "errors" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) // socket is our pseudo socket for transport.Socket diff --git a/transport/mucp/socket_test.go b/network/transport/mucp/socket_test.go similarity index 95% rename from transport/mucp/socket_test.go rename to network/transport/mucp/socket_test.go index df493fa0..a9dfbd5a 100644 --- a/transport/mucp/socket_test.go +++ b/network/transport/mucp/socket_test.go @@ -3,7 +3,7 @@ package mucp import ( "testing" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) func TestTunnelSocket(t *testing.T) { diff --git a/transport/options.go b/network/transport/options.go similarity index 100% rename from transport/options.go rename to network/transport/options.go diff --git a/transport/quic/quic.go b/network/transport/quic/quic.go similarity index 98% rename from transport/quic/quic.go rename to network/transport/quic/quic.go index 2622ec84..548b1bc2 100644 --- a/transport/quic/quic.go +++ b/network/transport/quic/quic.go @@ -6,7 +6,7 @@ import ( "encoding/gob" "github.com/lucas-clemente/quic-go" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" utls "github.com/micro/go-micro/util/tls" ) diff --git a/transport/transport.go b/network/transport/transport.go similarity index 100% rename from transport/transport.go rename to network/transport/transport.go diff --git a/network/tunnel/default.go b/network/tunnel/default.go index 41c9778b..c417d935 100644 --- a/network/tunnel/default.go +++ b/network/tunnel/default.go @@ -7,7 +7,7 @@ import ( "sync" "github.com/google/uuid" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) // tun represents a network tunnel diff --git a/network/tunnel/socket.go b/network/tunnel/socket.go index e0ce1350..dac5837d 100644 --- a/network/tunnel/socket.go +++ b/network/tunnel/socket.go @@ -3,7 +3,7 @@ package tunnel import ( "errors" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) // socket is our pseudo socket for transport.Socket diff --git a/network/tunnel/socket_test.go b/network/tunnel/socket_test.go index 37c1aeaa..086bf60f 100644 --- a/network/tunnel/socket_test.go +++ b/network/tunnel/socket_test.go @@ -3,7 +3,7 @@ package tunnel import ( "testing" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) func TestTunnelSocket(t *testing.T) { diff --git a/network/tunnel/tunnel.go b/network/tunnel/tunnel.go index 1f7cd2b7..d25d228d 100644 --- a/network/tunnel/tunnel.go +++ b/network/tunnel/tunnel.go @@ -3,7 +3,7 @@ package tunnel import ( "github.com/micro/go-micro/config/options" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) // Tunnel creates a network tunnel diff --git a/options.go b/options.go index d566a353..95c65e73 100644 --- a/options.go +++ b/options.go @@ -11,7 +11,7 @@ import ( "github.com/micro/go-micro/config/cmd" "github.com/micro/go-micro/registry" "github.com/micro/go-micro/server" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) type Options struct { diff --git a/server/grpc/options.go b/server/grpc/options.go index 65d82fcc..6a5e07f6 100644 --- a/server/grpc/options.go +++ b/server/grpc/options.go @@ -9,7 +9,7 @@ import ( "github.com/micro/go-micro/registry" "github.com/micro/go-micro/server" "github.com/micro/go-micro/server/debug" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" "google.golang.org/grpc" "google.golang.org/grpc/encoding" ) diff --git a/server/options.go b/server/options.go index 15de9b83..c00c2e9f 100644 --- a/server/options.go +++ b/server/options.go @@ -9,7 +9,7 @@ import ( "github.com/micro/go-micro/codec" "github.com/micro/go-micro/registry" "github.com/micro/go-micro/server/debug" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) type Options struct { diff --git a/server/rpc_codec.go b/server/rpc_codec.go index 797fa79c..a23b0a3a 100644 --- a/server/rpc_codec.go +++ b/server/rpc_codec.go @@ -10,7 +10,7 @@ import ( "github.com/micro/go-micro/codec/jsonrpc" "github.com/micro/go-micro/codec/proto" "github.com/micro/go-micro/codec/protorpc" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" "github.com/pkg/errors" ) diff --git a/server/rpc_codec_test.go b/server/rpc_codec_test.go index 1088af01..3fb03cf4 100644 --- a/server/rpc_codec_test.go +++ b/server/rpc_codec_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/micro/go-micro/codec" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) // testCodec is a dummy codec that only knows how to encode nil bodies diff --git a/server/rpc_request.go b/server/rpc_request.go index 40995b14..c69c8605 100644 --- a/server/rpc_request.go +++ b/server/rpc_request.go @@ -2,7 +2,7 @@ package server import ( "github.com/micro/go-micro/codec" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) type rpcRequest struct { diff --git a/server/rpc_response.go b/server/rpc_response.go index d89fa0b6..55b5b126 100644 --- a/server/rpc_response.go +++ b/server/rpc_response.go @@ -4,7 +4,7 @@ import ( "net/http" "github.com/micro/go-micro/codec" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" ) type rpcResponse struct { diff --git a/server/rpc_server.go b/server/rpc_server.go index 6caca4e3..aec4cae7 100644 --- a/server/rpc_server.go +++ b/server/rpc_server.go @@ -14,7 +14,7 @@ import ( "github.com/micro/go-micro/codec" "github.com/micro/go-micro/metadata" "github.com/micro/go-micro/registry" - "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/network/transport" "github.com/micro/go-micro/util/addr" log "github.com/micro/go-micro/util/log" )