Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildColumnFuncMap ¶
BuildColumnFuncMap returns template functions for column templates. These functions are safe for use in column value extraction.
Types ¶
type Config ¶
type Config struct {
Name string `yaml:"name" json:"name" mapstructure:"name"` // Display header
Value string `yaml:"value" json:"value" mapstructure:"value"` // Go template string
Width int `yaml:"width" json:"width" mapstructure:"width"` // Optional width override
}
Config defines a column with name, Go template for value extraction, and optional width.
type Selector ¶
type Selector struct {
// contains filtered or unexported fields
}
Selector manages column extraction with template evaluation. Templates are evaluated during Extract(), not at config load time.
func NewSelector ¶
NewSelector creates a selector with Go template support. Templates are pre-parsed for performance but NOT evaluated until Extract(). FuncMap should include functions like atmos.Component, toString, get, etc.
func (*Selector) Extract ¶
Extract evaluates templates against data and returns table rows. ⚠️ CRITICAL: This is where Go template evaluation happens (NOT at config load). Each row is processed with its full data as template context.
type TemplateContext ¶
type TemplateContext struct {
// Standard fields available in all templates
AtmosComponent string `json:"atmos_component"`
AtmosStack string `json:"atmos_stack"`
AtmosComponentType string `json:"atmos_component_type"`
// Component configuration
Vars map[string]any `json:"vars"`
Settings map[string]any `json:"settings"`
Metadata map[string]any `json:"metadata"`
Env map[string]any `json:"env"`
// Flags
Enabled bool `json:"enabled"`
Locked bool `json:"locked"`
Abstract bool `json:"abstract"`
// Full raw data for advanced templates
Raw map[string]any `json:"raw"`
}
TemplateContext provides data available to column templates during evaluation.