Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager discovers and manages widget sub-processes.
func NewManager ¶
NewManager creates a manager, scans widgetsDir, and starts the idle reaper.
func (*Manager) Close ¶
func (m *Manager) Close()
Close stops all widget processes and the idle reaper.
func (*Manager) LoadErrors ¶
LoadErrors returns errors from the last scan.
func (*Manager) Proxy ¶
Proxy forwards r to the widget identified by mount. The path in r must already have the /widgets/<mount> prefix stripped.
func (*Manager) Status ¶
func (m *Manager) Status() []WidgetStatus
Status returns current status for all loaded widgets.
type Manifest ¶
type Manifest struct {
Title string `yaml:"title"`
Command []string `yaml:"command"`
Mount string `yaml:"mount"`
Description string `yaml:"description"`
// Set by ScanDir, not from YAML.
ID string
Dir string
}
Manifest is the parsed contents of a widget.yaml file.
func ScanDir ¶
ScanDir scans widgetsDir for widget.yaml manifests. Directories without widget.yaml are silently skipped. Returns valid manifests (sorted by directory name) and any per-widget errors. A missing widgetsDir is treated as no widgets (no error).
func (*Manifest) PlaceholderMode ¶
PlaceholderMode returns "socket" or "port" based on which placeholder appears in Command. Returns an error if both or neither are present.
type WidgetStatus ¶
type WidgetStatus struct {
ID string `json:"id"`
Mount string `json:"mount"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
State string `json:"state"`
Error string `json:"error,omitempty"`
Port int `json:"port,omitempty"`
}
WidgetStatus describes the current state of a widget.