uptime

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: LGPL-2.1 Imports: 7 Imported by: 0

Documentation

Overview

Package uptime provides UptimeView — a simple "up since" display showing days/hours/minutes/seconds elapsed from a fixed start time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UptimeView

type UptimeView struct {
	views.Base

	Start time.Time
	Color uint16
}

UptimeView paints "Dd HH:MM:SS" and refreshes every second.

func New

func New(bounds geom.Rect) *UptimeView

New constructs an UptimeView starting now.

func (*UptimeView) Draw

func (u *UptimeView) Draw()

Draw paints the elapsed duration.

func (*UptimeView) GetTypeID

func (u *UptimeView) GetTypeID() string

GetTypeID for serial registry.

func (*UptimeView) SetStart

func (u *UptimeView) SetStart(t time.Time)

SetStart resets the reference time.

func (*UptimeView) Tick

func (u *UptimeView) Tick(now time.Time) bool

Tick triggers a redraw every second.

Jump to

Keyboard shortcuts

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