channel

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRenderer

func DefaultRenderer(e data.Event) tui.Widget

DefaultRenderer is the default way to render Widgets.

Types

type EventRenderer

type EventRenderer func(data.Event) tui.Widget

EventRenderer is a function that converts a DiscoIRC event (e.g. message) into an tui.Widget suitable for display.

type EventsProvider

type EventsProvider interface {
	EventsBefore(net, target string, n int, last data.EventID) []data.Event
}

EventsProvider returns up to n events ending with 'last'.

type EventsWidget

type EventsWidget struct {
	*widgets.TailBox

	Renderer EventRenderer
	// contains filtered or unexported fields
}

EventsWidget displays the last data.Event objects it contains.

func NewEventsWidget

func NewEventsWidget(network, target string, in EventsProvider) *EventsWidget

func (*EventsWidget) Resize

func (v *EventsWidget) Resize(size image.Point)

func (*EventsWidget) SetLast

func (v *EventsWidget) SetLast(new data.EventID)

type UIController

type UIController interface {
	Update(func())
	SetWidget(tui.Widget)
	Quit()

	ActivateClient()
}

UIController provides an interface to a global control layer.

type View

type View struct {

	// root element
	*tui.Box
	// contains filtered or unexported fields
}

View implements the channel view.

func New

func New(network, target string, ui UIController, backend backend.Backend) *View

New returns a new View. It must be run from the main (UI) thread.

func (*View) Filter

func (v *View) Filter() (string, string)

Filter indicates the network and target this widget should receive updates for.

func (*View) OnKeyEvent

func (v *View) OnKeyEvent(ev tui.KeyEvent)

func (*View) SetRenderer

func (v *View) SetRenderer(e EventRenderer)

func (*View) UpdateChannel

func (v *View) UpdateChannel(d data.ChannelState)

func (*View) UpdateNetwork

func (v *View) UpdateNetwork(n data.NetworkState)

Jump to

Keyboard shortcuts

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