Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultTemplate = `` /* 1418-byte string literal not displayed */
DefaultTemplate is the built-in journal entry prompt
Variables ¶
This section is empty.
Functions ¶
func RenderDefault ¶
RenderDefault renders the default template with the given context
Types ¶
type Context ¶
type Context struct {
Persona string
Timestamp time.Time
Uptime string
CPUPercent float64
MemoryPercent float64
MemoryUsedGB float64
MemoryTotalGB float64
DiskPercent float64
DiskUsedGB float64
DiskTotalGB float64
// Optional metrics (check with HasX methods in templates)
LoadAverage1 *float64
LoadAverage5 *float64
LoadAverage15 *float64
SwapPercent *float64
SwapUsedGB *float64
SwapTotalGB *float64
ProcessCount *int
NetworkSentGB *float64
NetworkRecvGB *float64
BatteryPct *float64
BatteryChg *bool
}
Context holds all the data available to a prompt template
func NewContext ¶
NewContext creates a prompt context from a persona description and metrics snapshot
func (*Context) HasBattery ¶ added in v0.0.3
HasBattery returns true if battery data is available
func (*Context) HasLoadAverage ¶ added in v0.0.3
HasLoadAverage returns true if load average data is available
func (*Context) HasNetwork ¶ added in v0.0.3
HasNetwork returns true if network I/O data is available
func (*Context) HasProcessCount ¶ added in v0.0.3
HasProcessCount returns true if process count is available
Click to show internal directories.
Click to hide internal directories.