Tunnel mode
This commit is contained in:
@@ -8,6 +8,12 @@ import (
|
||||
"github.com/micro/go-micro/transport"
|
||||
)
|
||||
|
||||
const (
|
||||
Unicast Mode = iota
|
||||
Multicast
|
||||
Broadcast
|
||||
)
|
||||
|
||||
var (
|
||||
// DefaultDialTimeout is the dial timeout if none is specified
|
||||
DefaultDialTimeout = time.Second * 5
|
||||
@@ -19,6 +25,8 @@ var (
|
||||
ErrLinkNotFound = errors.New("link not found")
|
||||
)
|
||||
|
||||
type Mode uint8
|
||||
|
||||
// Tunnel creates a gre tunnel on top of the go-micro/transport.
|
||||
// It establishes multiple streams using the Micro-Tunnel-Channel header
|
||||
// and Micro-Tunnel-Session header. The tunnel id is a hash of
|
||||
@@ -36,7 +44,7 @@ type Tunnel interface {
|
||||
// Connect to a channel
|
||||
Dial(channel string, opts ...DialOption) (Session, error)
|
||||
// Accept connections on a channel
|
||||
Listen(channel string) (Listener, error)
|
||||
Listen(channel string, opts ...ListenOption) (Listener, error)
|
||||
// Name of the tunnel implementation
|
||||
String() string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user