Documentation
¶
Overview ¶
Package activity provides last-activity tracking and color-coding for the dashboard.
Index ¶
Constants ¶
View Source
const ( ColorGreen = "green" // Active: <2 minutes ColorYellow = "yellow" // Stale: 2-5 minutes ColorRed = "red" // Stuck: >5 minutes ColorUnknown = "unknown" // No activity data )
Color class constants for activity status.
View Source
const ( ThresholdActive = 2 * time.Minute // Green threshold ThresholdStale = 5 * time.Minute // Yellow threshold (beyond this is red) )
Thresholds for activity color coding.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Info ¶
type Info struct {
LastActivity time.Time // Raw timestamp of last activity
Duration time.Duration // Time since last activity
FormattedAge string // Human-readable age (e.g., "2m", "1h")
ColorClass string // CSS class for coloring (green, yellow, red, unknown)
}
Info holds activity information for display.
func Calculate ¶
Calculate computes activity info from a last-activity timestamp. Returns color-coded info based on thresholds:
- Green: <2 minutes (active)
- Yellow: 2-5 minutes (stale)
- Red: >5 minutes (stuck)
- Unknown: zero time value
func (Info) IsActive ¶
IsActive returns true if the activity is within the active threshold (green).
Click to show internal directories.
Click to hide internal directories.