Documentation
¶
Index ¶
- func TunRegistry() *registry.Registry
- type Tunnel
- func (t *Tunnel) GetActiveClientsCount() int
- func (t *Tunnel) GetCurrentBytesPerSecond() int64
- func (t *Tunnel) GetEndpoint() utils.Endpoint
- func (t *Tunnel) GetIsListenerLocal() bool
- func (t *Tunnel) GetListenerAddr() net.Addr
- func (t *Tunnel) IsStoppable() bool
- func (t *Tunnel) Start()
- func (t *Tunnel) Stop()
- type TunnelConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TunRegistry ¶
TunRegistry returns a singleton instance of Registry
Types ¶
type Tunnel ¶
type Tunnel struct {
// contains filtered or unexported fields
}
Tunnel object
func NewTunnel ¶
func NewTunnel(sshConn *sshc.SshConnection, conf *TunnelConf, stoppable bool) *Tunnel
NewTunnel builds a Tunnel object
func (*Tunnel) GetActiveClientsCount ¶
GetActiveClientsCount returns how many clients are actually using the tunnel
func (*Tunnel) GetCurrentBytesPerSecond ¶
GetsCurrentBytesPerSecond return the current tunnel throughput
func (*Tunnel) GetEndpoint ¶
GetEndpoint returns the tunnel endpoint
func (*Tunnel) GetIsListenerLocal ¶
GetIsListenerLocal return true if it is a forward tunnel. In a forward tunnel a socket listener is started on the local (rospo) machine and all the connections are forwarded to the remote endpoint. In a NON forward tunnel, the listener is started on the remote machine instead. When a client connects to the remote listener the connection is forwarded on the local endpoint
func (*Tunnel) GetListenerAddr ¶
GetListenerAddr returns the tunnel listener network address
func (*Tunnel) IsStoppable ¶
IsStoppable return true if the tunnel can be stopped calling the Stop method. False if not
type TunnelConf ¶
type TunnelConf struct {
//// Tunnel conf
Remote string `yaml:"remote" json:"remote"`
Local string `yaml:"local" json:"local"`
// indicates if it is a forward or reverse tunnel
Forward bool `yaml:"forward" json:"forward"`
// use a dedicated ssh client. if nil use the global one
SshClientConf *sshc.SshClientConf `yaml:"sshclient" json:"sshclient"`
}
TunnelConf is a struct that holds the tunnel configuration
func (*TunnelConf) GetLocalEndpoint ¶
func (c *TunnelConf) GetLocalEndpoint() *utils.Endpoint
GetLocalEndpoint Builds a locale endpoint object from the Local string
func (*TunnelConf) GetRemotEndpoint ¶
func (c *TunnelConf) GetRemotEndpoint() *utils.Endpoint
GetRemotEndpoint Builds a remote endpoint object from the Remote string