terminal

package
v0.0.0-...-2a34ce9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleError

func HandleError(c *gin.Context, err error) bool

func HandlerLocalWS

func HandlerLocalWS(c *gin.Context)

func HandlerWS

func HandlerWS(c *gin.Context)

func JsonError

func JsonError(c *gin.Context, msg interface{})

func LogViewerHandler

func LogViewerHandler(c *gin.Context)

func NewSshClient

func NewSshClient() (*ssh.Client, error)

func WshandleError

func WshandleError(ws *websocket.Conn, err error) bool

Types

type SshConn

type SshConn struct {
	// calling Write() to write data into ssh server
	StdinPipe io.WriteCloser
	// Write() be called to receive data from ssh server
	ComboOutput *wsBufferWriter
	Session     *ssh.Session
}

connect to ssh server using ssh session.

func NewSshConn

func NewSshConn(cols, rows int, sshClient *ssh.Client) (*SshConn, error)

setup ssh shell session set Session and StdinPipe here, and the Session.Stdout and Session.Sdterr are also set.

func (*SshConn) Close

func (s *SshConn) Close()

func (*SshConn) ReceiveWsMsg

func (ssConn *SshConn) ReceiveWsMsg(wsConn *websocket.Conn, logBuff *bytes.Buffer, exitCh chan bool)

ReceiveWsMsg receive websocket msg do some handling then write into ssh.session.stdin

func (*SshConn) SendComboOutput

func (ssConn *SshConn) SendComboOutput(wsConn *websocket.Conn, exitCh chan bool)

func (*SshConn) SessionWait

func (ssConn *SshConn) SessionWait(quitChan chan bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL