alarmmodel

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Models

func Models() []any

Models 注册biz alarm model下相关模型

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) String

func (a *AlarmHistory) String() string

String json string

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

func (a *AlarmRaw) MarshalBinary() (data []byte, err error)

MarshalBinary redis存储实现

func (*AlarmRaw) String

func (a *AlarmRaw) String() string

String json string

func (*AlarmRaw) TableName

func (a *AlarmRaw) TableName() string

TableName AlarmRaw's table name

func (*AlarmRaw) UnmarshalBinary

func (a *AlarmRaw) UnmarshalBinary(data []byte) error

UnmarshalBinary redis存储实现

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) String

func (c *RealtimeAlarm) String() string

String json string

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) String

func (c *RealtimeDetails) String() string

String json string

func (*RealtimeDetails) TableName

func (*RealtimeDetails) TableName() string

TableName RealtimeDetails's table name

func (*RealtimeDetails) UnmarshalBinary

func (c *RealtimeDetails) UnmarshalBinary(data []byte) error

UnmarshalBinary redis存储实现

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL