Documentation ¶
Index ¶
- Constants
- func DisconnectClient(opts *remote.SSHOpts) error
- func EnsureConnection(ctx context.Context, connName string) error
- func GetAllConnStatus() []wshrpc.ConnStatus
- func GetConnectionsFromConfig() ([]string, error)
- func GetConnectionsList() ([]string, error)
- type SSHConn
- func (conn *SSHConn) CheckAndInstallWsh(ctx context.Context, clientDisplayName string, opts *WshInstallOpts) error
- func (conn *SSHConn) Close() error
- func (conn *SSHConn) Connect(ctx context.Context) error
- func (conn *SSHConn) DeriveConnStatus() wshrpc.ConnStatus
- func (conn *SSHConn) FireConnChangeEvent()
- func (conn *SSHConn) GetClient() *ssh.Client
- func (conn *SSHConn) GetDomainSocketName() string
- func (conn *SSHConn) GetName() string
- func (conn *SSHConn) GetStatus() string
- func (conn *SSHConn) OpenDomainSocketListener() error
- func (conn *SSHConn) Reconnect(ctx context.Context) error
- func (conn *SSHConn) StartConnServer() error
- func (conn *SSHConn) WaitForConnect(ctx context.Context) error
- func (conn *SSHConn) WithLock(fn func())
- type WshInstallOpts
Constants ¶
View Source
const ( Status_Init = "init" Status_Connecting = "connecting" Status_Connected = "connected" Status_Disconnected = "disconnected" Status_Error = "error" )
View Source
const DefaultConnectionTimeout = 60 * time.Second
Variables ¶
This section is empty.
Functions ¶
func DisconnectClient ¶
func EnsureConnection ¶
Convenience function for ensuring a connection is established
func GetAllConnStatus ¶
func GetAllConnStatus() []wshrpc.ConnStatus
func GetConnectionsList ¶
Types ¶
type SSHConn ¶
type SSHConn struct { Lock *sync.Mutex Status string Opts *remote.SSHOpts Client *ssh.Client SockName string DomainSockListener net.Listener ConnController *ssh.Session Error string HasWaiter *atomic.Bool LastConnectTime int64 ActiveConnNum int }
func (*SSHConn) CheckAndInstallWsh ¶
func (*SSHConn) DeriveConnStatus ¶
func (conn *SSHConn) DeriveConnStatus() wshrpc.ConnStatus
func (*SSHConn) FireConnChangeEvent ¶
func (conn *SSHConn) FireConnChangeEvent()
func (*SSHConn) GetDomainSocketName ¶
func (*SSHConn) OpenDomainSocketListener ¶
func (*SSHConn) StartConnServer ¶
type WshInstallOpts ¶
Click to show internal directories.
Click to hide internal directories.