widgets

package
v0.0.0-...-ee1c57c Latest Latest
Warning

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

Go to latest
Published: May 16, 2018 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UP   = "▲"
	DOWN = "▼"
)
View Source
const KEYBINDS = `` /* 379-byte string literal not displayed */

Variables

This section is empty.

Functions

func FieldsToStrings

func FieldsToStrings(P []Process, grouped bool) [][]string

FieldsToStrings converts a []Process to a [][]string

Types

type CPU

type CPU struct {
	*ui.LineGraph
	Count int // number of cores
	// contains filtered or unexported fields
}

func NewCPU

func NewCPU(interval time.Duration, zoom int) *CPU

type Disk

type Disk struct {
	*ui.Gauge
	// contains filtered or unexported fields
}

func NewDisk

func NewDisk() *Disk

type HelpMenu

type HelpMenu struct {
	*ui.Block
}

func NewHelpMenu

func NewHelpMenu() *HelpMenu

func (*HelpMenu) Buffer

func (self *HelpMenu) Buffer() *ui.Buffer

type Mem

type Mem struct {
	*ui.LineGraph
	// contains filtered or unexported fields
}

func NewMem

func NewMem(interval time.Duration, zoom int) *Mem

type Net

type Net struct {
	*ui.Sparklines
	// contains filtered or unexported fields
}

func NewNet

func NewNet() *Net

type Proc

type Proc struct {
	*ui.Table

	KeyPressed       chan bool
	DefaultColWidths []int
	// contains filtered or unexported fields
}

func NewProc

func NewProc(keyPressed chan bool) *Proc

func (*Proc) ColResize

func (self *Proc) ColResize()

ColResize overrides the default ColResize in the termui table.

func (*Proc) Kill

func (self *Proc) Kill()

Kill kills process or group of processes.

func (*Proc) Sort

func (self *Proc) Sort()

Sort sorts either the grouped or ungrouped []Process based on the sortMethod. Called with every update, when the sort method is changed, and when processes are grouped and ungrouped.

type Process

type Process struct {
	PID     int
	Command string
	CPU     float64
	Mem     float64
	Args    string
}

Process represents each process.

func Group

func Group(P []Process) []Process

Group groupes a []Process based on command name. The first field changes from PID to count. CPU and Mem are added together for each Process.

func Processes

func Processes() []Process

type ProcessByCPU

type ProcessByCPU []Process

func (ProcessByCPU) Len

func (P ProcessByCPU) Len() int

Len implements Sort interface

func (ProcessByCPU) Less

func (P ProcessByCPU) Less(i, j int) bool

Less implements Sort interface

func (ProcessByCPU) Swap

func (P ProcessByCPU) Swap(i, j int)

Swap implements Sort interface

type ProcessByMem

type ProcessByMem []Process

func (ProcessByMem) Len

func (P ProcessByMem) Len() int

Len implements Sort interface

func (ProcessByMem) Less

func (P ProcessByMem) Less(i, j int) bool

Less implements Sort interface

func (ProcessByMem) Swap

func (P ProcessByMem) Swap(i, j int)

Swap implements Sort interface

type ProcessByPID

type ProcessByPID []Process

func (ProcessByPID) Len

func (P ProcessByPID) Len() int

Len implements Sort interface

func (ProcessByPID) Less

func (P ProcessByPID) Less(i, j int) bool

Less implements Sort interface

func (ProcessByPID) Swap

func (P ProcessByPID) Swap(i, j int)

Swap implements Sort interface

type Temp

type Temp struct {
	*ui.Block

	Data      map[string]int
	Threshold int
	TempLow   ui.Color
	TempHigh  ui.Color
	// contains filtered or unexported fields
}

func NewTemp

func NewTemp() *Temp

func (*Temp) Buffer

func (self *Temp) Buffer() *ui.Buffer

Buffer implements ui.Bufferer interface and renders the widget.

Jump to

Keyboard shortcuts

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