diff options
Diffstat (limited to 'vendor/github.com/shazow/ssh-chat/sshd/terminal.go')
-rw-r--r-- | vendor/github.com/shazow/ssh-chat/sshd/terminal.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/vendor/github.com/shazow/ssh-chat/sshd/terminal.go b/vendor/github.com/shazow/ssh-chat/sshd/terminal.go index 977e146e..472b5c15 100644 --- a/vendor/github.com/shazow/ssh-chat/sshd/terminal.go +++ b/vendor/github.com/shazow/ssh-chat/sshd/terminal.go @@ -7,14 +7,17 @@ import ( "sync" "time" + "github.com/shazow/ssh-chat/sshd/terminal" "golang.org/x/crypto/ssh" - "golang.org/x/crypto/ssh/terminal" ) var keepaliveInterval = time.Second * 30 var keepaliveRequest = "keepalive@ssh-chat" +// ErrNoSessionChannel is returned when there is no session channel. var ErrNoSessionChannel = errors.New("no session channel") + +// ErrNotSessionChannel is returned when a channel is not a session channel. var ErrNotSessionChannel = errors.New("terminal requires session channel") // Connection is an interface with fields necessary to operate an sshd host. @@ -52,7 +55,7 @@ func (c sshConn) Name() string { return c.User() } -// Extending ssh/terminal to include a closer interface +// Terminal extends ssh/terminal to include a close method type Terminal struct { terminal.Terminal Conn Connection @@ -103,7 +106,7 @@ func NewTerminal(conn *ssh.ServerConn, ch ssh.NewChannel) (*Terminal, error) { return &term, nil } -// Find session channel and make a Terminal from it +// NewSession Finds a session channel and make a Terminal from it func NewSession(conn *ssh.ServerConn, channels <-chan ssh.NewChannel) (*Terminal, error) { // Make a terminal from the first session found for ch := range channels { |