terminal

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCloseSignal  = syscall.SIGINT
	DefaultCloseTimeout = 10 * time.Second
)
View Source
const (
	WsMsgCmd       = "cmd"
	WsMsgResize    = "resize"
	WsMsgHeartbeat = "heartbeat"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalCommand

type LocalCommand struct {
	// contains filtered or unexported fields
}

func NewCommand

func NewCommand(commands string) (*LocalCommand, error)

func (*LocalCommand) Close

func (lcmd *LocalCommand) Close() error

func (*LocalCommand) Read

func (lcmd *LocalCommand) Read(p []byte) (n int, err error)

func (*LocalCommand) ResizeTerminal

func (lcmd *LocalCommand) ResizeTerminal(width int, height int) error

func (*LocalCommand) Wait

func (lcmd *LocalCommand) Wait(quitChan chan bool)

func (*LocalCommand) Write

func (lcmd *LocalCommand) Write(p []byte) (n int, err error)

type LocalWsSession

type LocalWsSession struct {
	// contains filtered or unexported fields
}

func NewLocalWsSession

func NewLocalWsSession(cols, rows int, wsConn *websocket.Conn, slave *LocalCommand) (*LocalWsSession, error)

func (*LocalWsSession) Start

func (sws *LocalWsSession) Start(quitChan chan bool)

type LogicSshWsSession

type LogicSshWsSession struct {
	IsFlagged bool
	// contains filtered or unexported fields
}

func NewLogicSshWsSession

func NewLogicSshWsSession(cols, rows int, isAdmin bool, sshClient *ssh.Client, wsConn *websocket.Conn) (*LogicSshWsSession, error)

func (*LogicSshWsSession) Close

func (sws *LogicSshWsSession) Close()

func (*LogicSshWsSession) Start

func (sws *LogicSshWsSession) Start(quitChan chan bool)

func (*LogicSshWsSession) Wait

func (sws *LogicSshWsSession) Wait(quitChan chan bool)

type WsMsg added in v1.1.0

type WsMsg struct {
	Type      string `json:"type"`
	Data      string `json:"data,omitempty"`      // WsMsgCmd
	Cols      int    `json:"cols,omitempty"`      // WsMsgResize
	Rows      int    `json:"rows,omitempty"`      // WsMsgResize
	Timestamp int    `json:"timestamp,omitempty"` // WsMsgHeartbeat
}

Jump to

Keyboard shortcuts

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