Documentation ¶
Index ¶
- type AlertMetrics
- type AlertMetricsRepo
- type AlertObjectArr
- type AlertRecords
- type AlertRecordsRepo
- type AlertRules
- type AlertRulesRepo
- type AlertSilences
- type AlertSilencesRepo
- type AlertUsers
- type AlertUsersGroup
- type AlertUsersGroupRepo
- type AlertUsersRepo
- type BaseModel
- type RuleMetricRelation
- type RuleMetricRelationRepo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertMetrics ¶
type AlertMetrics struct { BaseModel Name string `json:"name"` Type string `json:"type"` Expression string `json:"expression"` Unit string `json:"unit"` Operator string `json:"operator"` OperatorArr []string `json:"operatorArr" gorm:"-"` Description string `json:"description"` CreateTime int64 `json:"createTime"` UpdateTime int64 `json:"updateTime"` }
func (*AlertMetrics) BeforeCreate ¶
func (a *AlertMetrics) BeforeCreate(tx *gorm.DB) error
func (*AlertMetrics) BeforeSave ¶
func (a *AlertMetrics) BeforeSave(tx *gorm.DB) error
type AlertMetricsRepo ¶
type AlertMetricsRepo interface { GetAll(db *gorm.DB) ([]*AlertMetrics, error) FindById(db *gorm.DB, id string) (*AlertMetrics, error) Create(db *gorm.DB, alertMetric *AlertMetrics) error Delete(db *gorm.DB, alertMetricId string) error Page(db *gorm.DB, page *page.ReqPage) (*page.RespPage, error) Update(db *gorm.DB, alertMetric *AlertMetrics) error Deletes(db *gorm.DB, ids []string) error }
type AlertObjectArr ¶
type AlertRecords ¶
type AlertRecords struct { BaseModel AlertName string `json:"alertName"` RuleName string `json:"ruleName"` RuleId string `json:"ruleId"` Severity string `json:"severity"` Summary string `json:"summary"` Value string `json:"value"` Attribute string `json:"attribute"` CreateTime int64 `json:"createTime"` UpdateTime int64 `json:"updateTime"` }
func (*AlertRecords) BeforeCreate ¶
func (a *AlertRecords) BeforeCreate(tx *gorm.DB) error
func (*AlertRecords) BeforeSave ¶
func (a *AlertRecords) BeforeSave(tx *gorm.DB) error
type AlertRecordsRepo ¶
type AlertRules ¶
type AlertRules struct { BaseModel Name string `json:"name"` AlertObject string `json:"alertObject"` //AlertObjectArr map[string]string `json:"alertObjectArr" gorm:"-"` AlertObjectArr []*AlertObjectArr `json:"alertObjectArr" gorm:"-"` RulesArr []*RuleMetricRelation `json:"rulesArr" gorm:"-"` RulesStatus int `json:"rulesStatus"` Severity string `json:"severity"` Webhook string `json:"webhook"` AlertSilencesId string `json:"alertSilencesId"` Persistent string `json:"persistent"` AlertInterval string `json:"alertInterval"` StoreInterval string `json:"storeInterval"` UserGroupIds string `json:"userGroupIds"` UserGroupIdsArr []string `json:"userGroupIdsArr" gorm:"-"` Description string `json:"description"` CreateTime int64 `json:"createTime"` UpdateTime int64 `json:"updateTime"` }
func (*AlertRules) BeforeCreate ¶
func (a *AlertRules) BeforeCreate(tx *gorm.DB) error
func (*AlertRules) BeforeSave ¶
func (a *AlertRules) BeforeSave(tx *gorm.DB) error
type AlertRulesRepo ¶
type AlertRulesRepo interface { GetAll(db *gorm.DB) ([]*AlertRules, error) FindById(db *gorm.DB, id string) (*AlertRules, error) FindEnableByIds(db *gorm.DB, ids []string) ([]*AlertRules, error) Create(db *gorm.DB, alertRule *AlertRules) error Delete(db *gorm.DB, alertRuleId string) error Deletes(db *gorm.DB, ids []string) error Update(db *gorm.DB, alertRule *AlertRules) error UpdateStatus(db *gorm.DB, alertRule *AlertRules) error Page(db *gorm.DB, page *page.ReqPage) (*page.RespPage, error) }
type AlertSilences ¶
type AlertSilences struct { BaseModel Name string `json:"name"` Type string `json:"type"` StartTime int64 `json:"startTime"` EndTime int64 `json:"endTime"` Description string `json:"description"` CreateTime int64 `json:"createTime"` UpdateTime int64 `json:"updateTime"` }
func (*AlertSilences) BeforeCreate ¶
func (a *AlertSilences) BeforeCreate(tx *gorm.DB) error
func (*AlertSilences) BeforeSave ¶
func (a *AlertSilences) BeforeSave(tx *gorm.DB) error
type AlertSilencesRepo ¶
type AlertUsers ¶
type AlertUsers struct { BaseModel Name string `json:"name"` Department string `json:"department"` Email string `json:"email"` Phone string `json:"phone"` CreateTime int64 `json:"createTime"` UpdateTime int64 `json:"updateTime"` }
func (*AlertUsers) BeforeCreate ¶
func (a *AlertUsers) BeforeCreate(tx *gorm.DB) error
func (*AlertUsers) BeforeSave ¶
func (a *AlertUsers) BeforeSave(tx *gorm.DB) error
type AlertUsersGroup ¶
type AlertUsersGroup struct { BaseModel Name string `json:"name"` Description string `json:"description"` UserIds string `json:"userIds"` UserIdsDetail []*AlertUsers `json:"userIdsDetail" gorm:"-"` CreateTime int64 `json:"createTime"` UpdateTime int64 `json:"updateTime"` }
func (*AlertUsersGroup) BeforeCreate ¶
func (a *AlertUsersGroup) BeforeCreate(tx *gorm.DB) error
func (*AlertUsersGroup) BeforeSave ¶
func (a *AlertUsersGroup) BeforeSave(tx *gorm.DB) error
type AlertUsersGroupRepo ¶
type AlertUsersGroupRepo interface { Create(db *gorm.DB, userGroup *AlertUsersGroup) error Update(db *gorm.DB, userGroup *AlertUsersGroup) error Page(db *gorm.DB, page *page.ReqPage) (*page.RespPage, error) FindByIds(db *gorm.DB, ids []string) ([]*AlertUsersGroup, error) Deletes(db *gorm.DB, ids []string) error All(db *gorm.DB) ([]*AlertUsersGroup, error) }
type AlertUsersRepo ¶
type AlertUsersRepo interface { Create(db *gorm.DB, user *AlertUsers) error Deletes(db *gorm.DB, ids []string) error Update(db *gorm.DB, alertUser *AlertUsers) error Page(db *gorm.DB, page *page.ReqPage) (*page.RespPage, error) All(db *gorm.DB) ([]*AlertUsers, error) GetUserByIds(db *gorm.DB, ids []string) ([]*AlertUsers, error) }
type RuleMetricRelation ¶
type RuleMetricRelationRepo ¶
type RuleMetricRelationRepo interface { GetRuleMetricByRuleId(db *gorm.DB, ruleId string) ([]*RuleMetricRelation, error) GetCountByMetricID(db *gorm.DB, metricId string) (int64, error) Batches(db *gorm.DB, relations []*RuleMetricRelation) error Update(db *gorm.DB, relation *RuleMetricRelation) error DeleteByRuleId(db *gorm.DB, ruleId string) error DeleteByRuleIds(db *gorm.DB, ids []string) error FindRuleIdsByMetricId(db *gorm.DB, metricId string) (*[]string, error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.