Documentation ¶
Index ¶
- func LoadConfig() (*Config, Options)
- func Update(settings []ComponentSettings, options Options)
- type ActionsConfig
- type AsciiBoxConfig
- type BarChartConfig
- type ComponentConfig
- type ComponentSettings
- type ComponentType
- type Config
- type GaugeConfig
- type Item
- type LegendConfig
- type Location
- type Options
- type RunChartConfig
- type Size
- type SparkLineConfig
- type TextBoxConfig
- type TriggerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
func Update ¶
func Update(settings []ComponentSettings, options Options)
Types ¶
type ActionsConfig ¶
type AsciiBoxConfig ¶
type AsciiBoxConfig struct { ComponentConfig `yaml:",inline"` Item `yaml:",inline"` Border *bool `yaml:"border,omitempty"` Font *console.AsciiFont `yaml:"font,omitempty"` }
type BarChartConfig ¶
type BarChartConfig struct { ComponentConfig `yaml:",inline"` Scale *int `yaml:"scale,omitempty"` Items []Item `yaml:"items"` }
type ComponentConfig ¶
type ComponentConfig struct { Title string `yaml:"title"` Position [][]int `yaml:"position,flow"` RateMs *int `yaml:"rate-ms,omitempty"` Triggers []TriggerConfig `yaml:"triggers,omitempty"` Type ComponentType `yaml:",omitempty"` }
func (*ComponentConfig) GetLocation ¶
func (c *ComponentConfig) GetLocation() Location
func (*ComponentConfig) GetRectangle ¶
func (c *ComponentConfig) GetRectangle() image.Rectangle
func (*ComponentConfig) GetSize ¶
func (c *ComponentConfig) GetSize() Size
type ComponentSettings ¶
type ComponentSettings struct { Type ComponentType Title string Size Size Location Location }
type ComponentType ¶
type ComponentType rune
const ( TypeRunChart ComponentType = 0 TypeBarChart ComponentType = 1 TypeSparkLine ComponentType = 2 TypeTextBox ComponentType = 3 TypeAsciiBox ComponentType = 4 TypeGauge ComponentType = 5 )
type Config ¶
type Config struct { Theme *console.Theme `yaml:"theme,omitempty"` Variables map[string]string `yaml:"variables,omitempty"` RunCharts []RunChartConfig `yaml:"runcharts,omitempty"` BarCharts []BarChartConfig `yaml:"barcharts,omitempty"` Gauges []GaugeConfig `yaml:"gauges,omitempty"` SparkLines []SparkLineConfig `yaml:"sparklines,omitempty"` TextBoxes []TextBoxConfig `yaml:"textboxes,omitempty"` AsciiBoxes []AsciiBoxConfig `yaml:"asciiboxes,omitempty"` }
type GaugeConfig ¶
type Item ¶
type Item struct { Label *string `yaml:"label,omitempty"` Color *ui.Color `yaml:"color,omitempty"` Pty *bool `yaml:"pty,omitempty"` InitScript *string `yaml:"init,omitempty"` MultiStepInitScript *[]string `yaml:"multistep-init,omitempty"` SampleScript *string `yaml:"sample"` TransformScript *string `yaml:"transform,omitempty"` }
type LegendConfig ¶
type Options ¶
type Options struct { ConfigFile *string `short:"c" long:"config" description:"Path to YAML config file"` LicenseKey *string `short:"l" long:"license" description:"License key. Visit www.sampler.dev for details"` Environment []string `` /* 182-byte string literal not displayed */ Version bool `short:"v" long:"version" description:"Print version"` DisableTelemetry bool `` /* 134-byte string literal not displayed */ }
Options with cli flags
type RunChartConfig ¶
type RunChartConfig struct { ComponentConfig `yaml:",inline"` Legend *LegendConfig `yaml:"legend,omitempty"` Scale *int `yaml:"scale,omitempty"` Items []Item `yaml:"items"` }
type SparkLineConfig ¶
type SparkLineConfig struct { ComponentConfig `yaml:",inline"` Scale *int `yaml:"scale,omitempty"` Item Item `yaml:",inline"` Gradient *[]ui.Color `yaml:",omitempty"` }
type TextBoxConfig ¶
type TextBoxConfig struct { ComponentConfig `yaml:",inline"` Item `yaml:",inline"` Border *bool `yaml:"border,omitempty"` }
type TriggerConfig ¶
type TriggerConfig struct { Title string `yaml:"title"` Condition string `yaml:"condition"` Actions *ActionsConfig `yaml:"actions,omitempty"` }
Click to show internal directories.
Click to hide internal directories.