ramview

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: LGPL-2.1 Imports: 8 Imported by: 0

Documentation

Overview

Package ramview provides RAMView — a memory-utilization bar with used / free / total annotations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RAMView

type RAMView struct {
	views.Base

	Sample   Sampler
	Interval time.Duration

	BarColor   uint16
	BackColor  uint16
	LabelColor uint16
	// contains filtered or unexported fields
}

RAMView paints "RAM 4.2 / 16.0 GiB ████████░░".

func New

func New(bounds geom.Rect, sampler Sampler, interval time.Duration) *RAMView

New constructs a RAMView.

func (*RAMView) Draw

func (r *RAMView) Draw()

Draw paints label + bar.

func (*RAMView) GetTypeID

func (r *RAMView) GetTypeID() string

GetTypeID for serial registry.

func (*RAMView) Tick

func (r *RAMView) Tick(now time.Time) bool

Tick polls.

type Sampler

type Sampler func() Stats

Sampler returns current Stats.

type Stats

type Stats struct {
	Used, Total uint64
}

Stats reports memory usage in bytes.

Jump to

Keyboard shortcuts

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