Documentation
¶
Index ¶
Constants ¶
const ( // PageLanding = "landing" PageThings = "things" PageDirectories = "directories" PageDiscovery = "discovery" PageTD = "td" )
const ( MenuEvClose = "close" MenuEvDiscover = "discover" MenuEvListTDs = "listTDs" MenuEvNextPage = "nextPage" MenuEvSelectTD = "selectTD" MenuEvShowDiscovered = "showDiscovered" MenuEvShowDirectory = "showDirectory" MenuEvShowDirectories = "showDirectories" MenuEvShowTD = "showTD" MenuEvShowThings = "showThings" MenuEvQuit = "quit" )
menu events
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppFooter ¶
type AppFooter struct {
// contains filtered or unexported fields
}
The application footer are that shows the current activity and ?
func NewAppFooter ¶
func NewAppFooter(model *wotco.WotConsumer) *AppFooter
Create a new instance of the application view
func (*AppFooter) Refresh ¶
func (footer *AppFooter) Refresh()
Reload the text being shown using updated values
func (*AppFooter) SetHandler ¶
type AppHeader ¶
The application header are that shows the connect connection and loaded status
func NewAppHeader ¶
func NewAppHeader(model *wotco.WotConsumer) *AppHeader
Create a new instance of the application view
type DirectoriesPage ¶
type DirectoriesPage struct {
TuiTable
// contains filtered or unexported fields
}
Show the loaded directories in the main view
func NewDirectoriesPage ¶
func NewDirectoriesPage(model *wotco.WotConsumer) *DirectoriesPage
Return a new page with a table of known thing TDs
func (*DirectoriesPage) GetDirectoryID ¶
func (v *DirectoriesPage) GetDirectoryID(row int) string
Return the directoryID of the selected row, or empty string if not found
func (*DirectoriesPage) Refresh ¶
func (v *DirectoriesPage) Refresh()
Show the loaded directories in the main view this rotates through different tables
func (*DirectoriesPage) SetHandler ¶
func (footer *DirectoriesPage) SetHandler(h func(ev ...string))
type DiscoPage ¶
Page with discovery records
func NewDiscoPage ¶
func NewDiscoPage(model *wotco.WotConsumer) *DiscoPage
Create a new discovery table page
type TDPage ¶
Page for showing details of a TD document This consists of a header section with 3 tables for affordances and their value Including a button to subscribe and download the TD document as JSON.
func NewTDPage ¶
func NewTDPage(model *wotco.WotConsumer) *TDPage
func (*TDPage) SetHandler ¶
type ThingsPage ¶
Show the loaded things in the main view this rotates through different tabl
func NewThingsPage ¶
func NewThingsPage(model *wotco.WotConsumer) *ThingsPage
Return a new page with a table of known thing TDs
func (*ThingsPage) GetThingID ¶
func (v *ThingsPage) GetThingID(row int) string
Return the thingID of the selected row, or empty string if not found
func (*ThingsPage) Refresh ¶
func (v *ThingsPage) Refresh()
Show the loaded things in the main view this rotates through different tables
func (*ThingsPage) SetHandler ¶
func (footer *ThingsPage) SetHandler(h func(ev ...string))
type TreeMenu ¶
func NewTreeMenu ¶
func NewTreeMenu(model *wotco.WotConsumer) *TreeMenu
func (*TreeMenu) HandleSelection ¶
func (*TreeMenu) Refresh ¶
func (m *TreeMenu) Refresh()
Refresh the menu with the latest discovered things and directories
func (*TreeMenu) SelectThing ¶
Select the Thing in the tree view
func (*TreeMenu) SetHandler ¶
type TuiApp ¶
type TuiApp struct {
tview.Application
// contains filtered or unexported fields
}
The main application view with panels for header, menu main view and footer - header shows the current status - menu shows quick actions for discovery and viewing TDs - main shows details - footer shows last action
func (*TuiApp) SelectTD ¶
Select a TD in the menu. This is called by the ThingList to select a thing in the menu which in turn updates the TD view.
func (*TuiApp) ShowDirectories ¶
func (tui *TuiApp) ShowDirectories()
func (*TuiApp) StartDiscovery ¶
func (tui *TuiApp) StartDiscovery()
Start a discovery and refresh the header and main view.
type TuiTable ¶
A simple table with boilerplate code for adding titles and data rows.
func NewTuiTable ¶
func (*TuiTable) SetDataCell ¶
Add row data to the table, and return the increased column number Row should start at 1, as row 0 is for the titles
func (*TuiTable) SetDataRow ¶
Add a data row to the table Row should start at 1, as row 0 is for the titles
func (*TuiTable) SetTitleRow ¶
Add the column titles to the table These use the titleColor and are not selectable