ui

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PanelBorderWidth = 2
	PanelPaddingX    = 2
	PanelExtraWidth  = PanelBorderWidth + 2*PanelPaddingX // 6
	HorizontalMargin = 4
	GapRow           = ""
)

Variables

This section is empty.

Functions

func FormatBps

func FormatBps(bps float64, unit UnitMode) string

func FormatBpsExt added in v0.1.3

func FormatBpsExt(bps float64, unit UnitMode, bits bool) string

func FormatBpsFixedWidth added in v0.1.3

func FormatBpsFixedWidth(bps float64, unit UnitMode, bits bool) string

func TitleRow

func TitleRow(pulse float64) string

Types

type DisplayFilter added in v0.2.1

type DisplayFilter int
const (
	DisplayBoth DisplayFilter = iota
	DisplayDownOnly
	DisplayUpOnly
)

type KeyMap

type KeyMap struct {
	Quit          key.Binding
	Esc           key.Binding
	Reset         key.Binding
	Interface     key.Binding
	InterfaceInfo key.Binding
	Unit          key.Binding
	Pause         key.Binding
	Help          key.Binding
	Mode          key.Binding
	Processes     key.Binding
	Bits          key.Binding
	Display       key.Binding
	Faster        key.Binding
	Slower        key.Binding
	Themes        key.Binding
	History       key.Binding
}

func DefaultKeyMap

func DefaultKeyMap() KeyMap

type Model

type Model struct {
	// contains filtered or unexported fields
}

func New

func New(
	cfg config.Config,
	smp *sampler.Sampler,
	ifaces []string,
	initialIface string,
	cancelFn context.CancelFunc,
	forced ViewMode,
) Model

func (Model) Err added in v0.1.1

func (m Model) Err() error

func (Model) FormatBps

func (m Model) FormatBps(bps float64) string

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type UnitMode

type UnitMode int
const (
	UnitAuto UnitMode = iota
	UnitKB
	UnitMB
	UnitGB
)

type ViewMode

type ViewMode int
const (
	ViewHero ViewMode = iota
	ViewCompact
	ViewMini
	ViewTiny
)

Jump to

Keyboard shortcuts

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