gottyclient

package module
v0.0.0-...-8f4b1ae Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetURLQuery

func GetURLQuery(rawurl string) (url.Values, error)

GetURLQuery returns url.query

func GetWebsocketURL

func GetWebsocketURL(httpURL string) (*url.URL, *http.Header, error)

GetWebsocketURL transforms a GoTTY http URL to its WebSocket URL

func ParseURL

func ParseURL(input string) (string, error)

ParseURL parses an URL which may be incomplete and tries to standardize it

Types

type Client

type Client struct {
	Dialer     *websocket.Dialer
	Conn       *websocket.Conn
	URL        string
	WriteMutex *sync.Mutex
	Output     io.Writer

	SkipTLSVerify   bool
	UseProxyFromEnv bool
	Connected       bool
	// contains filtered or unexported fields
}

Client type

func NewClient

func NewClient(inputURL string) (*Client, error)

NewClient returns a GoTTY client object

func (*Client) Close

func (c *Client) Close()

Close will nicely close the dialer

func (*Client) Connect

func (c *Client) Connect(build, new bool, file, img, username, key, port string) error

Connect tries to dial a websocket server

func (*Client) ExitLoop

func (c *Client) ExitLoop()

ExitLoop will kill all goroutines launched by c.Loop() ExitLoop() -> wait Loop() -> Close()

func (*Client) Loop

func (c *Client) Loop(build, new bool, file, img, username, key, port string) error

Loop will look indefinitely for new messages

func (*Client) SetOutput

func (c *Client) SetOutput(w io.Writer)

SetOutput changes the output stream

Jump to

Keyboard shortcuts

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