Connectionsmap[string]*SessionMutexsync.Mutex Delete connection object from pool Get connection from pool GetRaw connection object from pool Lock locks m.
If the lock is already in use, the calling goroutine
blocks until the mutex is available. Set connection on pool SetRaw connection object on pool TryLock tries to lock m and reports whether it succeeded.
Note that while correct uses of TryLock do exist, they are rare,
and use of TryLock is often a sign of a deeper problem
in a particular use of mutexes. Unlock unlocks m.
It is a run-time error if m is not locked on entry to Unlock.
A locked Mutex is not associated with a particular goroutine.
It is allowed for one goroutine to lock a Mutex and then
arrange for another goroutine to unlock it.
*Pool : sync.Locker
var Sessions
IpAddrstringLastConnectiontime.TimeMutexsync.MutexPortstringSFTP*sftp.ClientSMB*smb2.SessionSSH*ssh.ClientSSHSession*ssh.ClientUsernamestringWinRM*winrm.ClientWindowsLetterstringWindowsPathstring CloseAllConnections closes all connections on session CreateFileSesssion creates a new file session with credential type and sets it on session CreateRaw creates a new raw shell with credential type and sets it on session CreateShell creates a new shell with credential type and sets it on session Get downloads file to local path Lock locks m.
If the lock is already in use, the calling goroutine
blocks until the mutex is available. Put sends file to a remote path Run runs command on sessions SSH and returns output SftpGetFile downloads file from remote path SftpPutFile uploads file on remote path SmbGetFile downloads file from remote path to local path SmbPutFile uploads file from local path to remote path TryLock tries to lock m and reports whether it succeeded.
Note that while correct uses of TryLock do exist, they are rare,
and use of TryLock is often a sign of a deeper problem
in a particular use of mutexes. Unlock unlocks m.
It is a run-time error if m is not locked on entry to Unlock.
A locked Mutex is not associated with a particular goroutine.
It is allowed for one goroutine to lock a Mutex and then
arrange for another goroutine to unlock it.
*Session : sync.Locker
func GetSession(userID, serverID, host string) (*Session, error)
func (*Pool).Get(userID, serverID string) (*Session, error)
func (*Pool).GetRaw(userID, remoteHost, username string) (*Session, error)
func (*Pool).Set(userID, serverID string, session *Session)
func (*Pool).SetRaw(userID, remoteHost, username string, session *Session)
LastConnectiontime.TimeMutexsync.MutexPortintSshClient*ssh.ClientStartedbool Lock locks m.
If the lock is already in use, the calling goroutine
blocks until the mutex is available. Start starts binding to remote end and return error if exists any Stop collapses tunnel String returns readable format of tunnel struct TryLock tries to lock m and reports whether it succeeded.
Note that while correct uses of TryLock do exist, they are rare,
and use of TryLock is often a sign of a deeper problem
in a particular use of mutexes. Unlock unlocks m.
It is a run-time error if m is not locked on entry to Unlock.
A locked Mutex is not associated with a particular goroutine.
It is allowed for one goroutine to lock a Mutex and then
arrange for another goroutine to unlock it.
*Tunnel : github.com/ChrisTrenkamp/goxpath/tree.Result
*Tunnel : fmt.Stringer
*Tunnel : sync.Locker
func (*TunnelPool).Get(remoteHost, remotePort, username string) (*Tunnel, error)
func (*TunnelPool).Set(remoteHost, remotePort, username string, tunnel *Tunnel)
Connectionsmap[string]*TunnelMutexsync.Mutex Delete Tunnel connection from pool Get Tunnel connection from pool Lock locks m.
If the lock is already in use, the calling goroutine
blocks until the mutex is available. Set Tunnel connection to pool TryLock tries to lock m and reports whether it succeeded.
Note that while correct uses of TryLock do exist, they are rare,
and use of TryLock is often a sign of a deeper problem
in a particular use of mutexes. Unlock unlocks m.
It is a run-time error if m is not locked on entry to Unlock.
A locked Mutex is not associated with a particular goroutine.
It is allowed for one goroutine to lock a Mutex and then
arrange for another goroutine to unlock it.
*TunnelPool : sync.Locker
var Tunnels
Package-Level Functions (total 12)
Clean clears long standing sessions from memory
CreateTunnel starts a new tunnel instance and sets it into TunnelPool
GetSession gets session from memory and if does not exists creates a new one
InitShellWithCert creates a SSH shell with certificate
InitShellWithPassword creates a SSH shell with password
InitWinRm creates a new WinRM client and returns it
OpenSFTPConnection creates a new SFTP connection
OpenSmbConnection creates a new smb connection session
VerifyAuth verifies key when connecting
VerifySSH checks if remote end is active or not
VerifySSHCertificate checks if remote end is active or not
VerifyWinRm checks if WinRM authentication is valid to remote end
The pages are generated with Goldsv0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.