From 0bf54c122f2c0de242ff61cc4350a170b0657135 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Tue, 9 Jul 2019 18:41:26 +0100 Subject: [PATCH] move transport back --- 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/default.go | 2 +- network/link.go | 2 +- network/network.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 +- {network/transport => transport}/grpc/grpc.go | 4 ++-- {network/transport => transport}/grpc/grpc_test.go | 2 +- {network/transport => transport}/grpc/handler.go | 4 ++-- .../transport => transport}/grpc/proto/transport.micro.go | 2 +- .../transport => transport}/grpc/proto/transport.pb.go | 6 +++--- .../transport => transport}/grpc/proto/transport.proto | 0 {network/transport => transport}/grpc/socket.go | 4 ++-- {network/transport => transport}/http/http.go | 2 +- {network/transport => transport}/http/http_test.go | 2 +- {network/transport => transport}/http/options.go | 2 +- {network/transport => transport}/http_proxy.go | 0 {network/transport => transport}/http_transport.go | 0 {network/transport => transport}/http_transport_test.go | 0 {network/transport => transport}/memory/memory.go | 2 +- {network/transport => transport}/memory/memory_test.go | 2 +- {network/transport => transport}/options.go | 0 {network/transport => transport}/quic/quic.go | 2 +- {network/transport => transport}/transport.go | 0 39 files changed, 42 insertions(+), 42 deletions(-) rename {network/transport => transport}/grpc/grpc.go (97%) rename {network/transport => transport}/grpc/grpc_test.go (97%) rename {network/transport => transport}/grpc/handler.go (85%) rename {network/transport => transport}/grpc/proto/transport.micro.go (98%) rename {network/transport => transport}/grpc/proto/transport.pb.go (96%) rename {network/transport => transport}/grpc/proto/transport.proto (100%) rename {network/transport => transport}/grpc/socket.go (93%) rename {network/transport => transport}/http/http.go (85%) rename {network/transport => transport}/http/http_test.go (97%) rename {network/transport => transport}/http/options.go (91%) rename {network/transport => transport}/http_proxy.go (100%) rename {network/transport => transport}/http_transport.go (100%) rename {network/transport => transport}/http_transport_test.go (100%) rename {network/transport => transport}/memory/memory.go (98%) rename {network/transport => transport}/memory/memory_test.go (97%) rename {network/transport => transport}/options.go (100%) rename {network/transport => transport}/quic/quic.go (98%) rename {network/transport => transport}/transport.go (100%) diff --git a/client/grpc/grpc.go b/client/grpc/grpc.go index e79b5406..48215270 100644 --- a/client/grpc/grpc.go +++ b/client/grpc/grpc.go @@ -16,7 +16,7 @@ import ( "github.com/micro/go-micro/codec" "github.com/micro/go-micro/errors" "github.com/micro/go-micro/metadata" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" "github.com/micro/go-micro/registry" "google.golang.org/grpc" diff --git a/client/options.go b/client/options.go index 3032d23b..9f0c3f80 100644 --- a/client/options.go +++ b/client/options.go @@ -7,7 +7,7 @@ import ( "github.com/micro/go-micro/broker" "github.com/micro/go-micro/client/selector" "github.com/micro/go-micro/codec" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" "github.com/micro/go-micro/registry" ) diff --git a/client/options_test.go b/client/options_test.go index f7c892ca..9252994c 100644 --- a/client/options_test.go +++ b/client/options_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" ) func TestCallOptions(t *testing.T) { diff --git a/client/rpc_client.go b/client/rpc_client.go index 8f729252..2b974289 100644 --- a/client/rpc_client.go +++ b/client/rpc_client.go @@ -15,7 +15,7 @@ import ( "github.com/micro/go-micro/codec" "github.com/micro/go-micro/errors" "github.com/micro/go-micro/metadata" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" "github.com/micro/go-micro/registry" ) diff --git a/client/rpc_codec.go b/client/rpc_codec.go index 91aae303..f3697b4b 100644 --- a/client/rpc_codec.go +++ b/client/rpc_codec.go @@ -12,7 +12,7 @@ import ( "github.com/micro/go-micro/codec/proto" "github.com/micro/go-micro/codec/protorpc" "github.com/micro/go-micro/errors" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" "github.com/micro/go-micro/registry" ) diff --git a/client/rpc_pool.go b/client/rpc_pool.go index 9cff2587..9fdd7736 100644 --- a/client/rpc_pool.go +++ b/client/rpc_pool.go @@ -4,7 +4,7 @@ import ( "sync" "time" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" ) type pool struct { diff --git a/client/rpc_pool_test.go b/client/rpc_pool_test.go index 2f7bcb5e..6c5875f1 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/network/transport" - "github.com/micro/go-micro/network/transport/memory" + "github.com/micro/go-micro/transport" + "github.com/micro/go-micro/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 d2fa61f2..08aaa84d 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/network/transport" + "github.com/micro/go-micro/transport" ) type rpcResponse struct { diff --git a/config/cmd/cmd.go b/config/cmd/cmd.go index f2537de7..8d7c3c03 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/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" + "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" ) type Cmd interface { diff --git a/config/cmd/options.go b/config/cmd/options.go index be703f56..b4917c27 100644 --- a/config/cmd/options.go +++ b/config/cmd/options.go @@ -6,7 +6,7 @@ import ( "github.com/micro/go-micro/broker" "github.com/micro/go-micro/client" "github.com/micro/go-micro/client/selector" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" "github.com/micro/go-micro/registry" "github.com/micro/go-micro/server" ) diff --git a/network/default.go b/network/default.go index 494ecbd2..e282adeb 100644 --- a/network/default.go +++ b/network/default.go @@ -7,7 +7,7 @@ import ( "github.com/google/uuid" "github.com/micro/go-micro/config/options" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" "github.com/micro/go-micro/util/addr" ) diff --git a/network/link.go b/network/link.go index e805e55c..319692d3 100644 --- a/network/link.go +++ b/network/link.go @@ -6,7 +6,7 @@ import ( "sync" "github.com/google/uuid" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" ) type link struct { diff --git a/network/network.go b/network/network.go index 164c8a98..b27347df 100644 --- a/network/network.go +++ b/network/network.go @@ -3,7 +3,7 @@ package network import ( "github.com/micro/go-micro/config/options" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" ) // Network defines a network interface. The network is a single diff --git a/options.go b/options.go index 355e1cfc..1b8a5724 100644 --- a/options.go +++ b/options.go @@ -9,7 +9,7 @@ import ( "github.com/micro/go-micro/client" "github.com/micro/go-micro/client/selector" "github.com/micro/go-micro/config/cmd" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" "github.com/micro/go-micro/registry" "github.com/micro/go-micro/server" ) diff --git a/server/grpc/options.go b/server/grpc/options.go index e1c2efc9..3c9d125f 100644 --- a/server/grpc/options.go +++ b/server/grpc/options.go @@ -6,7 +6,7 @@ import ( "github.com/micro/go-micro/broker" "github.com/micro/go-micro/codec" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" "github.com/micro/go-micro/registry" "github.com/micro/go-micro/server" "github.com/micro/go-micro/server/debug" diff --git a/server/options.go b/server/options.go index 200a7a18..018958a2 100644 --- a/server/options.go +++ b/server/options.go @@ -7,7 +7,7 @@ import ( "github.com/micro/go-micro/broker" "github.com/micro/go-micro/codec" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" "github.com/micro/go-micro/registry" "github.com/micro/go-micro/server/debug" ) diff --git a/server/rpc_codec.go b/server/rpc_codec.go index a23b0a3a..797fa79c 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/network/transport" + "github.com/micro/go-micro/transport" "github.com/pkg/errors" ) diff --git a/server/rpc_codec_test.go b/server/rpc_codec_test.go index 3fb03cf4..1088af01 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/network/transport" + "github.com/micro/go-micro/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 c69c8605..40995b14 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/network/transport" + "github.com/micro/go-micro/transport" ) type rpcRequest struct { diff --git a/server/rpc_response.go b/server/rpc_response.go index 55b5b126..d89fa0b6 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/network/transport" + "github.com/micro/go-micro/transport" ) type rpcResponse struct { diff --git a/server/rpc_server.go b/server/rpc_server.go index 2cabb635..284d499d 100644 --- a/server/rpc_server.go +++ b/server/rpc_server.go @@ -13,7 +13,7 @@ import ( "github.com/micro/go-micro/broker" "github.com/micro/go-micro/codec" "github.com/micro/go-micro/metadata" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" "github.com/micro/go-micro/registry" "github.com/micro/go-micro/util/addr" log "github.com/micro/go-micro/util/log" diff --git a/network/transport/grpc/grpc.go b/transport/grpc/grpc.go similarity index 97% rename from network/transport/grpc/grpc.go rename to transport/grpc/grpc.go index 6b8dc8c8..a60ec70e 100644 --- a/network/transport/grpc/grpc.go +++ b/transport/grpc/grpc.go @@ -6,7 +6,7 @@ import ( "crypto/tls" "net" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/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/network/transport/grpc/proto" + pb "github.com/micro/go-micro/transport/grpc/proto" ) type grpcTransport struct { diff --git a/network/transport/grpc/grpc_test.go b/transport/grpc/grpc_test.go similarity index 97% rename from network/transport/grpc/grpc_test.go rename to transport/grpc/grpc_test.go index 85abf12d..d4e82346 100644 --- a/network/transport/grpc/grpc_test.go +++ b/transport/grpc/grpc_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" ) func expectedPort(t *testing.T, expected string, lsn transport.Listener) { diff --git a/network/transport/grpc/handler.go b/transport/grpc/handler.go similarity index 85% rename from network/transport/grpc/handler.go rename to transport/grpc/handler.go index 6dc1b512..3220f7dd 100644 --- a/network/transport/grpc/handler.go +++ b/transport/grpc/handler.go @@ -3,8 +3,8 @@ package grpc import ( "runtime/debug" - "github.com/micro/go-micro/network/transport" - pb "github.com/micro/go-micro/network/transport/grpc/proto" + "github.com/micro/go-micro/transport" + pb "github.com/micro/go-micro/transport/grpc/proto" "github.com/micro/go-micro/util/log" "google.golang.org/grpc/peer" ) diff --git a/network/transport/grpc/proto/transport.micro.go b/transport/grpc/proto/transport.micro.go similarity index 98% rename from network/transport/grpc/proto/transport.micro.go rename to transport/grpc/proto/transport.micro.go index 1b8d840e..81cf981c 100644 --- a/network/transport/grpc/proto/transport.micro.go +++ b/transport/grpc/proto/transport.micro.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-micro. DO NOT EDIT. -// source: go-micro/network/transport/grpc/proto/transport.proto +// source: go-micro/transport/grpc/proto/transport.proto package go_micro_grpc_transport diff --git a/network/transport/grpc/proto/transport.pb.go b/transport/grpc/proto/transport.pb.go similarity index 96% rename from network/transport/grpc/proto/transport.pb.go rename to transport/grpc/proto/transport.pb.go index c8fb8933..a9702987 100644 --- a/network/transport/grpc/proto/transport.pb.go +++ b/transport/grpc/proto/transport.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: go-micro/network/transport/grpc/proto/transport.proto +// source: go-micro/transport/grpc/proto/transport.proto package go_micro_grpc_transport @@ -75,7 +75,7 @@ func init() { } func init() { - proto.RegisterFile("go-micro/network/transport/grpc/proto/transport.proto", fileDescriptor_29b90b9ccd5e0da5) + proto.RegisterFile("go-micro/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/network/transport/grpc/proto/transport.proto", + Metadata: "go-micro/transport/grpc/proto/transport.proto", } diff --git a/network/transport/grpc/proto/transport.proto b/transport/grpc/proto/transport.proto similarity index 100% rename from network/transport/grpc/proto/transport.proto rename to transport/grpc/proto/transport.proto diff --git a/network/transport/grpc/socket.go b/transport/grpc/socket.go similarity index 93% rename from network/transport/grpc/socket.go rename to transport/grpc/socket.go index 1d072cbe..2567559d 100644 --- a/network/transport/grpc/socket.go +++ b/transport/grpc/socket.go @@ -1,8 +1,8 @@ package grpc import ( - "github.com/micro/go-micro/network/transport" - pb "github.com/micro/go-micro/network/transport/grpc/proto" + "github.com/micro/go-micro/transport" + pb "github.com/micro/go-micro/transport/grpc/proto" "google.golang.org/grpc" ) diff --git a/network/transport/http/http.go b/transport/http/http.go similarity index 85% rename from network/transport/http/http.go rename to transport/http/http.go index a3a6bbfc..672db54c 100644 --- a/network/transport/http/http.go +++ b/transport/http/http.go @@ -2,7 +2,7 @@ package http import ( - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" ) // NewTransport returns a new http transport using net/http and supporting http2 diff --git a/network/transport/http/http_test.go b/transport/http/http_test.go similarity index 97% rename from network/transport/http/http_test.go rename to transport/http/http_test.go index 57445031..faaf5215 100644 --- a/network/transport/http/http_test.go +++ b/transport/http/http_test.go @@ -4,7 +4,7 @@ import ( "sync" "testing" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" ) func call(b *testing.B, c int) { diff --git a/network/transport/http/options.go b/transport/http/options.go similarity index 91% rename from network/transport/http/options.go rename to transport/http/options.go index 3d70f94b..2a6e56c5 100644 --- a/network/transport/http/options.go +++ b/transport/http/options.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" ) // Handle registers the handler for the given pattern. diff --git a/network/transport/http_proxy.go b/transport/http_proxy.go similarity index 100% rename from network/transport/http_proxy.go rename to transport/http_proxy.go diff --git a/network/transport/http_transport.go b/transport/http_transport.go similarity index 100% rename from network/transport/http_transport.go rename to transport/http_transport.go diff --git a/network/transport/http_transport_test.go b/transport/http_transport_test.go similarity index 100% rename from network/transport/http_transport_test.go rename to transport/http_transport_test.go diff --git a/network/transport/memory/memory.go b/transport/memory/memory.go similarity index 98% rename from network/transport/memory/memory.go rename to transport/memory/memory.go index 25782d50..ed00ce69 100644 --- a/network/transport/memory/memory.go +++ b/transport/memory/memory.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" ) type memorySocket struct { diff --git a/network/transport/memory/memory_test.go b/transport/memory/memory_test.go similarity index 97% rename from network/transport/memory/memory_test.go rename to transport/memory/memory_test.go index 0ff5b31d..72952e09 100644 --- a/network/transport/memory/memory_test.go +++ b/transport/memory/memory_test.go @@ -3,7 +3,7 @@ package memory import ( "testing" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" ) func TestMemoryTransport(t *testing.T) { diff --git a/network/transport/options.go b/transport/options.go similarity index 100% rename from network/transport/options.go rename to transport/options.go diff --git a/network/transport/quic/quic.go b/transport/quic/quic.go similarity index 98% rename from network/transport/quic/quic.go rename to transport/quic/quic.go index 548b1bc2..2622ec84 100644 --- a/network/transport/quic/quic.go +++ b/transport/quic/quic.go @@ -6,7 +6,7 @@ import ( "encoding/gob" "github.com/lucas-clemente/quic-go" - "github.com/micro/go-micro/network/transport" + "github.com/micro/go-micro/transport" utls "github.com/micro/go-micro/util/tls" ) diff --git a/network/transport/transport.go b/transport/transport.go similarity index 100% rename from network/transport/transport.go rename to transport/transport.go