gotty: github.com/yubo/gotty/gottyclient Index | Files

package gottyclient

import "github.com/yubo/gotty/gottyclient"

Index

Package Files

arch.go gotty-client.go

func GetAuthTokenURL Uses

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

GetAuthTokenURL transforms a GoTTY http URL to its AuthToken file URL

func GetURLQuery Uses

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

GetURLQuery returns url.query

func GetWebsocketURL Uses

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

GetWebsocketURL transforms a GoTTY http URL to its WebSocket URL

func ParseURL Uses

func ParseURL(input string) (string, error)

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

type Client Uses

type Client struct {
    Dialer         *websocket.Dialer
    Conn           *websocket.Conn
    URL            string
    Connected      bool
    WriteMutex     *sync.Mutex
    Output         io.Writer
    QuitChan       chan struct{}
    QuitChanClosed bool
    SkipTLSVerify  bool
}

func NewClient Uses

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

NewClient returns a GoTTY client object

func (*Client) Close Uses

func (c *Client) Close()

Close will nicely close the dialer

func (*Client) Connect Uses

func (c *Client) Connect() error

Connect tries to dial a websocket server

func (*Client) ExitLoop Uses

func (c *Client) ExitLoop()

ExitLoop will kill all goroutine ExitLoop() -> wait Loop() -> Close()

func (*Client) GetAuthToken Uses

func (c *Client) GetAuthToken() (string, error)

GetAuthToken retrieves an Auth Token from dynamic auth_token.js file

func (*Client) Loop Uses

func (c *Client) Loop() error

Loop will look indefinitely for new messages

func (*Client) SetOutput Uses

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

SetOutput changes the output stream

Package gottyclient imports 20 packages (graph) and is imported by 1 packages. Updated 2017-01-26. Refresh now. Tools for package owners.