tray

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSupported = fmt.Errorf("unsupported operating system: %s", runtime.GOOS)
)

Functions

func Run

func Run(url string)

Run opens the system tray

Types

type Client

type Client struct {
	sync.Mutex

	Status chan StatusMessage
	Errors chan error
	Tasks  chan []*common.ConcreteSyncState
	// contains filtered or unexported fields
}

Client is an auto-reconnecting WebSocket client connected to the http server.

func NewClient

func NewClient() *Client

NewClient creates a client

func (*Client) Close

func (c *Client) Close()

Close closes the WebSocket connection

func (*Client) Connect

func (c *Client) Connect() error

Connect opens a link to the WebSocket

func (*Client) Poll added in v0.9.2

func (c *Client) Poll()

func (*Client) Reconnect

func (c *Client) Reconnect()

Reconnect tries a reconnection of the WebSocket link.

func (*Client) SendCmd added in v0.8.0

func (c *Client) SendCmd(content *common.CmdContent)

SendCmd sends a command via the WebSocket

func (*Client) SendHalt added in v0.8.0

func (c *Client) SendHalt()

SendHalt sends a Quit command to the server. The parent process of the systray should be then killed by the server. If send fails or if it is still running after 3 seconds, quit directly this process.

func (*Client) SendOrderedTasks

func (c *Client) SendOrderedTasks()

SendOrderedTasks sends the lists of tasks

func (*Client) SendRoute added in v0.8.0

func (c *Client) SendRoute(route string)

SendRoute sends a target route to the websocket. When the WebView is already opened, it will switch the current screen instead of reopening the webview.

type StatusMessage

type StatusMessage int

StatusMessage provides an int representation of Connected/Disconnected status

const (
	StatusConnected StatusMessage = iota
	StatusDisconnected
)

Jump to

Keyboard shortcuts

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