Move transport to network/transport
This commit is contained in:
parent
eafc930f84
commit
d2d6841f02
@ -17,7 +17,7 @@ import (
|
|||||||
"github.com/micro/go-micro/errors"
|
"github.com/micro/go-micro/errors"
|
||||||
"github.com/micro/go-micro/metadata"
|
"github.com/micro/go-micro/metadata"
|
||||||
"github.com/micro/go-micro/registry"
|
"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"
|
||||||
"google.golang.org/grpc/credentials"
|
"google.golang.org/grpc/credentials"
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"github.com/micro/go-micro/client/selector"
|
"github.com/micro/go-micro/client/selector"
|
||||||
"github.com/micro/go-micro/codec"
|
"github.com/micro/go-micro/codec"
|
||||||
"github.com/micro/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Options struct {
|
type Options struct {
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCallOptions(t *testing.T) {
|
func TestCallOptions(t *testing.T) {
|
||||||
|
@ -18,7 +18,7 @@ import (
|
|||||||
"github.com/micro/go-micro/errors"
|
"github.com/micro/go-micro/errors"
|
||||||
"github.com/micro/go-micro/metadata"
|
"github.com/micro/go-micro/metadata"
|
||||||
"github.com/micro/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
type rpcClient struct {
|
type rpcClient struct {
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
"github.com/micro/go-micro/codec/protorpc"
|
"github.com/micro/go-micro/codec/protorpc"
|
||||||
"github.com/micro/go-micro/errors"
|
"github.com/micro/go-micro/errors"
|
||||||
"github.com/micro/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
type pool struct {
|
type pool struct {
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
"github.com/micro/go-micro/transport/memory"
|
"github.com/micro/go-micro/network/transport/memory"
|
||||||
)
|
)
|
||||||
|
|
||||||
func testPool(t *testing.T, size int, ttl time.Duration) {
|
func testPool(t *testing.T, size int, ttl time.Duration) {
|
||||||
|
@ -2,7 +2,7 @@ package client
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/micro/go-micro/codec"
|
"github.com/micro/go-micro/codec"
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
type rpcResponse struct {
|
type rpcResponse struct {
|
||||||
|
@ -38,10 +38,10 @@ import (
|
|||||||
"github.com/micro/go-micro/client/selector/static"
|
"github.com/micro/go-micro/client/selector/static"
|
||||||
|
|
||||||
// transports
|
// transports
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
tgrpc "github.com/micro/go-micro/transport/grpc"
|
tgrpc "github.com/micro/go-micro/network/transport/grpc"
|
||||||
thttp "github.com/micro/go-micro/transport/http"
|
thttp "github.com/micro/go-micro/network/transport/http"
|
||||||
tmem "github.com/micro/go-micro/transport/memory"
|
tmem "github.com/micro/go-micro/network/transport/memory"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Cmd interface {
|
type Cmd interface {
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"github.com/micro/go-micro/client/selector"
|
"github.com/micro/go-micro/client/selector"
|
||||||
"github.com/micro/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"github.com/micro/go-micro/server"
|
"github.com/micro/go-micro/server"
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Options struct {
|
type Options struct {
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"github.com/micro/go-micro/codec"
|
"github.com/micro/go-micro/codec"
|
||||||
"github.com/micro/go-micro/codec/proto"
|
"github.com/micro/go-micro/codec/proto"
|
||||||
pb "github.com/micro/go-micro/network/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 {
|
type link struct {
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/micro/go-micro/registry"
|
"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/addr"
|
||||||
"github.com/micro/go-micro/util/log"
|
"github.com/micro/go-micro/util/log"
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
maddr "github.com/micro/go-micro/util/addr"
|
maddr "github.com/micro/go-micro/util/addr"
|
||||||
mnet "github.com/micro/go-micro/util/net"
|
mnet "github.com/micro/go-micro/util/net"
|
||||||
mls "github.com/micro/go-micro/util/tls"
|
mls "github.com/micro/go-micro/util/tls"
|
||||||
@ -14,7 +14,7 @@ import (
|
|||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/credentials"
|
"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 {
|
type grpcTransport struct {
|
@ -4,7 +4,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
func expectedPort(t *testing.T, expected string, lsn transport.Listener) {
|
func expectedPort(t *testing.T, expected string, lsn transport.Listener) {
|
@ -3,8 +3,8 @@ package grpc
|
|||||||
import (
|
import (
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
|
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
pb "github.com/micro/go-micro/transport/grpc/proto"
|
pb "github.com/micro/go-micro/network/transport/grpc/proto"
|
||||||
"github.com/micro/go-micro/util/log"
|
"github.com/micro/go-micro/util/log"
|
||||||
"google.golang.org/grpc/peer"
|
"google.golang.org/grpc/peer"
|
||||||
)
|
)
|
@ -1,5 +1,5 @@
|
|||||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
// 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
|
package go_micro_grpc_transport
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// 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
|
package go_micro_grpc_transport
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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{
|
var fileDescriptor_29b90b9ccd5e0da5 = []byte{
|
||||||
@ -197,5 +197,5 @@ var _Transport_serviceDesc = grpc.ServiceDesc{
|
|||||||
ClientStreams: true,
|
ClientStreams: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Metadata: "go-micro/transport/grpc/proto/transport.proto",
|
Metadata: "go-micro/network/transport/grpc/proto/transport.proto",
|
||||||
}
|
}
|
@ -1,8 +1,8 @@
|
|||||||
package grpc
|
package grpc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
pb "github.com/micro/go-micro/transport/grpc/proto"
|
pb "github.com/micro/go-micro/network/transport/grpc/proto"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
)
|
)
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
package http
|
package http
|
||||||
|
|
||||||
import (
|
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
|
// NewTransport returns a new http transport using net/http and supporting http2
|
@ -4,7 +4,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
func call(b *testing.B, c int) {
|
func call(b *testing.B, c int) {
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Handle registers the handler for the given pattern.
|
// Handle registers the handler for the given pattern.
|
@ -9,7 +9,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
type memorySocket struct {
|
type memorySocket struct {
|
@ -3,7 +3,7 @@ package memory
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMemoryTransport(t *testing.T) {
|
func TestMemoryTransport(t *testing.T) {
|
@ -1,7 +1,7 @@
|
|||||||
package mucp
|
package mucp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
type listener struct {
|
type listener struct {
|
@ -9,7 +9,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/micro/go-micro/network"
|
"github.com/micro/go-micro/network"
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
type networkKey struct{}
|
type networkKey struct{}
|
@ -3,7 +3,7 @@ package mucp
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
// socket is our pseudo socket for transport.Socket
|
// socket is our pseudo socket for transport.Socket
|
@ -3,7 +3,7 @@ package mucp
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestTunnelSocket(t *testing.T) {
|
func TestTunnelSocket(t *testing.T) {
|
@ -6,7 +6,7 @@ import (
|
|||||||
"encoding/gob"
|
"encoding/gob"
|
||||||
|
|
||||||
"github.com/lucas-clemente/quic-go"
|
"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"
|
utls "github.com/micro/go-micro/util/tls"
|
||||||
)
|
)
|
||||||
|
|
@ -7,7 +7,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
// tun represents a network tunnel
|
// tun represents a network tunnel
|
||||||
|
@ -3,7 +3,7 @@ package tunnel
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
// socket is our pseudo socket for transport.Socket
|
// socket is our pseudo socket for transport.Socket
|
||||||
|
@ -3,7 +3,7 @@ package tunnel
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestTunnelSocket(t *testing.T) {
|
func TestTunnelSocket(t *testing.T) {
|
||||||
|
@ -3,7 +3,7 @@ package tunnel
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/micro/go-micro/config/options"
|
"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
|
// Tunnel creates a network tunnel
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/micro/go-micro/config/cmd"
|
"github.com/micro/go-micro/config/cmd"
|
||||||
"github.com/micro/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"github.com/micro/go-micro/server"
|
"github.com/micro/go-micro/server"
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Options struct {
|
type Options struct {
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/micro/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"github.com/micro/go-micro/server"
|
"github.com/micro/go-micro/server"
|
||||||
"github.com/micro/go-micro/server/debug"
|
"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"
|
||||||
"google.golang.org/grpc/encoding"
|
"google.golang.org/grpc/encoding"
|
||||||
)
|
)
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/micro/go-micro/codec"
|
"github.com/micro/go-micro/codec"
|
||||||
"github.com/micro/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"github.com/micro/go-micro/server/debug"
|
"github.com/micro/go-micro/server/debug"
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Options struct {
|
type Options struct {
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"github.com/micro/go-micro/codec/jsonrpc"
|
"github.com/micro/go-micro/codec/jsonrpc"
|
||||||
"github.com/micro/go-micro/codec/proto"
|
"github.com/micro/go-micro/codec/proto"
|
||||||
"github.com/micro/go-micro/codec/protorpc"
|
"github.com/micro/go-micro/codec/protorpc"
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/micro/go-micro/codec"
|
"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
|
// testCodec is a dummy codec that only knows how to encode nil bodies
|
||||||
|
@ -2,7 +2,7 @@ package server
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/micro/go-micro/codec"
|
"github.com/micro/go-micro/codec"
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
type rpcRequest struct {
|
type rpcRequest struct {
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/micro/go-micro/codec"
|
"github.com/micro/go-micro/codec"
|
||||||
"github.com/micro/go-micro/transport"
|
"github.com/micro/go-micro/network/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
type rpcResponse struct {
|
type rpcResponse struct {
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
"github.com/micro/go-micro/codec"
|
"github.com/micro/go-micro/codec"
|
||||||
"github.com/micro/go-micro/metadata"
|
"github.com/micro/go-micro/metadata"
|
||||||
"github.com/micro/go-micro/registry"
|
"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/addr"
|
||||||
log "github.com/micro/go-micro/util/log"
|
log "github.com/micro/go-micro/util/log"
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user