ws

package
v0.0.0-...-9f65fc3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Client messages
	MsgInput          byte = '0'
	MsgResizeTerminal byte = '1'
	MsgPause          byte = '2'
	MsgResume         byte = '3'
	MsgJsonData       byte = '{'
	MsgBreak          byte = 'b'

	// Both
	MsgDetectBaudrate byte = 'B'

	// Server messages
	MsgOutput         byte = '0'
	MsgSetWindowTitle byte = '1'
	MsgPreferences    byte = '2'
	MsgServerPause    byte = 'S'
	MsgServerResume   byte = 'Q'
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthDTO

type AuthDTO struct {
	AuthToken string
}

type Client

type Client struct {
	BaseUrl          *url.URL
	WsClient         *websocket.Conn
	HttpResp         *http.Response
	WinTitle         <-chan []byte
	Output           <-chan []byte
	Input            chan<- []byte
	DetectedBaudrate <-chan [2]int64
	Error            <-chan error
	CloseChan        <-chan interface{}
	// contains filtered or unexported fields
}

func DialAndAuth

func DialAndAuth(baseUrl *url.URL, token *string, watchdog int) (client *Client, err error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Pause

func (c *Client) Pause()

func (*Client) Redial

func (c *Client) Redial(token *string) error

func (*Client) RequestBaudrateDetection

func (c *Client) RequestBaudrateDetection()

func (*Client) ResizeTerminal

func (c *Client) ResizeTerminal(cols int, rows int)

func (*Client) Resume

func (c *Client) Resume()

func (*Client) Run

func (c *Client) Run(watchdog int)

func (*Client) SendBreak

func (c *Client) SendBreak()

func (*Client) SoftClose

func (c *Client) SoftClose() error

type ResizeTerminalDTO

type ResizeTerminalDTO struct {
	Columns int `json:"columns"`
	Rows    int `json:"rows"`
}

type TtyClientOps

type TtyClientOps interface {
	io.Closer

	Redial(token *string, watchdog int) error
	Run()
	ResizeTerminal(cols int, rows int)
	RequestBaudrateDetect()
	Pause()
	Resume()
	SendBreak()
	SoftClose() error
}

Jump to

Keyboard shortcuts

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