api

package
v0.0.0-...-159ce0f Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OtterchatKey  = "otterchat"
	CMDSymbolName = "Commands"
)

OtterchatKey key for the main page

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Name() string
	Usage() string
	Desc() string
	Exec(*UI, *Page, []string) error
}

Command represents an executable a command

type Commands

type Commands interface {
	Registry() map[string]Command
}

Commands a plugin that contains one or more command

type Page

type Page struct {
	ChannelInfoView *tview.TextView
	ChatView        *tview.TextView
	InputInfoView   *tview.TextView
	UserInput       *tview.InputField
	UserList        *tview.List
}

Page The elements needed for the page

type UI

type UI struct {
	App            *tview.Application
	AppView        *tview.Flex
	ConnectionList *tview.List
	Pages          *tview.Pages
	PageMap        map[string]*Page
}

UI The User Inteface elements

func Init

func Init() *UI

Init the User Interface

func (*UI) AddPage

func (ui *UI) AddPage(id string, commands map[string]Command)

AddPage adds a next context switcher between channels

func (*UI) Run

func (ui *UI) Run() error

Run the User Interface

Jump to

Keyboard shortcuts

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