Documentation ¶
Overview ¶
Package shared keeps shared domains.
Index ¶
Constants ¶
View Source
const ( TabsBarHeight = 3 HelpBarHeight = 2 FullScreen = -1 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Clickable ¶
type Clickable interface { GetCoords() Coords SetCoords(c Coords) SetCallback(callback func() error) OnClick() error }
Clickable is a ui component that can be clicked.
type ClickableComponent ¶
type ClickableComponent int
ClickableComponent represents a logical component that help to identify on which component area clicked.
const ( TabHeader ClickableComponent = iota SnapshotsButtonsBar SnapshotsList VolumesBar ScheduleBar )
Available components.
type ClickableItem ¶
type ClickableItem struct {
// contains filtered or unexported fields
}
func (*ClickableItem) GetCoords ¶
func (ci *ClickableItem) GetCoords() Coords
func (*ClickableItem) OnClick ¶
func (ci *ClickableItem) OnClick() error
func (*ClickableItem) SetCallback ¶
func (ci *ClickableItem) SetCallback(callback func() error)
func (*ClickableItem) SetCoords ¶
func (ci *ClickableItem) SetCoords(c Coords)
type KeyMap ¶
type KeyMap struct { Tab key.Binding ShiftTab key.Binding Up key.Binding Down key.Binding PrevPage key.Binding NextPage key.Binding Create key.Binding Restore key.Binding Delete key.Binding Volume key.Binding Help key.Binding HelpShort key.Binding Quit key.Binding }
func (KeyMap) SettingsHelp ¶
func (KeyMap) SnapshotsHelp ¶
type State ¶
type State struct { ScreenHeight int ScreenWidth int CurrentTab TabItem ClickableElements map[ClickableComponent][]Clickable Config *config.Config Areas *uiAreas UpdateSnapshots bool }
State is the state of the ui application.
func (*State) AppendClickable ¶
func (s *State) AppendClickable(comp ClickableComponent, cc ...Clickable) error
func (*State) CleanClickable ¶
func (s *State) CleanClickable(comp ClickableComponent)
func (*State) FindClickable ¶
func (*State) GetActiveVolumesIDs ¶
func (*State) ResizeAreas ¶
func (s *State) ResizeAreas()
type TabItem ¶
type TabItem int
TabItem is kind of identifier for tabs. It differs from `elements/tab` which is responsible for look and style, and which is data agnostic. TabItem, on the contrary, represents a concrete tab with a concrete title and related with a specific content.
const ( SnapshotsTab TabItem = iota SettingsTab AnyTab // used for elements that don't belong to any tab. As example, tabs themselves. )
TabItem tabs.
func GetTabItems ¶
func GetTabItems() []TabItem
GetTabItems returns the list of all available (visually) tabs.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
elements
|
|
alert
Package alert keeps helpers to create a standard alert window.
|
Package alert keeps helpers to create a standard alert window. |
dialog
Package dialog keeps helpers to create a standard dialog window.
|
Package dialog keeps helpers to create a standard dialog window. |
divider
Package divider keeps helpers to draw dividers.
|
Package divider keeps helpers to draw dividers. |
tab
Package tab keeps helpers to create tabs.
|
Package tab keeps helpers to create tabs. |
Package styles keeps default styles.
|
Package styles keeps default styles. |
Click to show internal directories.
Click to hide internal directories.