Documentation ¶
Index ¶
- Constants
- type Alert
- type AlertDB
- func (db *AlertDB) CountByScopeAndScopeID(scope, scopeID string) (int, error)
- func (db *AlertDB) DeleteByID(id uint64) error
- func (db *AlertDB) GetByID(id uint64) (*Alert, error)
- func (db *AlertDB) GetByScopeAndScopeIDAndName(scope, scopeID, name string) (*Alert, error)
- func (db *AlertDB) Insert(alert *Alert) error
- func (db *AlertDB) QueryByScopeAndScopeID(scope, scopeID string, pageNo, pageSize uint64) ([]*Alert, error)
- func (db *AlertDB) Update(alert *Alert) error
- func (db *AlertDB) UpdateEnable(id uint64, enable bool) error
- type AlertExpression
- type AlertExpressionDB
- func (db *AlertExpressionDB) DeleteByAlertID(alertID uint64) error
- func (db *AlertExpressionDB) DeleteByIDs(ids []uint64) error
- func (db *AlertExpressionDB) Insert(expression *AlertExpression) error
- func (db *AlertExpressionDB) QueryByAlertIDs(alertIDs []uint64) ([]*AlertExpression, error)
- func (db *AlertExpressionDB) QueryByIDs(ids []uint64) ([]*AlertExpression, error)
- func (db *AlertExpressionDB) Update(expression *AlertExpression) error
- func (db *AlertExpressionDB) UpdateEnableByAlertID(alertID uint64, enable bool) error
- type AlertNotify
- type AlertNotifyDB
- func (db *AlertNotifyDB) DeleteByAlertID(alertID uint64) error
- func (db *AlertNotifyDB) DeleteByIDs(ids []uint64) error
- func (db *AlertNotifyDB) Insert(notify *AlertNotify) error
- func (db *AlertNotifyDB) QueryByAlertIDs(alertIDs []uint64) ([]*AlertNotify, error)
- func (db *AlertNotifyDB) Update(notify *AlertNotify) error
- func (db *AlertNotifyDB) UpdateEnableByAlertID(alertID uint64, enable bool) error
- type AlertNotifyTemplate
- type AlertNotifyTemplateDB
- type AlertRecord
- type AlertRecordDB
- func (db *AlertRecordDB) CountByCondition(scope, scopeKey string, ...) (int, error)
- func (db *AlertRecordDB) GetByGroupID(groupID string) (*AlertRecord, error)
- func (db *AlertRecordDB) QueryByCondition(scope, scopeKey string, ...) ([]*AlertRecord, error)
- func (db *AlertRecordDB) UpdateHandle(groupID string, issueID uint64, handlerID string, handleState string) error
- type AlertRule
- type AlertRuleDB
- func (db *AlertRuleDB) DistinctAlertTypeByScope(scope string) ([]string, error)
- func (db *AlertRuleDB) QueryByIndexes(indexes []string) ([]*AlertRule, error)
- func (db *AlertRuleDB) QueryEnabledByScope(scope string) ([]*AlertRule, error)
- func (db *AlertRuleDB) QueryEnabledByScopeAndIndices(scope string, indices []string) ([]*AlertRule, error)
- type CustomizeAlert
- type CustomizeAlertDB
- func (db *CustomizeAlertDB) CountByScopeAndScopeID(scope, scopeID string) (int, error)
- func (db *CustomizeAlertDB) DeleteByID(id uint64) error
- func (db *CustomizeAlertDB) GetByID(id uint64) (*CustomizeAlert, error)
- func (db *CustomizeAlertDB) GetByScopeAndScopeIDAndName(scope, scopeID, name string) (*CustomizeAlert, error)
- func (db *CustomizeAlertDB) Insert(alert *CustomizeAlert) error
- func (db *CustomizeAlertDB) QueryByScopeAndScopeID(scope, scopeID string, pageNo, pageSize int) ([]*CustomizeAlert, error)
- func (db *CustomizeAlertDB) Update(alert *CustomizeAlert) error
- func (db *CustomizeAlertDB) UpdateEnable(id uint64, enable bool) error
- type CustomizeAlertNotifyTemplate
- type CustomizeAlertNotifyTemplateDB
- func (db *CustomizeAlertNotifyTemplateDB) DeleteByAlertID(alertID uint64) error
- func (db *CustomizeAlertNotifyTemplateDB) DeleteByIDs(ids []uint64) error
- func (db *CustomizeAlertNotifyTemplateDB) Insert(notify *CustomizeAlertNotifyTemplate) error
- func (db *CustomizeAlertNotifyTemplateDB) QueryByAlertIDs(alertIDs []uint64) ([]*CustomizeAlertNotifyTemplate, error)
- func (db *CustomizeAlertNotifyTemplateDB) QueryEnabledByTypesAndIndexes(types, indexes []string) ([]*CustomizeAlertNotifyTemplate, error)
- func (db *CustomizeAlertNotifyTemplateDB) Update(notify *CustomizeAlertNotifyTemplate) error
- func (db *CustomizeAlertNotifyTemplateDB) UpdateEnableByAlertID(alertID uint64, enable bool) error
- type CustomizeAlertRule
- type CustomizeAlertRuleDB
- func (db *CustomizeAlertRuleDB) DeleteByAlertID(alertID uint64) error
- func (db *CustomizeAlertRuleDB) DeleteByIDs(ids []uint64) error
- func (db *CustomizeAlertRuleDB) Insert(rule *CustomizeAlertRule) error
- func (db *CustomizeAlertRuleDB) QueryByAlertIDs(alertIDs []uint64) ([]*CustomizeAlertRule, error)
- func (db *CustomizeAlertRuleDB) QueryEnabledByScope(scope, scopeID string) ([]*CustomizeAlertRule, error)
- func (db *CustomizeAlertRuleDB) QueryEnabledByScopeAndIndices(scope, scopeID string, indices []string) ([]*CustomizeAlertRule, error)
- func (db *CustomizeAlertRuleDB) Update(rule *CustomizeAlertRule) error
- func (db *CustomizeAlertRuleDB) UpdateEnableByAlertID(alertID uint64, enable bool) error
- type DB
Constants ¶
const ( TableAlertRecord = "sp_alert_record" TableCustomizeAlert = "sp_customize_alert" TableCustomizeAlertRule = "sp_customize_alert_rule" TableCustomizeAlertNotifyTemplate = "sp_customize_alert_notify_template" TableAlertRules = "sp_alert_rules" TableAlertNotify = "sp_alert_notify" TableAlertNotifyTemplate = "sp_alert_notify_template" TableAlertExpression = "sp_alert_expression" TableAlert = "sp_alert" )
tables name
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { ID uint64 `gorm:"column:id"` Name string `gorm:"column:name"` AlertScope string `gorm:"column:alert_scope"` AlertScopeID string `gorm:"column:alert_scope_id"` Attributes jsonmap.JSONMap `gorm:"column:attributes"` Enable bool `gorm:"column:enable"` Created time.Time `gorm:"column:created"` Updated time.Time `gorm:"column:updated"` }
Alert .
type AlertDB ¶
AlertDB .
func (*AlertDB) CountByScopeAndScopeID ¶
CountByScopeAndScopeID .
func (*AlertDB) GetByScopeAndScopeIDAndName ¶
GetByScopeAndScopeIDAndName .
type AlertExpression ¶
type AlertExpression struct { ID uint64 `gorm:"column:id"` AlertID uint64 `gorm:"column:alert_id"` Attributes jsonmap.JSONMap `gorm:"column:attributes"` Expression jsonmap.JSONMap `gorm:"column:expression"` Version string `gorm:"column:version"` Enable bool `gorm:"column:enable"` Created time.Time `gorm:"column:created"` Updated time.Time `gorm:"column:updated"` }
AlertExpression .
type AlertExpressionDB ¶
AlertExpressionDB .
func (*AlertExpressionDB) DeleteByAlertID ¶
func (db *AlertExpressionDB) DeleteByAlertID(alertID uint64) error
DeleteByAlertID .
func (*AlertExpressionDB) DeleteByIDs ¶
func (db *AlertExpressionDB) DeleteByIDs(ids []uint64) error
DeleteByIDs .
func (*AlertExpressionDB) Insert ¶
func (db *AlertExpressionDB) Insert(expression *AlertExpression) error
Insert .
func (*AlertExpressionDB) QueryByAlertIDs ¶
func (db *AlertExpressionDB) QueryByAlertIDs(alertIDs []uint64) ([]*AlertExpression, error)
QueryByAlertIDs .
func (*AlertExpressionDB) QueryByIDs ¶
func (db *AlertExpressionDB) QueryByIDs(ids []uint64) ([]*AlertExpression, error)
QueryByIDs .
func (*AlertExpressionDB) Update ¶
func (db *AlertExpressionDB) Update(expression *AlertExpression) error
Update .
func (*AlertExpressionDB) UpdateEnableByAlertID ¶
func (db *AlertExpressionDB) UpdateEnableByAlertID(alertID uint64, enable bool) error
UpdateEnableByAlertID .
type AlertNotify ¶
type AlertNotify struct { ID uint64 `gorm:"column:id"` AlertID uint64 `gorm:"column:alert_id"` NotifyKey string `gorm:"column:notify_key"` NotifyTarget jsonmap.JSONMap `gorm:"column:notify_target"` NotifyTargetID string `gorm:"column:notify_target_id"` Silence int64 `gorm:"column:silence"` SilencePolicy string `gorm:"column:silence_policy"` Enable bool `gorm:"column:enable"` Created time.Time `gorm:"column:created"` Updated time.Time `gorm:"column:updated"` }
AlertNotify .
type AlertNotifyDB ¶
AlertNotifyDB .
func (*AlertNotifyDB) DeleteByAlertID ¶
func (db *AlertNotifyDB) DeleteByAlertID(alertID uint64) error
DeleteByAlertID .
func (*AlertNotifyDB) DeleteByIDs ¶
func (db *AlertNotifyDB) DeleteByIDs(ids []uint64) error
DeleteByIDs .
func (*AlertNotifyDB) QueryByAlertIDs ¶
func (db *AlertNotifyDB) QueryByAlertIDs(alertIDs []uint64) ([]*AlertNotify, error)
QueryByAlertIDs .
func (*AlertNotifyDB) UpdateEnableByAlertID ¶
func (db *AlertNotifyDB) UpdateEnableByAlertID(alertID uint64, enable bool) error
UpdateEnableByAlertID .
type AlertNotifyTemplate ¶
type AlertNotifyTemplate struct { ID uint64 `gorm:"column:id"` Name string `gorm:"column:name"` AlertType string `gorm:"column:alert_type"` AlertIndex string `gorm:"column:alert_index"` Target string `gorm:"column:target"` Trigger string `gorm:"column:trigger"` Title string `gorm:"column:title"` Template string `gorm:"column:template"` Formats jsonmap.JSONMap `gorm:"column:formats"` Version string `gorm:"column:version"` Enable bool `gorm:"column:enable"` CreateTime time.Time `gorm:"column:create_time"` UpdateTime time.Time `gorm:"column:update_time"` }
AlertNotifyTemplate .
type AlertNotifyTemplateDB ¶
AlertNotifyTemplateDB .
func (*AlertNotifyTemplateDB) QueryEnabledByTypesAndIndexes ¶
func (db *AlertNotifyTemplateDB) QueryEnabledByTypesAndIndexes( types, indexes []string) ([]*AlertNotifyTemplate, error)
QueryEnabledByTypesAndIndexes .
type AlertRecord ¶
type AlertRecord struct { GroupID string `gorm:"column:group_id;primary_key"` Scope string `gorm:"column:scope"` ScopeKey string `gorm:"column:scope_key"` AlertGroup string `gorm:"column:alert_group"` Title string `gorm:"column:title"` AlertState string `gorm:"column:alert_state"` AlertType string `gorm:"column:alert_type"` AlertIndex string `gorm:"column:alert_index"` ExpressionKey string `gorm:"column:expression_key"` AlertID uint64 `gorm:"column:alert_id"` AlertName string `gorm:"column:alert_name"` RuleID uint64 `gorm:"column:rule_id"` IssueID uint64 `gorm:"column:issue_id"` HandleState string `gorm:"column:handle_state"` HandlerID string `gorm:"column:handler_id"` AlertTime time.Time `gorm:"column:alert_time"` HandleTime time.Time `gorm:"column:handle_time;default:null"` CreateTime time.Time `gorm:"column:create_time"` UpdateTime time.Time `gorm:"column:update_time"` }
type AlertRecordDB ¶
AlertRecordDB .
func (*AlertRecordDB) CountByCondition ¶
func (db *AlertRecordDB) CountByCondition(scope, scopeKey string, alertGroups, alertStates, alertTypes, handleStates, handlerIDs []string) (int, error)
CountByCondition .
func (*AlertRecordDB) GetByGroupID ¶
func (db *AlertRecordDB) GetByGroupID(groupID string) (*AlertRecord, error)
GetByGroupID .
func (*AlertRecordDB) QueryByCondition ¶
func (db *AlertRecordDB) QueryByCondition(scope, scopeKey string, alertGroups, alertStates, alertTypes, handleStates, handlerIDs []string, pageNo, pageSize uint) ( []*AlertRecord, error)
QueryByCondition .
func (*AlertRecordDB) UpdateHandle ¶
func (db *AlertRecordDB) UpdateHandle(groupID string, issueID uint64, handlerID string, handleState string) error
UpdateHandle .
type AlertRule ¶
type AlertRule struct { ID uint64 `gorm:"column:id"` Name string `gorm:"column:name"` AlertScope string `gorm:"column:alert_scope"` AlertType string `gorm:"column:alert_type"` AlertIndex string `gorm:"column:alert_index"` Template jsonmap.JSONMap `gorm:"column:template"` Attributes jsonmap.JSONMap `gorm:"column:attributes"` Version string `gorm:"column:version"` Enable bool `gorm:"column:enable"` CreateTime time.Time `gorm:"column:create_time"` UpdateTime time.Time `gorm:"column:update_time"` }
AlertRule .
type AlertRuleDB ¶
AlertRuleDB .
func (*AlertRuleDB) DistinctAlertTypeByScope ¶
func (db *AlertRuleDB) DistinctAlertTypeByScope(scope string) ([]string, error)
DistinctAlertTypeByScope .
func (*AlertRuleDB) QueryByIndexes ¶
func (db *AlertRuleDB) QueryByIndexes(indexes []string) ([]*AlertRule, error)
QueryByIndexes .
func (*AlertRuleDB) QueryEnabledByScope ¶
func (db *AlertRuleDB) QueryEnabledByScope(scope string) ([]*AlertRule, error)
QueryEnabledByScope .
func (*AlertRuleDB) QueryEnabledByScopeAndIndices ¶
func (db *AlertRuleDB) QueryEnabledByScopeAndIndices(scope string, indices []string) ([]*AlertRule, error)
QueryEnabledByScopeAndIndices .
type CustomizeAlert ¶
type CustomizeAlert struct { ID uint64 `gorm:"column:id"` Name string `gorm:"column:name"` AlertType string `gorm:"column:alert_type"` AlertScope string `gorm:"column:alert_scope"` AlertScopeID string `gorm:"column:alert_scope_id"` Attributes jsonmap.JSONMap `gorm:"column:attributes"` Enable bool `gorm:"column:enable"` CreateTime time.Time `gorm:"column:create_time"` UpdateTime time.Time `gorm:"column:update_time"` }
CustomizeAlert .
type CustomizeAlertDB ¶
CustomizeAlertDB .
func (*CustomizeAlertDB) CountByScopeAndScopeID ¶
func (db *CustomizeAlertDB) CountByScopeAndScopeID(scope, scopeID string) (int, error)
CountByScopeAndScopeID .
func (*CustomizeAlertDB) DeleteByID ¶
func (db *CustomizeAlertDB) DeleteByID(id uint64) error
DeleteByID .
func (*CustomizeAlertDB) GetByID ¶
func (db *CustomizeAlertDB) GetByID(id uint64) (*CustomizeAlert, error)
GetByID .
func (*CustomizeAlertDB) GetByScopeAndScopeIDAndName ¶
func (db *CustomizeAlertDB) GetByScopeAndScopeIDAndName(scope, scopeID, name string) (*CustomizeAlert, error)
GetByScopeAndScopeIDAndName .
func (*CustomizeAlertDB) Insert ¶
func (db *CustomizeAlertDB) Insert(alert *CustomizeAlert) error
Insert .
func (*CustomizeAlertDB) QueryByScopeAndScopeID ¶
func (db *CustomizeAlertDB) QueryByScopeAndScopeID(scope, scopeID string, pageNo, pageSize int) ([]*CustomizeAlert, error)
QueryByScopeAndScopeID .
func (*CustomizeAlertDB) Update ¶
func (db *CustomizeAlertDB) Update(alert *CustomizeAlert) error
Update .
func (*CustomizeAlertDB) UpdateEnable ¶
func (db *CustomizeAlertDB) UpdateEnable(id uint64, enable bool) error
UpdateEnable .
type CustomizeAlertNotifyTemplate ¶
type CustomizeAlertNotifyTemplate struct { ID uint64 `gorm:"column:id"` Name string `gorm:"column:name"` CustomizeAlertID uint64 `gorm:"column:customize_alert_id"` AlertType string `gorm:"column:alert_type"` AlertIndex string `gorm:"column:alert_index"` Target string `gorm:"column:target"` Trigger string `gorm:"column:trigger"` Title string `gorm:"column:title"` Template string `gorm:"column:template"` Formats jsonmap.JSONMap `gorm:"column:formats"` Version string `gorm:"column:version"` Enable bool `gorm:"column:Enable"` CreateTime time.Time `gorm:"column:create_time"` UpdateTime time.Time `gorm:"column:update_time"` }
CustomizeAlertNotifyTemplate .
func (CustomizeAlertNotifyTemplate) TableName ¶
func (CustomizeAlertNotifyTemplate) TableName() string
TableName .
type CustomizeAlertNotifyTemplateDB ¶
CustomizeAlertNotifyTemplateDB .
func (*CustomizeAlertNotifyTemplateDB) DeleteByAlertID ¶
func (db *CustomizeAlertNotifyTemplateDB) DeleteByAlertID(alertID uint64) error
DeleteByAlertID .
func (*CustomizeAlertNotifyTemplateDB) DeleteByIDs ¶
func (db *CustomizeAlertNotifyTemplateDB) DeleteByIDs(ids []uint64) error
DeleteByIDs .
func (*CustomizeAlertNotifyTemplateDB) Insert ¶
func (db *CustomizeAlertNotifyTemplateDB) Insert(notify *CustomizeAlertNotifyTemplate) error
Insert .
func (*CustomizeAlertNotifyTemplateDB) QueryByAlertIDs ¶
func (db *CustomizeAlertNotifyTemplateDB) QueryByAlertIDs(alertIDs []uint64) ([]*CustomizeAlertNotifyTemplate, error)
QueryByAlertIDs .
func (*CustomizeAlertNotifyTemplateDB) QueryEnabledByTypesAndIndexes ¶
func (db *CustomizeAlertNotifyTemplateDB) QueryEnabledByTypesAndIndexes( types, indexes []string) ([]*CustomizeAlertNotifyTemplate, error)
QueryEnabledByTypesAndIndexes .
func (*CustomizeAlertNotifyTemplateDB) Update ¶
func (db *CustomizeAlertNotifyTemplateDB) Update(notify *CustomizeAlertNotifyTemplate) error
Update .
func (*CustomizeAlertNotifyTemplateDB) UpdateEnableByAlertID ¶
func (db *CustomizeAlertNotifyTemplateDB) UpdateEnableByAlertID(alertID uint64, enable bool) error
UpdateEnableByAlertID .
type CustomizeAlertRule ¶
type CustomizeAlertRule struct { ID uint64 `gorm:"column:id"` Name string `gorm:"column:name"` CustomizeAlertID uint64 `gorm:"column:customize_alert_id"` AlertType string `gorm:"column:alert_type"` AlertIndex string `gorm:"column:alert_index"` AlertScope string `gorm:"column:alert_scope"` AlertScopeID string `gorm:"column:alert_scope_id"` Template jsonmap.JSONMap `gorm:"column:template"` Attributes jsonmap.JSONMap `gorm:"column:attributes"` Enable bool `gorm:"column:enable"` CreateTime time.Time `gorm:"column:create_time"` UpdateTime time.Time `gorm:"column:update_time"` }
CustomizeAlertRule .
type CustomizeAlertRuleDB ¶
CustomizeAlertRuleDB .
func (*CustomizeAlertRuleDB) DeleteByAlertID ¶
func (db *CustomizeAlertRuleDB) DeleteByAlertID(alertID uint64) error
DeleteByAlertID .
func (*CustomizeAlertRuleDB) DeleteByIDs ¶
func (db *CustomizeAlertRuleDB) DeleteByIDs(ids []uint64) error
DeleteByIDs .
func (*CustomizeAlertRuleDB) Insert ¶
func (db *CustomizeAlertRuleDB) Insert(rule *CustomizeAlertRule) error
Insert .
func (*CustomizeAlertRuleDB) QueryByAlertIDs ¶
func (db *CustomizeAlertRuleDB) QueryByAlertIDs(alertIDs []uint64) ([]*CustomizeAlertRule, error)
QueryByAlertIDs .
func (*CustomizeAlertRuleDB) QueryEnabledByScope ¶
func (db *CustomizeAlertRuleDB) QueryEnabledByScope(scope, scopeID string) ([]*CustomizeAlertRule, error)
QueryEnabledByScope .
func (*CustomizeAlertRuleDB) QueryEnabledByScopeAndIndices ¶
func (db *CustomizeAlertRuleDB) QueryEnabledByScopeAndIndices( scope, scopeID string, indices []string) ([]*CustomizeAlertRule, error)
QueryEnabledByScopeAndIndices .
func (*CustomizeAlertRuleDB) Update ¶
func (db *CustomizeAlertRuleDB) Update(rule *CustomizeAlertRule) error
Update .
func (*CustomizeAlertRuleDB) UpdateEnableByAlertID ¶
func (db *CustomizeAlertRuleDB) UpdateEnableByAlertID(alertID uint64, enable bool) error
UpdateEnableByAlertID .
type DB ¶
type DB struct { *gorm.DB CustomizeAlert CustomizeAlertDB CustomizeAlertRule CustomizeAlertRuleDB CustomizeAlertNotifyTemplate CustomizeAlertNotifyTemplateDB Alert AlertDB AlertExpression AlertExpressionDB AlertNotify AlertNotifyDB AlertNotifyTemplate AlertNotifyTemplateDB AlertRule AlertRuleDB AlertRecord AlertRecordDB }
DB .