Documentation
¶
Index ¶
- Constants
- type AppFooter
- type AppHeader
- type DirectoriesPage
- type DiscoPage
- type TDPage
- type ThingsPage
- type TreeMenu
- type TuiApp
- func (tui *TuiApp) NextPage()
- func (tui *TuiApp) Run()
- func (tui *TuiApp) SelectTD(thingID string)
- func (tui *TuiApp) ShowDirectories()
- func (tui *TuiApp) ShowDiscovery(recs []*discovery.DiscoveryResult)
- func (tui *TuiApp) ShowTD(thingID string)
- func (tui *TuiApp) ShowThings()
- func (tui *TuiApp) StartDiscovery()
- type TuiTable
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 (*AppFooter) SetHandler ¶
type DirectoriesPage ¶
type DirectoriesPage struct {
TuiTable
// contains filtered or unexported fields
}
Show the loaded directories in the main view
func NewDirectoriesPage ¶
func NewDirectoriesPage() *DirectoriesPage
Return a new page with a table of known directory 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(dirList []*td.TD)
Show the loaded directories in the main view
func (*DirectoriesPage) SetHandler ¶
func (footer *DirectoriesPage) SetHandler(h func(ev ...string))
type DiscoPage ¶
Page with discovery records
func (*DiscoPage) Refresh ¶
func (v *DiscoPage) Refresh(records []*discovery.DiscoveryResult)
Show the discovered records in the main view records can be nil for initial display.
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 (*TDPage) SetHandler ¶
type ThingsPage ¶
Show the loaded things in the main view this rotates through different tabl
func NewThingsPage ¶
func NewThingsPage() *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(tdList []*td.TD)
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() *TreeMenu
func (*TreeMenu) HandleSelection ¶
func (*TreeMenu) SelectThing ¶
Select the Thing in the tree view
func (*TreeMenu) SetHandler ¶
type TuiApp ¶
type TuiApp struct {
tview.Application
*consumer.Consumer // for linking
// 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) ShowDiscovery ¶
func (tui *TuiApp) ShowDiscovery(recs []*discovery.DiscoveryResult)
Show the discovery records if recs is empty then start a discovery
func (*TuiApp) StartDiscovery ¶
func (tui *TuiApp) StartDiscovery()
Start a discovery and refresh the header and main view. If a directory is found, set the TDD for the directory service.
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