Documentation ¶
Index ¶
- Constants
- func GetGocuiAttribute(key string) gocui.Attribute
- func GetGocuiStyle(keys []string) gocui.Attribute
- type Binding
- type CreateMenuOptions
- type Gui
- func (gui *Gui) CurrentView() *gocui.View
- func (gui *Gui) FilterString(view *gocui.View) string
- func (gui *Gui) FocusY(selectedY int, lineCount int, v *gocui.View)
- func (gui *Gui) GetInitialKeybindings() []*Binding
- func (gui *Gui) GetMainView() *gocui.View
- func (gui *Gui) GetOptionsPanelTextColor() gocui.Attribute
- func (gui *Gui) HandleClick(v *gocui.View, itemCount int, selectedLine *int, handleSelect func() error) error
- func (gui *Gui) IgnoreStrings() []string
- func (gui *Gui) IsCurrentView(view *gocui.View) bool
- func (gui *Gui) Menu(opts CreateMenuOptions) error
- func (gui *Gui) NewRenderStringTask(opts RenderStringTaskOpts) tasks.TaskFunc
- func (gui *Gui) NewSimpleRenderStringTask(getContent func() string) tasks.TaskFunc
- func (gui *Gui) NewTask(opts TaskOpts) tasks.TaskFunc
- func (gui *Gui) NewTickerTask(opts TickerTaskOpts) tasks.TaskFunc
- func (gui *Gui) PauseContainer(container *commands.Container) error
- func (gui *Gui) QueueTask(f func(ctx context.Context)) error
- func (gui *Gui) RenderStringMain(s string)
- func (gui *Gui) ResetOrigin(v *gocui.View)
- func (gui *Gui) Run() error
- func (gui *Gui) SetColorScheme() error
- func (gui *Gui) SetupFakeGui()
- func (gui *Gui) ShouldRefresh(key string) bool
- func (gui *Gui) Update(f func() error)
- func (gui *Gui) WithWaitingStatus(name string, f func() error) error
- type Mutexes
- type Panels
- type RenderStringTaskOpts
- type TaskOpts
- type TickerTaskOpts
- type Views
- type WindowMaximisation
Constants ¶
const INFO_SECTION_PADDING = " "
const UNKNOWN_VIEW_ERROR_MSG = "unknown view"
Variables ¶
This section is empty.
Functions ¶
func GetGocuiAttribute ¶ added in v0.18.1
GetAttribute gets the gocui color attribute from the string
func GetGocuiStyle ¶ added in v0.18.1
GetGocuiStyle bitwise OR's a list of attributes obtained via the given keys
Types ¶
type Binding ¶
type Binding struct { ViewName string Handler func(*gocui.Gui, *gocui.View) error Key interface{} // FIXME: find out how to get `gocui.Key | rune` Modifier gocui.Modifier Description string }
Binding - a keybinding mapping a key and modifier to a handler. The keypress is only handled if the given view has focus, or handled globally if the view is ""
type CreateMenuOptions ¶ added in v0.20.0
type Gui ¶
type Gui struct { Log *logrus.Entry DockerCommand *commands.DockerCommand OSCommand *commands.OSCommand State guiState Config *config.AppConfig Tr *i18n.TranslationSet ErrorChan chan error Views Views // if we've suspended the gui (e.g. because we've switched to a subprocess) // we typically want to pause some things that are running like background // file refreshes PauseBackgroundThreads bool Mutexes Panels Panels // contains filtered or unexported fields }
Gui wraps the gocui Gui object which handles rendering and events
func NewGui ¶
func NewGui(log *logrus.Entry, dockerCommand *commands.DockerCommand, oSCommand *commands.OSCommand, tr *i18n.TranslationSet, config *config.AppConfig, errorChan chan error) (*Gui, error)
NewGui builds a new gui handler
func (*Gui) CurrentView ¶ added in v0.20.0
func (*Gui) GetInitialKeybindings ¶
GetInitialKeybindings is a function.
func (*Gui) GetMainView ¶ added in v0.20.0
func (*Gui) GetOptionsPanelTextColor ¶
GetOptionsPanelTextColor gets the color of the options panel text
func (*Gui) HandleClick ¶ added in v0.20.0
func (*Gui) IgnoreStrings ¶ added in v0.20.0
func (*Gui) Menu ¶ added in v0.20.0
func (gui *Gui) Menu(opts CreateMenuOptions) error
func (*Gui) NewRenderStringTask ¶ added in v0.20.0
func (gui *Gui) NewRenderStringTask(opts RenderStringTaskOpts) tasks.TaskFunc
func (*Gui) NewSimpleRenderStringTask ¶ added in v0.20.0
assumes it's cheap to obtain the content (otherwise we would pass a function that returns the content)
func (*Gui) NewTickerTask ¶ added in v0.20.0
func (gui *Gui) NewTickerTask(opts TickerTaskOpts) tasks.TaskFunc
NewTickerTask is a convenience function for making a new task that repeats some action once per e.g. second the before function gets called after the lock is obtained, but before the ticker starts. if you handle a message on the stop channel in f() you need to send a message on the notifyStopped channel because returning is not sufficient. Here, unlike in a regular task, simply returning means we're now going to wait till the next tick to run again.
func (*Gui) PauseContainer ¶ added in v0.19.0
func (*Gui) RenderStringMain ¶ added in v0.20.0
func (*Gui) ResetOrigin ¶ added in v0.20.0
func (*Gui) SetColorScheme ¶
SetColorScheme sets the color scheme for the app based on the user config
func (*Gui) SetupFakeGui ¶ added in v0.20.0
func (gui *Gui) SetupFakeGui()
this is used by our cheatsheet code to generate keybindings. We need some views and panels to exist for us to know what keybindings there are, so we invoke gocui in headless mode and create them.
func (*Gui) ShouldRefresh ¶ added in v0.20.0
type Mutexes ¶ added in v0.19.0
type Mutexes struct { SubprocessMutex deadlock.Mutex ViewStackMutex deadlock.Mutex }
type Panels ¶ added in v0.20.0
type Panels struct { Projects *panels.SideListPanel[*commands.Project] Services *panels.SideListPanel[*commands.Service] Containers *panels.SideListPanel[*commands.Container] Images *panels.SideListPanel[*commands.Image] Volumes *panels.SideListPanel[*commands.Volume] Networks *panels.SideListPanel[*commands.Network] Menu *panels.SideListPanel[*types.MenuItem] }
type RenderStringTaskOpts ¶ added in v0.20.0
type TickerTaskOpts ¶ added in v0.20.0
type Views ¶ added in v0.19.0
type Views struct { // side panels Project *gocui.View Services *gocui.View Containers *gocui.View Images *gocui.View Volumes *gocui.View Networks *gocui.View // main panel Main *gocui.View // bottom line Options *gocui.View Information *gocui.View AppStatus *gocui.View // text that prompts you to enter text in the Filter view FilterPrefix *gocui.View // appears next to the SearchPrefix view, it's where you type in the search string Filter *gocui.View // popups Confirmation *gocui.View Menu *gocui.View // will cover everything when it appears Limit *gocui.View }
type WindowMaximisation ¶ added in v0.19.0
type WindowMaximisation int
screen sizing determines how much space your selected window takes up (window as in panel, not your terminal's window). Sometimes you want a bit more space to see the contents of a panel, and this keeps track of how much maximisation you've set
const ( SCREEN_NORMAL WindowMaximisation = iota SCREEN_HALF SCREEN_FULL )
Source Files ¶
- app_status_manager.go
- arrangement.go
- confirmation_panel.go
- container_logs.go
- containers_panel.go
- custom_commands.go
- filtering.go
- focus.go
- gocui.go
- gui.go
- images_panel.go
- keybindings.go
- layout.go
- main_panel.go
- menu_panel.go
- networks_panel.go
- options_menu_panel.go
- panels.go
- project_panel.go
- services_panel.go
- subprocess.go
- tasks_adapter.go
- theme.go
- view_helpers.go
- views.go
- volumes_panel.go
- window.go