Documentation
¶
Index ¶
- Constants
- Variables
- func Output(r Resource) (string, error)
- func Validate(r Resource) error
- type AxisGraphPanelConfig
- type BoolStringConfig
- type BucketAggsTargetPanelConfig
- type Config
- type CustomPanelConfig
- type DashListPanelConfig
- type DataSourceBasicAuthConfig
- type DataSourceConfig
- type GraphPanelConfig
- type IntStringConfig
- type LegendGraphPanelConfig
- type MetricsTargetPanelConfig
- type Panel
- type PluginListPanelConfig
- type Resource
- type RowConfig
- type SeriesOverrideGraphPanelConfig
- type SingleStatPanelConfig
- type SortTablePanelConfig
- type TablePanelConfig
- type TargetPanelConfig
- type TextPanelConfig
- type TooltipConfig
Constants ¶
View Source
const ( DataSourceGraphite = "graphite" DataSourceInfluxDB = "influxdb" DataSourceInfluxDB08 = "influxdb_08" DataSourceElastic = "elasticsearch" DataSourceOpenTSDB = "opentsdb" DataSourceCloudWatch = "cloudwatch" DataSourceKairosDB = "kairosdb" DataSourcePrometheus = "prometheus" DataSourcePostgres = "postgres" DataSourceMySQL = "mysql" DataSourceAccessDirect = "direct" DataSourceAccessProxy = "proxy" )
Variables ¶
View Source
var ( ErrDataSourceNotFound = errors.New("Data source type not found") ErrDataSourceAccessInvalid = errors.New("Data source access invalid") )
Functions ¶
Types ¶
type AxisGraphPanelConfig ¶
type AxisGraphPanelConfig struct { Format string `hcl:"format"` LogBase int `hcl:"logBase"` Max IntStringConfig `hcl:"max"` Min IntStringConfig `hcl:"min"` Show bool `hcl:"show"` }
type BoolStringConfig ¶
type Config ¶
type Config struct { DataSources []DataSourceConfig `hcl:"data_source"` GraphPanels []GraphPanelConfig `hcl:"graph_panel"` }
func ParseConfig ¶
type CustomPanelConfig ¶
type CustomPanelConfig struct { }
type DashListPanelConfig ¶
type DashListPanelConfig struct { }
type DataSourceConfig ¶
type DataSourceConfig struct { Name string `hcl:",key"` Type string `hcl:"type"` Access string `hcl:"access"` URL string `hcl:"url"` Database string `hcl:"database"` User string `hcl:"user"` Password string `hcl:"password"` IsDefault bool `hcl:"is_default"` JSONData string `hcl:"json_data"` BasicAuth DataSourceBasicAuthConfig `hcl:"basic_auth"` }
func (*DataSourceConfig) GenerateJSON ¶
func (d *DataSourceConfig) GenerateJSON() ([]byte, error)
func (*DataSourceConfig) ValidateHCL ¶
func (d *DataSourceConfig) ValidateHCL() error
type GraphPanelConfig ¶
type GraphPanelConfig struct { Name string `hcl:",key"` AliasColors interface{} `hcl:"alias_colors"` Bars bool `hcl:"bars"` Fill int `hcl:"fill"` Legend LegendGraphPanelConfig `hcl:"legend"` LeftYAxisLabel string `hcl:"left_y_axis_label"` RightYAxisLabel string `hcl:"righty_axis_label"` Lines bool `hcl:"lines"` Linewidth uint `hcl:"line_width"` NullPointMode string `hcl:"null_point_mode"` Percentage bool `hcl:"percentage"` Pointradius int `hcl:"point_radius"` Points bool `hcl:"points"` SeriesOverrides []SeriesOverrideGraphPanelConfig `hcl:"series_overrides"` Stack bool `hcl:"stack"` SteppedLine bool `hcl:"stepped_line"` Targets []TargetPanelConfig `hcl:"targets"` TimeFrom string `hcl:"time_from"` TimeShift string `hcl:"time_shift"` Tooltip TooltipConfig `hcl:"tooltip"` XAxis bool `hcl:"x_axis"` YAxis bool `hcl:"y_axis"` YFormats []string `hcl:"y_formats"` Xaxes AxisGraphPanelConfig `hcl:"x_axe"` Yaxes []AxisGraphPanelConfig `hcl:"y_axes"` Decimals int `hcl:"decimals"` }
func (*GraphPanelConfig) GenerateJSON ¶
func (g *GraphPanelConfig) GenerateJSON() ([]byte, error)
func (*GraphPanelConfig) ValidateHCL ¶
func (g *GraphPanelConfig) ValidateHCL() error
type IntStringConfig ¶
type LegendGraphPanelConfig ¶
type LegendGraphPanelConfig struct { AlignAsTable bool `hcl:"align_as_table"` Avg bool `hcl:"show_average"` Current bool `hcl:"show_current"` HideEmpty bool `hcl:"hide_empty"` HideZero bool `hcl:"hide_zero"` Max bool `hcl:"show_max"` Min bool `hcl:"show_min"` RightSide bool `hcl:"right_side"` Show bool `hcl:"show"` Total bool `hcl:"show_total"` Values bool `hcl:"values"` SideWidth int `hcl:"right_side_width"` }
type PluginListPanelConfig ¶
type PluginListPanelConfig struct { }
type RowConfig ¶
type RowConfig struct { Name string `hcl:",key"` Title string `hcl:"title"` ShowTitle bool `hcl:"show_title"` Collapse bool `hcl:"collapse"` Editable bool `hcl:"editable"` Height int `hcl:"height"` Panels []Panel `hcl:"panels"` }
func (*RowConfig) GenerateJSON ¶
func (*RowConfig) ValidateHCL ¶
type SeriesOverrideGraphPanelConfig ¶
type SeriesOverrideGraphPanelConfig struct { Alias string `hcl:"alias"` Bars bool `hcl:"bars"` Color string `hcl:"color"` Fill int `hcl:"fill"` FillBelowTo string `hcl:"fill_below_to"` Legend bool `hcl:"legend"` Lines bool `hcl:"lines"` Stack BoolStringConfig `hcl:"stack"` Transform string `hcl:"transform"` YAxis int `hcl:"y_axis"` ZIndex int `hcl:"z_index"` NullPointMode string `hcl:"null_point_mode"` }
type SingleStatPanelConfig ¶
type SingleStatPanelConfig struct { }
type SortTablePanelConfig ¶
type TablePanelConfig ¶
type TablePanelConfig struct { Columns map[string]interface{} `hcl:"columns"` Sort SortTablePanelConfig `hcl:"sort"` Styles map[string]interface{} `hcl:"styles"` Transform string `hcl:"transform"` Targets []TargetPanelConfig `hcl:"targets"` Scroll bool `hcl:"scroll"` }
type TargetPanelConfig ¶
type TargetPanelConfig struct { Name string `hcl:", key"` Datasource string `hcl:"datasource"` Expr string `hcl:"expr"` IntervalFactor int `hcl:"interval_factor"` Interval string `hcl:"interval"` Step int `hcl:"step"` LegendFormat string `hcl:"legend_format"` DsType string `hcl:"ds_type"` Metrics []MetricsTargetPanelConfig `hcl:"metrics"` Query string `hcl:"query"` Alias string `hcl:"alias"` RawQuery bool `hcl:"raw_query"` TimeField string `hcl:"time_field"` BucketAggs []BucketAggsTargetPanelConfig `hcl:"bucket_aggs"` Target string `hcl:"target"` }
type TextPanelConfig ¶
type TextPanelConfig struct { }
type TooltipConfig ¶
Click to show internal directories.
Click to hide internal directories.