gui

package
v0.0.0-...-374fa93 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InputPanel int = iota + 1
	ProcessesPanel
	ProcessInfoPanel
	ProcessEnvPanel
	ProcessTreePanel
	ProcessFilePanel
)

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(key string, defaultValue string) string

Types

type Gui

type Gui struct {
	FilterInput     *tview.InputField
	ProcessManager  *ProcessManager
	ProcessInfoView *ProcessInfoView
	ProcessTreeView *ProcessTreeView
	ProcessEnvView  *ProcessEnvView
	ProcessFileView *ProcessFileView
	NaviView        *NaviView
	App             *tview.Application
	Pages           *tview.Pages
	Panels
}

func New

func New(word string) *Gui

func (*Gui) CloseAndSwitchPanel

func (g *Gui) CloseAndSwitchPanel(removePrimitive string, primitive tview.Primitive)

func (*Gui) Confirm

func (g *Gui) Confirm(message, doneLabel string, primitive tview.Primitive, doneFunc func())

func (*Gui) CurrentPanelKind

func (g *Gui) CurrentPanelKind() int

func (*Gui) FilterInputKeybinds

func (g *Gui) FilterInputKeybinds()

func (*Gui) GrobalKeybind

func (g *Gui) GrobalKeybind(event *tcell.EventKey)

func (*Gui) Modal

func (g *Gui) Modal(p tview.Primitive, width, height int) tview.Primitive

func (*Gui) ProcessEnvViewKeybinds

func (g *Gui) ProcessEnvViewKeybinds()

func (*Gui) ProcessFileViewKeybinds

func (g *Gui) ProcessFileViewKeybinds()

func (*Gui) ProcessInfoViewKeybinds

func (g *Gui) ProcessInfoViewKeybinds()

func (*Gui) ProcessManagerKeybinds

func (g *Gui) ProcessManagerKeybinds()

func (*Gui) ProcessTreeViewKeybinds

func (g *Gui) ProcessTreeViewKeybinds()

func (*Gui) Run

func (g *Gui) Run() error

func (*Gui) SetKeybinds

func (g *Gui) SetKeybinds()

func (*Gui) SwitchPanel

func (g *Gui) SwitchPanel(p tview.Primitive) *tview.Application

func (*Gui) UpdateViews

func (g *Gui) UpdateViews()
type NaviView struct {
	*tview.TextView
}

func NewNaviView

func NewNaviView() *NaviView
func (n *NaviView) UpdateView(g *Gui)

type Panels

type Panels struct {
	Current int
	Panels  []tview.Primitive
	Kinds   []int
}

type Process

type Process struct {
	Pid   int
	PPid  int
	Cmd   string
	Child []Process
}

type ProcessEnvView

type ProcessEnvView struct {
	*tview.TextView
}

func NewProcessEnvView

func NewProcessEnvView() *ProcessEnvView

func (*ProcessEnvView) UpdateView

func (p *ProcessEnvView) UpdateView(g *Gui)

func (*ProcessEnvView) UpdateViewWithPid

func (p *ProcessEnvView) UpdateViewWithPid(g *Gui, pid int)

type ProcessFileView

type ProcessFileView struct {
	*tview.TextView
}

func NewProcessFileView

func NewProcessFileView() *ProcessFileView

func (*ProcessFileView) UpdateView

func (p *ProcessFileView) UpdateView(g *Gui)

func (*ProcessFileView) UpdateViewWithPid

func (p *ProcessFileView) UpdateViewWithPid(g *Gui, pid int)

type ProcessInfoView

type ProcessInfoView struct {
	*tview.TextView
}

func NewProcessInfoView

func NewProcessInfoView() *ProcessInfoView

func (*ProcessInfoView) UpdateInfo

func (p *ProcessInfoView) UpdateInfo(g *Gui)

func (*ProcessInfoView) UpdateInfoWithPid

func (p *ProcessInfoView) UpdateInfoWithPid(g *Gui, pid int)

type ProcessManager

type ProcessManager struct {
	*tview.Table

	FilterWord string
	// contains filtered or unexported fields
}

func NewProcessManager

func NewProcessManager() *ProcessManager

func (*ProcessManager) Env

func (p *ProcessManager) Env(pid int) (string, error)

func (*ProcessManager) GetProcesses

func (p *ProcessManager) GetProcesses() (map[int]Process, error)

func (*ProcessManager) Info

func (p *ProcessManager) Info(pid int) (string, error)

func (*ProcessManager) Kill

func (p *ProcessManager) Kill() error

func (*ProcessManager) KillWithPid

func (p *ProcessManager) KillWithPid(pid int) error

func (*ProcessManager) OpenFiles

func (p *ProcessManager) OpenFiles(pid int) (string, error)

func (*ProcessManager) Selected

func (p *ProcessManager) Selected() *Process

func (*ProcessManager) UpdateView

func (p *ProcessManager) UpdateView() error

type ProcessTreeView

type ProcessTreeView struct {
	*tview.TreeView
}

func NewProcessTreeView

func NewProcessTreeView(pm *ProcessManager) *ProcessTreeView

func (*ProcessTreeView) ExpandToggle

func (p *ProcessTreeView) ExpandToggle(pm *ProcessManager, node *tview.TreeNode, isExpand bool)

func (*ProcessTreeView) UpdateTree

func (p *ProcessTreeView) UpdateTree(g *Gui)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL