refactor: seperate application into seperate files and add killForwarding
This commit is contained in:
parent
fec43ea77d
commit
a7ea6f41a7
7 changed files with 481 additions and 357 deletions
18
ssh.go
Normal file
18
ssh.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package main
|
||||
|
||||
import "golang.org/x/crypto/ssh"
|
||||
|
||||
type SSHConnection struct {
|
||||
client *ssh.Client
|
||||
session *ssh.Session
|
||||
}
|
||||
|
||||
func (s *SSHConnection) Close() {
|
||||
if s.session != nil {
|
||||
s.session.Close()
|
||||
}
|
||||
|
||||
if s.client != nil {
|
||||
s.client.Close()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue