Documentation ¶
Index ¶
- Variables
- type Link
- func (l *Link) Bind(conn es.Conn) error
- func (l *Link) Close() error
- func (l *Link) IsClosed() bool
- func (l *Link) IsStopped() bool
- func (l *Link) NewSession() (*session.Session, error)
- func (l *Link) OpenTunnel(proto string, localHost string, localPort int, remoteHost string, ...) error
- func (l *Link) Ping() (time.Duration, error)
- func (l *Link) Stop() error
- func (l *Link) Wait()
- type LinkConfig
- type OpenTunnelFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrLinkShutdown = errors.New("link is shutdown") ErrTimeout = errors.New("timeout") ErrKeepaliveTimeout = errors.New("keepalive error") ErrMsgPingInvalid = errors.New("invalid ping message") )
Define error
Functions ¶
This section is empty.
Types ¶
type Link ¶
type Link struct { ID uint32 // contains filtered or unexported fields }
Link is the main connection between two endpoint
func NewLinkCustom ¶
func NewLinkCustom(config *LinkConfig, hdr session.RequestHandler) *Link
NewLinkCustom create a new link by custom session.RequestHandler
func (*Link) OpenTunnel ¶
func (l *Link) OpenTunnel(proto string, localHost string, localPort int, remoteHost string, remotePort int, reverse bool) error
OpenTunnel open a tunnel
type LinkConfig ¶
type LinkConfig struct { // ID need to be started differently IsServerSide bool // KeepaliveInterval is how often to perform the keep alive KeepaliveInterval time.Duration // ConnectionWriteTimeout is meant to be a "safety valve" timeout after // we which will suspect a problem with the underlying connection and // close it. This is only applied to writes, where's there's generally // an expectation that things will move along quickly. ConnectionWriteTimeout time.Duration }
LinkConfig reserved for config
Click to show internal directories.
Click to hide internal directories.