Add some tunnel comments

This commit is contained in:
Asim Aslam 2019-08-31 17:32:20 +01:00
parent 65c2de5a79
commit 0d94784e72

View File

@ -5,8 +5,8 @@ import (
"github.com/micro/go-micro/transport" "github.com/micro/go-micro/transport"
) )
// Tunnel creates a gre network tunnel on top of a link. // Tunnel creates a gre tunnel on top of the go-micro/transport.
// It establishes multiple streams using the Micro-Tunnel-Id header // It establishes multiple streams using the Micro-Tunnel-Channel header
// and Micro-Tunnel-Session header. The tunnel id is a hash of // and Micro-Tunnel-Session header. The tunnel id is a hash of
// the address being requested. // the address being requested.
type Tunnel interface { type Tunnel interface {
@ -27,16 +27,16 @@ type Tunnel interface {
// The listener provides similar constructs to the transport.Listener // The listener provides similar constructs to the transport.Listener
type Listener interface { type Listener interface {
Accept() (Session, error)
Channel() string Channel() string
Close() error Close() error
Accept() (Session, error)
} }
// Session is a unique session created when dialling or accepting connections on the tunnel // Session is a unique session created when dialling or accepting connections on the tunnel
type Session interface { type Session interface {
// Specifies the tunnel id // The unique session id
Id() string Id() string
// The session // The channel name
Channel() string Channel() string
// a transport socket // a transport socket
transport.Socket transport.Socket