Documentation ¶
Index ¶
- func Models() []any
- type AlarmHistory
- type AlarmRaw
- type AlarmSendHistory
- type HistoryDetails
- type RealtimeAlarm
- func (c *RealtimeAlarm) GetRawInfo() *AlarmRaw
- func (c *RealtimeAlarm) GetRealtimeDetails() *RealtimeDetails
- func (c *RealtimeAlarm) MarshalBinary() (data []byte, err error)
- func (c *RealtimeAlarm) String() string
- func (*RealtimeAlarm) TableName() string
- func (c *RealtimeAlarm) UnmarshalBinary(data []byte) error
- type RealtimeAlarmPage
- type RealtimeAlarmReceiver
- type RealtimeDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AlarmHistory ¶
type AlarmHistory struct { model.EasyModel // 告警摘要 Summary string `gorm:"column:summary;type:text;not null;comment:告警摘要"` // 告警明细 Description string `gorm:"column:description;type:text;not null;comment:告警明细"` // 告警消息状态 AlertStatus vobj.AlertStatus `gorm:"column:status;type:varchar(16);not null;comment:告警消息状态"` // 告警时间 StartsAt string `gorm:"column:starts_at;type:varchar(100);not null;comment:告警时间"` // 恢复时间 EndsAt string `gorm:"column:ends_at;type:varchar(100);not null;comment:恢复时间"` // 告警表达式 Expr string `gorm:"column:expr;type:text;not null;comment:prom ql"` // 指纹 Fingerprint string `gorm:"column:fingerprint;type:varchar(255);not null;comment:fingerprint;uniqueIndex"` // 标签 Labels *vobj.Labels `gorm:"column:labels;type:JSON;not null;comment:标签" json:"labels"` // 注解 Annotations *vobj.Annotations `gorm:"column:annotations;type:JSON;not null;comment:注解" json:"annotations"` // 告警原始数据ID RawInfoID uint32 `` /* 137-byte string literal not displayed */ // 附加信息 HistoryDetails *HistoryDetails `gorm:"foreignKey:AlarmHistoryID;comment:附加信息"` }
AlarmHistory 告警历史
func (*AlarmHistory) GetHistoryDetails ¶
func (a *AlarmHistory) GetHistoryDetails() *HistoryDetails
GetHistoryDetails 获取附加信息
func (*AlarmHistory) MarshalBinary ¶
func (a *AlarmHistory) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*AlarmHistory) TableName ¶
func (a *AlarmHistory) TableName() string
TableName AlarmHistory's table name
func (*AlarmHistory) UnmarshalBinary ¶
func (a *AlarmHistory) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type AlarmRaw ¶
type AlarmRaw struct { model.EasyModel // 接收对象 Receiver string `gorm:"column:receiver;type:text;not null;comment:接收对象"` // 原始信息json RawInfo string `gorm:"column:raw_info;type:text;not null;comment:原始信息json"` // 指纹 Fingerprint string `gorm:"column:fingerprint;type:varchar(255);not null;comment:fingerprint;uniqueIndex"` }
AlarmRaw 告警原始信息
func (*AlarmRaw) MarshalBinary ¶
MarshalBinary redis存储实现
func (*AlarmRaw) UnmarshalBinary ¶
UnmarshalBinary redis存储实现
type AlarmSendHistory ¶ added in v1.1.31
type AlarmSendHistory struct { model.EasyModel // 告警组ID AlarmGroupID uint32 `gorm:"column:alarm_group_id;type:int;not null;comment:接收对象" json:"alarmGroupId"` // 发送数据 SendData string `gorm:"column:send_data;type:text;not null;comment:发送数据" json:"sendData"` // 请求id RequestID string `gorm:"column:request_id;type:varchar(255);not null;comment:请求id" json:"requestId"` Route string `gorm:"column:route;type:varchar(50);not null;comment:路由" json:"route"` // 重试次数 RetryNumber int `gorm:"column:retry_number;type:int;not null;comment:重试次数" json:"retryNumber"` // 发送状态 SendStatus vobj.SendStatus `gorm:"column:send_status;type:tinyint;not null;comment:发送状态" json:"sendStatus"` // 发送时间 SendTime string `gorm:"column:send_time;type:varchar(100);not null;comment:发送时间" json:"sendTime"` }
AlarmSendHistory 发送历史
func (*AlarmSendHistory) TableName ¶ added in v1.1.31
func (*AlarmSendHistory) TableName() string
TableName overrides the default table name generated by gorm
type HistoryDetails ¶
type HistoryDetails struct { model.EasyModel // 相关策略 Strategy string `gorm:"column:strategy;type:text;not null;comment:相关策略" json:"strategy"` // 策略等级 Level string `gorm:"column:level;type:text;not null;comment:策略等级" json:"level"` // 数据源 Datasource string `gorm:"column:datasource;type:text;not null;comment:数据源" json:"datasource"` // 告警历史ID AlarmHistoryID uint32 `` /* 137-byte string literal not displayed */ AlarmHistory *AlarmHistory `gorm:"foreignKey:AlarmHistoryID" json:"alarm_history"` }
HistoryDetails 告警历史字段表
func (*HistoryDetails) MarshalBinary ¶
func (c *HistoryDetails) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*HistoryDetails) TableName ¶
func (*HistoryDetails) TableName() string
TableName HistoryDetails's table name
func (*HistoryDetails) UnmarshalBinary ¶
func (c *HistoryDetails) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type RealtimeAlarm ¶
type RealtimeAlarm struct { model.EasyModel // 告警状态: 1告警;2恢复 Status vobj.AlertStatus `gorm:"column:status;type:tinyint;not null;default:1;comment:告警状态: 1告警;2恢复"` // 告警时间 StartsAt string `gorm:"column:starts_at;type:varchar(100);not null;comment:告警时间"` // 恢复时间 EndsAt string `gorm:"column:ends_at;type:varchar(100);not null;comment:恢复时间"` // 告警摘要 Summary string `gorm:"column:summary;type:text;not null;comment:告警摘要"` // 告警明细 Description string `gorm:"column:description;type:text;not null;comment:告警明细"` // 触发告警表达式 Expr string `gorm:"column:expr;type:text;not null;comment:告警表达式"` // 指纹 Fingerprint string `gorm:"column:fingerprint;type:varchar(255);not null;comment:fingerprint;uniqueIndex"` // 标签 Labels *vobj.Labels `gorm:"column:labels;type:JSON;not null;comment:标签" json:"labels"` // 注解 Annotations *vobj.Annotations `gorm:"column:annotations;type:JSON;not null;comment:注解" json:"annotations"` // 告警原始数据ID RawInfoID uint32 `` /* 138-byte string literal not displayed */ // 实时告警详情 RealtimeDetails *RealtimeDetails `gorm:"foreignKey:RealtimeAlarmID"` // 策略ID StrategyID uint32 `gorm:"column:strategy_id;type:int;not null;comment:策略id"` // 告警等级ID LevelID uint32 `gorm:"column:level_id;type:int;not null;comment:告警等级id"` // 告警原始信息 RawInfo *AlarmRaw `gorm:"foreignKey:RawInfoID"` // 关联的告警通知组列表 通过RealtimeAlarmID关联RealtimeAlarmReceiver表 Receiver []*RealtimeAlarmReceiver `gorm:"foreignKey:RealtimeAlarmID"` // 关联告警页面列表 Pages []*RealtimeAlarmPage `gorm:"foreignKey:RealtimeAlarmID"` }
RealtimeAlarm mapped from table <RealtimeAlarm>
func (*RealtimeAlarm) GetRawInfo ¶
func (c *RealtimeAlarm) GetRawInfo() *AlarmRaw
GetRawInfo 获取告警原始信息
func (*RealtimeAlarm) GetRealtimeDetails ¶
func (c *RealtimeAlarm) GetRealtimeDetails() *RealtimeDetails
GetRealtimeDetails 获取实时告警详情
func (*RealtimeAlarm) MarshalBinary ¶
func (c *RealtimeAlarm) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*RealtimeAlarm) TableName ¶
func (*RealtimeAlarm) TableName() string
TableName RealtimeAlarm's table name
func (*RealtimeAlarm) UnmarshalBinary ¶
func (c *RealtimeAlarm) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type RealtimeAlarmPage ¶
type RealtimeAlarmPage struct { model.EasyModel RealtimeAlarmID uint32 `gorm:"column:realtime_alarm_id;type:int;not null;comment:告警ID" json:"realtime_alarm_id"` PageID uint32 `gorm:"column:page_id;type:int;not null;comment:页面ID" json:"page_id"` }
RealtimeAlarmPage represents the realtime alarm pages model
func (*RealtimeAlarmPage) TableName ¶
func (*RealtimeAlarmPage) TableName() string
TableName overrides the default table name generated by gorm
type RealtimeAlarmReceiver ¶
type RealtimeAlarmReceiver struct { model.EasyModel RealtimeAlarmID uint32 `gorm:"column:realtime_alarm_id;type:int;not null;comment:告警ID" json:"realtime_alarm_id"` AlarmNoticeGroupID uint32 `gorm:"column:alarm_notice_group_id;type:int;not null;comment:告警通知组ID" json:"alarm_notice_group_id"` }
RealtimeAlarmReceiver represents the realtime alarm receiver model
func (*RealtimeAlarmReceiver) TableName ¶
func (*RealtimeAlarmReceiver) TableName() string
TableName overrides the default table name generated by gorm
type RealtimeDetails ¶
type RealtimeDetails struct { model.EasyModel // 相关策略 Strategy string `gorm:"column:strategy;type:text;not null;comment:相关策略" json:"strategy"` // 策略等级 Level string `gorm:"column:level;type:text;not null;comment:策略等级" json:"level"` // 数据源 Datasource string `gorm:"column:datasource;type:varchar(2000);not null;comment:数据源" json:"datasource"` // 实时告警ID RealtimeAlarmID uint32 `` /* 142-byte string literal not displayed */ // 实时告警 RealtimeAlarm *RealtimeAlarm `gorm:"foreignKey:RealtimeAlarmID" json:"realtime_alarm"` }
func (*RealtimeDetails) MarshalBinary ¶
func (c *RealtimeDetails) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*RealtimeDetails) TableName ¶
func (*RealtimeDetails) TableName() string
TableName RealtimeDetails's table name
func (*RealtimeDetails) UnmarshalBinary ¶
func (c *RealtimeDetails) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现