client

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package client contains the MVC for the client's overall state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	tui.Widget
	// contains filtered or unexported fields
}

func NewChannel

func NewChannel(network *Network, name string) *Channel

func (*Channel) IsFocused

func (c *Channel) IsFocused() bool

func (*Channel) Name

func (c *Channel) Name() string

func (*Channel) OnKeyEvent

func (c *Channel) OnKeyEvent(ev tui.KeyEvent)

func (*Channel) SetFocused

func (c *Channel) SetFocused(focus bool)

func (*Channel) UpdateChannel

func (c *Channel) UpdateChannel(ch data.ChannelState)

type Client

type Client struct {
	tui.Widget
	// contains filtered or unexported fields
}

func New

func New(ctl UIController, provider backend.DataPublisher) *Client

func (*Client) FocusDefault

func (c *Client) FocusDefault() tui.Widget

func (*Client) FocusNext

func (c *Client) FocusNext(w tui.Widget) tui.Widget

func (*Client) FocusPrev

func (c *Client) FocusPrev(w tui.Widget) tui.Widget

func (*Client) GetNetwork

func (c *Client) GetNetwork(name string) *Network

func (*Client) OnKeyEvent

func (c *Client) OnKeyEvent(ev tui.KeyEvent)

func (*Client) RemoveNetwork

func (c *Client) RemoveNetwork(name string)

func (*Client) UpdateChannel

func (c *Client) UpdateChannel(ch data.ChannelState)

func (*Client) UpdateNetwork

func (c *Client) UpdateNetwork(n data.NetworkState)

type Network

type Network struct {
	*tui.Box
	// contains filtered or unexported fields
}

Network is the implementation of a NetworkView.

func NewNetwork

func NewNetwork(client *Client, name string) *Network

NewNetwork gives a new Network view.

func (*Network) GetChannel

func (n *Network) GetChannel(name string) *Channel

func (*Network) Name

func (n *Network) Name() string

func (*Network) RemoveChannel

func (n *Network) RemoveChannel(name string)

func (*Network) SetFocused

func (n *Network) SetFocused(focus bool)

func (*Network) UpdateNetwork

func (n *Network) UpdateNetwork(state data.NetworkState)

type UIController

type UIController interface {
	Update(func())
	ActivateChannel(network, channel string)
	SetWidget(tui.Widget)
	Quit()
}

UIController handles UI events from a client View. All its methods should be called within an Update closure.

type View

type View interface {
	tui.Widget
	tui.FocusChain
}

View is a top-level view of the client state.

Jump to

Keyboard shortcuts

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