Documentation
¶
Index ¶
- Constants
- Variables
- type Action
- type ActionConfig
- type App
- type ChartCanvas
- type CommandMsg
- type Dashboard
- type Fetcher
- type HTTPServer
- type Instance
- type Operation
- type OperationHandler
- type ReplyMsg
- type Threshold
- type ThresholdLevel
- type Wel
- func (this *Wel) AddAllChartsToDashboard(dashboard *Dashboard)
- func (this *Wel) AddApp(app ...*App)
- func (this *Wel) AddChartCanvas(canvas *ChartCanvas)
- func (this *Wel) AddChartsToDashboard(dashboard *Dashboard, chartId ...string)
- func (this *Wel) AddDashboard(dashboard *Dashboard)
- func (this *Wel) AddOperation(operation ...*Operation)
- func (this *Wel) AddOption(option ...options.OptionInterface)
- func (this *Wel) AddThreshold(thresholdTemplate *Threshold)
- func (this *Wel) Fetch(options map[string]string) (result map[string]string, err error)
- func (this *Wel) FindChart(chartId string) *ChartCanvas
- func (this *Wel) FindOperation(code string) *Operation
- func (this *Wel) OnFetch(fetcher Fetcher)
- func (this *Wel) Run()
- func (this *Wel) RunCmd(cmd string, args []string, writer io.Writer) error
- func (this *Wel) ServeHTTP(address string) error
Constants ¶
View Source
const ( CanvasQuarter = 0.25 // 1/4 CanvasHalf = 0.5 // 1/2 CanvasFull = 1 // 1/1 )
View Source
const ( ThresholdLevelInfo = "info" ThresholdLevelWarn = "warn" ThresholdLevelError = "error" ThresholdLevelSuccess = "success" )
Variables ¶
View Source
var Root = ""
Functions ¶
This section is empty.
Types ¶
type ActionConfig ¶
type ActionConfig struct {
Action *Action `yaml:"action" json:"action"`
}
type App ¶
type App struct {
Id string `yaml:"id" json:"id"` // distributed by wel.teaos.cn
Name string `yaml:"name" json:"name"`
Description string `yaml:"description" json:"description"`
Developer string `yaml:"developer" json:"developer"`
Site string `yaml:"site" json:"site"`
Version string `yaml:"version" json:"version"`
DocumentSite string `yaml:"documentSite" json:"documentSite"`
SourceSite string `yaml:"sourceSite" json:"sourceSite"`
DownloadSite string `yaml:"downloadSite" json:"downloadSite"`
}
type ChartCanvas ¶
type ChartCanvas struct {
Id string `yaml:"id" json:"id"`
Name string `yaml:"name" json:"name"`
Type string `yaml:"type" json:"type"`
OptionsJSON string `yaml:"options" json:"options"`
Chart charts.ChartInterface `yaml:"chart" json:"chart"`
WidthPercent float32 `yaml:"widthPercent" json:"widthPercent"`
HeightPercent float32 `yaml:"heightPercent" json:"heightPercent"`
LeftMenu *charts.Menu `yaml:"leftMenu" json:"leftMenu"`
RightMenu *charts.Menu `yaml:"rightMenu" json:"rightMenu"`
}
chart canvas
func NewChartCanvas ¶
func NewChartCanvas(id string, name string, widthPercent float32, heightPercent float32) *ChartCanvas
func (*ChartCanvas) SetChart ¶
func (this *ChartCanvas) SetChart(chart charts.ChartInterface)
func (*ChartCanvas) SetParam ¶ added in v0.0.2
func (this *ChartCanvas) SetParam(param *charts.Param)
type Dashboard ¶
type Dashboard struct {
Id string `yaml:"id" json:"id"`
Version string `yaml:"version" json:"version"`
Name string `yaml:"name" json:"name"`
Charts []*ChartCanvas `yaml:"charts" json:"charts"`
}
func NewDashboard ¶
func NewDefaultDashboard ¶
func (*Dashboard) AddChart ¶
func (this *Dashboard) AddChart(canvas *ChartCanvas)
func (*Dashboard) FindChart ¶ added in v0.0.2
func (this *Dashboard) FindChart(canvasId string) *ChartCanvas
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
func NewHTTPServer ¶
func NewHTTPServer(wel *Wel, address string) *HTTPServer
func (*HTTPServer) Start ¶
func (this *HTTPServer) Start() error
type Instance ¶
type Instance struct {
Id string `yaml:"id" json:"id"`
Name string `yaml:"name" json:"name"`
Options map[string]string `yaml:"options" json:"options"`
Interval int `yaml:"interval" json:"interval"` // seconds
Operations []*Operation `yaml:"operations" json:"operations"`
Thresholds []*Threshold `yaml:"thresholds" json:"thresholds"`
Dashboards []*Dashboard `yaml:"dashboards" json:"dashboards"`
Charts []*ChartCanvas `yaml:"charts" json:"charts"`
}
wel instance
func LoadInstanceFromPath ¶
load instance from file
func (*Instance) FindDashboard ¶
type Operation ¶
type Operation struct {
Code string `yaml:"code" json:"code"`
Name string `yaml:"name" json:"name"`
Description string `yaml:"description" json:"description"`
// contains filtered or unexported fields
}
func NewOperation ¶
func NewOperation() *Operation
func (*Operation) Handler ¶
func (this *Operation) Handler() OperationHandler
func (*Operation) OnRun ¶
func (this *Operation) OnRun(handler OperationHandler)
type OperationHandler ¶
type Threshold ¶
type Threshold struct {
Expr string `yaml:"expr" json:"expr"`
Level ThresholdLevel `yaml:"level" json:"level"`
Actions []*ActionConfig `yaml:"actions" json:"actions"`
}
func NewThreshold ¶
func NewThreshold() *Threshold
type ThresholdLevel ¶
type ThresholdLevel = string
type Wel ¶
type Wel struct {
Id string `yaml:"id" json:"id"`
Name string `yaml:"name" json:"name"`
Description string `yaml:"description" json:"description"`
Developer string `yaml:"developer" json:"developer"`
Version string `yaml:"version" json:"version"`
Site string `yaml:"site" json:"site"`
Options []options.OptionInterface `yaml:"options" json:"options"`
Apps []*App `yaml:"apps" json:"apps"`
Operations []*Operation `yaml:"operations" json:"operations"`
ThresholdTemplates []*Threshold `yaml:"thresholdTemplates" json:"thresholdTemplates"`
DashboardTemplates []*Dashboard `yaml:"dashboardTemplates" json:"dashboardTemplates"`
ChartTemplates []*ChartCanvas `yaml:"chartTemplates" json:"chartTemplates"`
// contains filtered or unexported fields
}
func (*Wel) AddAllChartsToDashboard ¶ added in v0.0.2
func (*Wel) AddChartCanvas ¶ added in v0.0.2
func (this *Wel) AddChartCanvas(canvas *ChartCanvas)
func (*Wel) AddChartsToDashboard ¶
func (*Wel) AddDashboard ¶
func (*Wel) AddOperation ¶
func (*Wel) AddOption ¶
func (this *Wel) AddOption(option ...options.OptionInterface)
func (*Wel) AddThreshold ¶
func (*Wel) FindChart ¶
func (this *Wel) FindChart(chartId string) *ChartCanvas
func (*Wel) FindOperation ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.