Documentation ¶
Index ¶
- Variables
- func CursorDown(g *gocui.Gui, v *gocui.View) error
- func CursorUp(g *gocui.Gui, v *gocui.View) error
- func Render()
- func Run(layers []*image.Layer, refTrees []*filetree.FileTree, efficiency float64, ...)
- func Update()
- type CompareType
- type DetailsView
- func (view *DetailsView) CursorDown() error
- func (view *DetailsView) CursorUp() error
- func (view *DetailsView) IsVisible() bool
- func (view *DetailsView) KeyHelp() string
- func (view *DetailsView) Render() error
- func (view *DetailsView) Setup(v *gocui.View, header *gocui.View) error
- func (view *DetailsView) Update() error
- type FileTreeView
- func (view *FileTreeView) CursorDown() error
- func (view *FileTreeView) CursorLeft() error
- func (view *FileTreeView) CursorRight() error
- func (view *FileTreeView) CursorUp() error
- func (view *FileTreeView) IsVisible() bool
- func (view *FileTreeView) KeyHelp() string
- func (view *FileTreeView) PageDown() error
- func (view *FileTreeView) PageUp() error
- func (view *FileTreeView) Render() error
- func (view *FileTreeView) Setup(v *gocui.View, header *gocui.View) error
- func (view *FileTreeView) Update() error
- type FilterView
- func (view *FilterView) CursorDown() error
- func (view *FilterView) CursorUp() error
- func (view *FilterView) Edit(v *gocui.View, key gocui.Key, ch rune, mod gocui.Modifier)
- func (view *FilterView) IsVisible() bool
- func (view *FilterView) KeyHelp() string
- func (view *FilterView) Render() error
- func (view *FilterView) Setup(v *gocui.View, header *gocui.View) error
- func (view *FilterView) Update() error
- type Key
- type LayerView
- func (view *LayerView) CursorDown() error
- func (view *LayerView) CursorUp() error
- func (view *LayerView) IsVisible() bool
- func (view *LayerView) KeyHelp() string
- func (view *LayerView) Render() error
- func (view *LayerView) SetCursor(layer int) error
- func (view *LayerView) Setup(v *gocui.View, header *gocui.View) error
- func (view *LayerView) Update() error
- type StatusView
- func (view *StatusView) CursorDown() error
- func (view *StatusView) CursorUp() error
- func (view *StatusView) IsVisible() bool
- func (view *StatusView) KeyHelp() string
- func (view *StatusView) Render() error
- func (view *StatusView) Setup(v *gocui.View, header *gocui.View) error
- func (view *StatusView) Update() error
- type View
Constants ¶
This section is empty.
Variables ¶
var Formatting struct { Header func(...interface{}) string Selected func(...interface{}) string StatusSelected func(...interface{}) string StatusNormal func(...interface{}) string StatusControlSelected func(...interface{}) string StatusControlNormal func(...interface{}) string CompareTop func(...interface{}) string CompareBottom func(...interface{}) string }
Formatting defines standard functions for formatting UI sections.
var GlobalKeybindings struct { // contains filtered or unexported fields }
var Views struct { Tree *FileTreeView Layer *LayerView Status *StatusView Filter *FilterView Details *DetailsView // contains filtered or unexported fields }
Views contains all rendered UI panes.
Functions ¶
func CursorDown ¶
CursorDown moves the cursor down in the currently selected gocui pane, scrolling the screen as needed.
func CursorUp ¶
CursorUp moves the cursor up in the currently selected gocui pane, scrolling the screen as needed.
Types ¶
type DetailsView ¶
type DetailsView struct { Name string // contains filtered or unexported fields }
DetailsView holds the UI objects and data models for populating the lower-left pane. Specifically the pane that shows the layer details and image statistics.
func NewDetailsView ¶
func NewDetailsView(name string, gui *gocui.Gui, efficiency float64, inefficiencies filetree.EfficiencySlice) (detailsView *DetailsView)
NewDetailsView creates a new view object attached the the global gocui screen object.
func (*DetailsView) CursorDown ¶
func (view *DetailsView) CursorDown() error
CursorDown moves the cursor down in the details pane (currently indicates nothing).
func (*DetailsView) CursorUp ¶
func (view *DetailsView) CursorUp() error
CursorUp moves the cursor up in the details pane (currently indicates nothing).
func (*DetailsView) IsVisible ¶
func (view *DetailsView) IsVisible() bool
IsVisible indicates if the details view pane is currently initialized.
func (*DetailsView) KeyHelp ¶
func (view *DetailsView) KeyHelp() string
KeyHelp indicates all the possible actions a user can take while the current pane is selected (currently does nothing).
func (*DetailsView) Render ¶
func (view *DetailsView) Render() error
Render flushes the state objects to the screen. The details pane reports: 1. the current selected layer's command string 2. the image efficiency score 3. the estimated wasted image space 4. a list of inefficient file allocations
func (*DetailsView) Setup ¶
Setup initializes the UI concerns within the context of a global gocui view object.
func (*DetailsView) Update ¶
func (view *DetailsView) Update() error
Update refreshes the state objects for future rendering.
type FileTreeView ¶
type FileTreeView struct { Name string ModelTree *filetree.FileTree ViewTree *filetree.FileTree RefTrees []*filetree.FileTree HiddenDiffTypes []bool TreeIndex uint // contains filtered or unexported fields }
FileTreeView holds the UI objects and data models for populating the right pane. Specifically the pane that shows selected layer or aggregate file ASCII tree.
func NewFileTreeView ¶
func NewFileTreeView(name string, gui *gocui.Gui, tree *filetree.FileTree, refTrees []*filetree.FileTree) (treeView *FileTreeView)
NewFileTreeView creates a new view object attached the the global gocui screen object.
func (*FileTreeView) CursorDown ¶
func (view *FileTreeView) CursorDown() error
CursorDown moves the cursor down and renders the view. Note: we cannot use the gocui buffer since any state change requires writing the entire tree to the buffer. Instead we are keeping an upper and lower bounds of the tree string to render and only flushing this range into the view buffer. This is much faster when tree sizes are large.
func (*FileTreeView) CursorLeft ¶ added in v0.0.8
func (view *FileTreeView) CursorLeft() error
CursorLeft moves the cursor up until we reach the Parent Node or top of the tree
func (*FileTreeView) CursorRight ¶ added in v0.1.0
func (view *FileTreeView) CursorRight() error
CursorRight descends into directory expanding it if needed
func (*FileTreeView) CursorUp ¶
func (view *FileTreeView) CursorUp() error
CursorUp moves the cursor up and renders the view. Note: we cannot use the gocui buffer since any state change requires writing the entire tree to the buffer. Instead we are keeping an upper and lower bounds of the tree string to render and only flushing this range into the view buffer. This is much faster when tree sizes are large.
func (*FileTreeView) IsVisible ¶
func (view *FileTreeView) IsVisible() bool
IsVisible indicates if the file tree view pane is currently initialized
func (*FileTreeView) KeyHelp ¶
func (view *FileTreeView) KeyHelp() string
KeyHelp indicates all the possible actions a user can take while the current pane is selected.
func (*FileTreeView) PageDown ¶ added in v0.1.0
func (view *FileTreeView) PageDown() error
PageDown moves to next page putting the cursor on top
func (*FileTreeView) PageUp ¶ added in v0.1.0
func (view *FileTreeView) PageUp() error
PageUp moves to previous page putting the cursor on top
func (*FileTreeView) Render ¶
func (view *FileTreeView) Render() error
Render flushes the state objects (file tree) to the pane.
func (*FileTreeView) Setup ¶
Setup initializes the UI concerns within the context of a global gocui view object.
func (*FileTreeView) Update ¶
func (view *FileTreeView) Update() error
Update refreshes the state objects for future rendering.
type FilterView ¶
type FilterView struct { Name string // contains filtered or unexported fields }
DetailsView holds the UI objects and data models for populating the bottom row. Specifically the pane that allows the user to filter the file tree by path.
func NewFilterView ¶
func NewFilterView(name string, gui *gocui.Gui) (filterView *FilterView)
NewFilterView creates a new view object attached the the global gocui screen object.
func (*FilterView) CursorDown ¶
func (view *FilterView) CursorDown() error
CursorDown moves the cursor down in the filter pane (currently indicates nothing).
func (*FilterView) CursorUp ¶
func (view *FilterView) CursorUp() error
CursorUp moves the cursor up in the filter pane (currently indicates nothing).
func (*FilterView) Edit ¶
Edit intercepts the key press events in the filer view to update the file view in real time.
func (*FilterView) IsVisible ¶
func (view *FilterView) IsVisible() bool
IsVisible indicates if the filter view pane is currently initialized
func (*FilterView) KeyHelp ¶
func (view *FilterView) KeyHelp() string
KeyHelp indicates all the possible actions a user can take while the current pane is selected.
func (*FilterView) Render ¶
func (view *FilterView) Render() error
Render flushes the state objects to the screen. Currently this is the users path filter input.
func (*FilterView) Setup ¶
Setup initializes the UI concerns within the context of a global gocui view object.
func (*FilterView) Update ¶
func (view *FilterView) Update() error
Update refreshes the state objects for future rendering (currently does nothing).
type LayerView ¶
type LayerView struct { Name string LayerIndex int Layers []*image.Layer CompareMode CompareType CompareStartIndex int ImageSize uint64 // contains filtered or unexported fields }
LayerView holds the UI objects and data models for populating the lower-left pane. Specifically the pane that shows the image layers and layer selector.
func NewLayerView ¶
NewDetailsView creates a new view object attached the the global gocui screen object.
func (*LayerView) CursorDown ¶
CursorDown moves the cursor down in the layer pane (selecting a higher layer).
func (*LayerView) CursorUp ¶
CursorUp moves the cursor up in the layer pane (selecting a lower layer).
func (*LayerView) KeyHelp ¶
KeyHelp indicates all the possible actions a user can take while the current pane is selected.
func (*LayerView) Render ¶
Render flushes the state objects to the screen. The layers pane reports: 1. the layers of the image + metadata 2. the current selected image
func (*LayerView) SetCursor ¶
SetCursor resets the cursor and orients the file tree view based on the given layer index.
type StatusView ¶
type StatusView struct { Name string // contains filtered or unexported fields }
DetailsView holds the UI objects and data models for populating the bottom-most pane. Specifcially the panel shows the user a set of possible actions to take in the window and currently selected pane.
func NewStatusView ¶
func NewStatusView(name string, gui *gocui.Gui) (statusView *StatusView)
NewStatusView creates a new view object attached the the global gocui screen object.
func (*StatusView) CursorDown ¶
func (view *StatusView) CursorDown() error
CursorDown moves the cursor down in the details pane (currently indicates nothing).
func (*StatusView) CursorUp ¶
func (view *StatusView) CursorUp() error
CursorUp moves the cursor up in the details pane (currently indicates nothing).
func (*StatusView) IsVisible ¶
func (view *StatusView) IsVisible() bool
IsVisible indicates if the status view pane is currently initialized.
func (*StatusView) KeyHelp ¶
func (view *StatusView) KeyHelp() string
KeyHelp indicates all the possible global actions a user can take when any pane is selected.
func (*StatusView) Render ¶
func (view *StatusView) Render() error
Render flushes the state objects to the screen.
func (*StatusView) Setup ¶
Setup initializes the UI concerns within the context of a global gocui view object.
func (*StatusView) Update ¶
func (view *StatusView) Update() error
Update refreshes the state objects for future rendering (currently does nothing).