Documentation
¶
Index ¶
- Constants
- Variables
- func InitConfig(cfg string)
- type AMRespAlert
- type AcceptObj
- type AlarmEndpointObj
- type AlarmEndpointQuery
- type AlarmProblemQuery
- type AlarmTable
- type AlterManagerRespObj
- type ButtonModel
- type Chart
- type ChartConfigObj
- type ChartModel
- type ChartTable
- type CustomDashboardTable
- type Dashboard
- type DashboardTable
- type DataSort
- type DataSourceConfig
- type DatasourceServers
- type DependenceConfig
- type EChartOption
- type EndpointMetricTable
- type EndpointTable
- type GlobalConfig
- type GrpEndpointParam
- type GrpEndpointParamNew
- type GrpEndpointTable
- type GrpQuery
- type GrpTable
- type HttpConfig
- type LdapConfig
- type LogConfig
- type LogMonitorDto
- type LogMonitorStrategyDto
- type LogMonitorTable
- type MaintainDto
- type MaintainTable
- type MessageModel
- type MessageTable
- type OptionModel
- type PanelModel
- type PanelTable
- type PanelTag
- type PanelsModel
- type PromMetricTable
- type PrometheusConfig
- type PrometheusData
- type PrometheusParam
- type PrometheusResponse
- type PrometheusResult
- type QueryMonitorData
- type RFAnnotation
- type RFGroup
- type RFRule
- type RegisterConsulCheck
- type RegisterConsulParam
- type RegisterParam
- type RuleFile
- type SearchModel
- type SerialModel
- type Session
- type StoreConfig
- type StrategyTable
- type TableData
- type TagsModel
- type TeamTable
- type TeamUpdateDto
- type TeamUserDto
- type TeamUserQuery
- type TplObj
- type TplQuery
- type TplStrategyLogMonitorTable
- type TplStrategyTable
- type TplTable
- type UpdateGrp
- type UpdateLogMonitor
- type UpdateStrategy
- type User
- type UserInfo
- type UserTable
- type YaxisModel
Constants ¶
View Source
const ( ServerToken = `default-token-used-in-server-side` DatetimeFormat = `2006-01-02 15:04:05` )
Variables ¶
View Source
var (
ConfigFile string
)
Functions ¶
func InitConfig ¶
func InitConfig(cfg string)
Types ¶
type AMRespAlert ¶
type AMRespAlert struct {
Status string `json:"status"`
Labels map[string]string `json:"labels"`
Annotations map[string]string `json:"annotations"`
StartsAt time.Time `json:"startsAt"`
EndsAt time.Time `json:"endsAt"`
GeneratorURL string `json:"generatorURL"`
Fingerprint string `json:"fingerprint"`
}
type AlarmEndpointObj ¶
type AlarmEndpointQuery ¶
type AlarmProblemQuery ¶
type AlarmProblemQuery struct {
Id int `json:"id"`
StrategyId int `json:"strategy_id"`
Endpoint string `json:"endpoint"`
Status string `json:"status"`
SMetric string `json:"s_metric"`
SExpr string `json:"s_expr"`
SCond string `json:"s_cond"`
SLast string `json:"s_last"`
SPriority string `json:"s_priority"`
Content string `json:"content"`
StartValue float64 `json:"start_value"`
Start time.Time `json:"start"`
StartString string `json:"start_string"`
End time.Time `json:"end"`
EndString string `json:"end_string"`
IsLogMonitor bool `json:"is_log_monitor"`
Path string `json:"path"`
Keyword string `json:"keyword"`
}
type AlarmTable ¶
type AlarmTable struct {
Id int `json:"id"`
StrategyId int `json:"strategy_id"`
Endpoint string `json:"endpoint"`
Status string `json:"status"`
SMetric string `json:"s_metric"`
SExpr string `json:"s_expr"`
SCond string `json:"s_cond"`
SLast string `json:"s_last"`
SPriority string `json:"s_priority"`
Content string `json:"content"`
StartValue float64 `json:"start_value"`
Start time.Time `json:"start"`
EndValue float64 `json:"end_value"`
End time.Time `json:"end"`
}
type AlterManagerRespObj ¶
type AlterManagerRespObj struct {
Receiver string `json:"receiver"`
Status string `json:"status"`
Alerts []AMRespAlert `json:"alerts"`
GroupLabels map[string]string `json:"groupLabels"`
CommonLabels map[string]string `json:"commonLabels"`
CommonAnnotations map[string]string `json:"commonAnnotations"`
ExternalURL string `json:"externalURL"`
Version string `json:"version"`
GroupKey string `json:"groupKey"`
}
type ButtonModel ¶
type ButtonModel struct {
Id int `json:"id"`
GroupId int `json:"group_id"`
Name string `json:"name"`
BType string `json:"b_type"`
BText string `json:"b_text"`
RefreshPanels bool `json:"refresh_panels"`
RefreshCharts bool `json:"refresh_charts"`
OptionGroup int `json:"option_group"`
RefreshButton int `json:"refresh_button"`
RefreshButtonUrl string `json:"refresh_button_url"`
Options []*OptionModel `json:"option"`
}
type Chart ¶
type Chart struct {
Endpoint []string `json:"endpoint"`
Metric []string `json:"metric"`
Option EChartOption `json:"option"`
}
type ChartConfigObj ¶
type ChartConfigObj struct {
Id int `form:"id" json:"id"`
Endpoint string `form:"endpoint" json:"endpoint"`
Metric string `form:"metric" json:"metric"`
PromQl string `form:"prom_ql" json:"prom_ql"`
Start string `form:"start" json:"start"`
End string `form:"end" json:"end"`
Time string `form:"time" json:"time"`
Aggregate string `form:"aggregate" json:"aggregate"`
}
type ChartModel ¶
type ChartTable ¶
type ChartTable struct {
Id int `json:"id"`
GroupId int `json:"group_id"`
Endpoint string `json:"endpoint"`
Metric string `json:"metric"`
Col int `json:"col"`
Url string `json:"url"`
Unit string `json:"unit"`
Title string `json:"title"`
GridType string `json:"grid_type"`
SeriesName string `json:"series_name"`
Rate bool `json:"rate"`
AggType string `json:"agg_type"`
Legend string `json:"legend"`
}
type CustomDashboardTable ¶
type CustomDashboardTable struct {
Id int `json:"id"`
Name string `json:"name"`
PanelsGroup int `json:"panels_group"`
Cfg string `json:"cfg"`
Main int `json:"main"`
CreateUser string `json:"create_user"`
UpdateUser string `json:"update_user"`
CreateAt time.Time `json:"create_at"`
UpdateAt time.Time `json:"update_at"`
}
type Dashboard ¶
type Dashboard struct {
Search SearchModel `json:"search"`
Buttons []*ButtonModel `json:"buttons"`
Message MessageModel `json:"message"`
Panels PanelsModel `json:"panels"`
}
type DashboardTable ¶
type DashboardTable struct {
Id int `json:"id"`
DashboardType string `json:"dashboard_type"`
SearchEnable bool `json:"search_enable"`
SearchId int `json:"search_id"`
ButtonEnable bool `json:"button_enable"`
ButtonGroup int `json:"button_group"`
MessageEnable bool `json:"message_enable"`
MessageGroup int `json:"message_group"`
MessageUrl string `json:"message_url"`
PanelsEnable bool `json:"panels_enable"`
PanelsType string `json:"panels_type"`
PanelsGroup int `json:"panels_group"`
PanelsParam string `json:"panels_param"`
}
type DataSourceConfig ¶
type DataSourceConfig struct {
Env string `json:"env"`
Servers []*DatasourceServers `json:"servers"`
DivideTime int64 `json:"divide_time"`
WaitTime int `json:"wait_time"`
}
type DatasourceServers ¶
type DependenceConfig ¶
type EChartOption ¶
type EChartOption struct {
Id int `json:"id"`
Title string `json:"title"`
Legend []string `json:"legend"`
Xaxis interface{} `json:"xaxis"`
Yaxis YaxisModel `json:"yaxis"`
Series []*SerialModel `json:"series"`
}
type EndpointMetricTable ¶
type EndpointTable ¶
type EndpointTable struct {
Id int `json:"id"`
Guid string `json:"guid"`
Name string `json:"name"`
Ip string `json:"ip"`
EndpointVersion string `json:"endpoint_version"`
ExportType string `json:"export_type"`
ExportVersion string `json:"export_version"`
Step int `json:"step"`
Address string `json:"address"`
OsType string `json:"os_type"`
CreateAt string `json:"create_at"`
}
type GlobalConfig ¶
type GlobalConfig struct {
Http *HttpConfig `json:"http"`
Store []*StoreConfig `json:"store"`
Datasource DataSourceConfig `json:"datasource"`
LimitIp []string `json:"limitIp"`
Dependence []*DependenceConfig `json:"dependence"`
Prometheus PrometheusConfig `json:"prometheus"`
TagBlacklist []string `json:"tag_blacklist"`
}
func Config ¶
func Config() *GlobalConfig
type GrpEndpointParam ¶
type GrpEndpointParamNew ¶
type GrpEndpointTable ¶
type HttpConfig ¶
type LdapConfig ¶
type LogMonitorDto ¶
type LogMonitorStrategyDto ¶
type LogMonitorTable ¶
type MaintainDto ¶
type MaintainTable ¶
type MessageModel ¶
type MessageTable ¶
type OptionModel ¶
type PanelModel ¶
type PanelModel struct {
Title string `json:"title"`
Tags TagsModel `json:"tags"`
Other bool `json:"other"`
Charts []*ChartModel `json:"charts"`
}
type PanelTable ¶
type PanelsModel ¶
type PromMetricTable ¶
type PrometheusConfig ¶
type PrometheusData ¶
type PrometheusData struct {
Result []PrometheusResult `json:"result"`
ResultType string `json:"resultType"`
}
type PrometheusParam ¶
type PrometheusResponse ¶
type PrometheusResponse struct {
Status string `json:"status"`
Data PrometheusData `json:"data"`
}
type PrometheusResult ¶
type QueryMonitorData ¶
type RFAnnotation ¶
type RegisterConsulCheck ¶
type RegisterConsulParam ¶
type RegisterParam ¶
type SearchModel ¶
type SerialModel ¶
type StoreConfig ¶
type StoreConfig struct {
Name string `json:"name"`
Type string `json:"type"`
Server string `json:"server"`
Port int `json:"port"`
User string `json:"user"`
Pwd string `json:"pwd"`
DataBase string `json:"database"`
MaxOpen int `json:"maxOpen"`
MaxIdle int `json:"maxIdle"`
Timeout int `json:"timeout"`
}
type StrategyTable ¶
type StrategyTable struct {
Id int `json:"id"`
TplId int `json:"tpl_id"`
Metric string `json:"metric" binding:"required"`
Expr string `json:"expr" binding:"required"`
Cond string `json:"cond" binding:"required"`
Last string `json:"last" binding:"required"`
Priority string `json:"priority" binding:"required"`
Content string `json:"content" binding:"required"`
ConfigType string `json:"config_type"`
}
type TagsModel ¶
type TagsModel struct {
Enable bool `json:"enable"`
Url string `json:"url"`
Option []*OptionModel `json:"option"`
}
type TeamUpdateDto ¶
type TeamUserDto ¶
type TeamUserQuery ¶
type TplObj ¶
type TplObj struct {
TplId int `json:"tpl_id"`
ObjId int `json:"obj_id"`
ObjName string `json:"obj_name"`
ObjType string `json:"obj_type"`
Operation bool `json:"operation"`
Accept AcceptObj `json:"accept"`
Strategy []*StrategyTable `json:"strategy"`
LogMonitor []*LogMonitorDto `json:"log_monitor"`
}
type TplStrategyLogMonitorTable ¶
type TplStrategyLogMonitorTable struct {
TplId int `json:"tpl_id"`
GrpId int `json:"grp_id"`
LogMonitorId int `json:"log_monitor_id"`
EndpointId int `json:"endpoint_id"`
StrategyId int `json:"strategy_id"`
Expr string `json:"expr" binding:"required"`
Cond string `json:"cond" binding:"required"`
Last string `json:"last"`
Priority string `json:"priority" binding:"required"`
Path string `json:"path"`
Keyword string `json:"keyword"`
}
type TplStrategyTable ¶
type TplStrategyTable struct {
TplId int `json:"tpl_id"`
GrpId int `json:"grp_id"`
EndpointId int `json:"endpoint_id"`
StrategyId int `json:"strategy_id"`
Metric string `json:"metric" binding:"required"`
Expr string `json:"expr" binding:"required"`
Cond string `json:"cond" binding:"required"`
Last string `json:"last" binding:"required"`
Priority string `json:"priority" binding:"required"`
Content string `json:"content" binding:"required"`
}
type UpdateLogMonitor ¶
type UpdateLogMonitor struct {
LogMonitor []*LogMonitorTable
Operation string
OperateUser string
}
type UpdateStrategy ¶
type UpdateStrategy struct {
Strategy []*StrategyTable
Operation string
OperateUser string
}
type YaxisModel ¶
type YaxisModel struct {
Unit string `json:"unit"`
}
Click to show internal directories.
Click to hide internal directories.