Documentation ¶
Overview ¶
Package tunnel provides gre network tunnelling
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// DefaultAddress is default tunnel bind address
DefaultAddress = ":9096"
)
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn interface { // Specifies the tunnel id Id() string // The session Session() string // a transport socket transport.Socket }
Conn is a connection dialed or accepted which includes the tunnel id and session
type Options ¶
type Options struct { // Id is tunnel id Id string // Address is tunnel address Address string // Nodes are remote nodes Nodes []string // Transport listens to incoming connections Transport transport.Transport }
Options provides network configuration options
type Tunnel ¶
type Tunnel interface { Init(opts ...Option) error // Connect connects the tunnel Connect() error // Close closes the tunnel Close() error // Dial an endpoint Dial(addr string) (Conn, error) // Accept connections Listen(addr string) (Listener, error) }
Tunnel creates a gre network tunnel on top of a link. It establishes multiple streams using the Micro-Tunnel-Id header and Micro-Tunnel-Session header. The tunnel id is a hash of the address being requested.
Click to show internal directories.
Click to hide internal directories.