Provide Links() method in Tunnel

This commit is contained in:
Asim Aslam
2019-09-04 15:41:57 +01:00
parent 7ab3934eb7
commit d559ce9da2
4 changed files with 40 additions and 20 deletions

View File

@@ -31,10 +31,20 @@ type Tunnel interface {
Dial(channel string, opts ...DialOption) (Session, error)
// Accept connections on a channel
Listen(channel string) (Listener, error)
// All the links the tunnel is connected to
Links() []Link
// Name of the tunnel implementation
String() string
}
// Link represents internal links to the tunnel
type Link interface {
// The id of the link
Id() string
// honours transport socket
transport.Socket
}
// The listener provides similar constructs to the transport.Listener
type Listener interface {
Accept() (Session, error)