Documentation
¶
Index ¶
- func Models() []any
- type AlarmHook
- type AlarmNoticeGroup
- type AlarmNoticeMember
- type AlarmPageSelf
- type AllFieldModel
- type CasbinRule
- type Dashboard
- type DashboardChart
- type DashboardSelf
- type Datasource
- type DatasourceMetric
- type MetricLabel
- type SendStrategy
- type Strategy
- type StrategyDomainLevel
- func (s *StrategyDomainLevel) GetAlarmGroupList() []*AlarmNoticeGroup
- func (s *StrategyDomainLevel) GetAlarmPageList() []*SysDict
- func (s *StrategyDomainLevel) GetLevel() *SysDict
- func (s *StrategyDomainLevel) MarshalBinary() (data []byte, err error)
- func (s *StrategyDomainLevel) String() string
- func (s *StrategyDomainLevel) UnmarshalBinary(data []byte) error
- type StrategyEventLevel
- func (s *StrategyEventLevel) GetAlarmGroupList() []*AlarmNoticeGroup
- func (s *StrategyEventLevel) GetAlarmPageList() []*SysDict
- func (s *StrategyEventLevel) GetLevel() *SysDict
- func (s *StrategyEventLevel) MarshalBinary() (data []byte, err error)
- func (s *StrategyEventLevel) String() string
- func (s *StrategyEventLevel) UnmarshalBinary(data []byte) error
- type StrategyGroup
- type StrategyGroupCategories
- type StrategyHTTPLevel
- func (s *StrategyHTTPLevel) GetAlarmGroupList() []*AlarmNoticeGroup
- func (s *StrategyHTTPLevel) GetAlarmPageList() []*SysDict
- func (s *StrategyHTTPLevel) GetLevel() *SysDict
- func (s *StrategyHTTPLevel) MarshalBinary() (data []byte, err error)
- func (s *StrategyHTTPLevel) String() string
- func (s *StrategyHTTPLevel) UnmarshalBinary(data []byte) error
- type StrategyLevel
- func (c *StrategyLevel) AfterFind(_ *gorm.DB) (err error)
- func (c *StrategyLevel) GetAlarmPageList() []*SysDict
- func (c *StrategyLevel) GetLevelByID(id uint32) string
- func (c *StrategyLevel) GetStrategy() *Strategy
- func (c *StrategyLevel) GetStrategyDomainLevelList() []*StrategyDomainLevel
- func (c *StrategyLevel) GetStrategyEventLevelList() []*StrategyEventLevel
- func (c *StrategyLevel) GetStrategyHTTPLevelList() []*StrategyHTTPLevel
- func (c *StrategyLevel) GetStrategyLogLevelList() []*StrategyLogsLevel
- func (c *StrategyLevel) GetStrategyMetricsLevelList() []*StrategyMetricLevel
- func (c *StrategyLevel) GetStrategyPingLevelList() []*StrategyPingLevel
- func (c *StrategyLevel) GetStrategyPortLevelList() []*StrategyPortLevel
- func (c *StrategyLevel) MarshalBinary() (data []byte, err error)
- func (c *StrategyLevel) String() string
- func (*StrategyLevel) TableName() string
- func (c *StrategyLevel) UnmarshalBinary(data []byte) error
- type StrategyLevelTemplate
- type StrategyLogsLevel
- func (s *StrategyLogsLevel) GetAlarmGroupList() []*AlarmNoticeGroup
- func (s *StrategyLogsLevel) GetAlarmPageList() []*SysDict
- func (s *StrategyLogsLevel) GetCount() uint32
- func (s *StrategyLogsLevel) GetDuration() int64
- func (s *StrategyLogsLevel) GetLevel() *SysDict
- func (s *StrategyLogsLevel) MarshalBinary() (data []byte, err error)
- func (s *StrategyLogsLevel) String() string
- func (s *StrategyLogsLevel) UnmarshalBinary(data []byte) error
- type StrategyMetricLevel
- func (s *StrategyMetricLevel) GetAlarmGroupList() []*AlarmNoticeGroup
- func (s *StrategyMetricLevel) GetAlarmPageList() []*SysDict
- func (s *StrategyMetricLevel) GetLabelNoticeList() []*StrategyMetricsLabelNotice
- func (s *StrategyMetricLevel) GetLevel() *SysDict
- func (s *StrategyMetricLevel) MarshalBinary() (data []byte, err error)
- func (s *StrategyMetricLevel) String() string
- func (s *StrategyMetricLevel) UnmarshalBinary(data []byte) error
- type StrategyMetricsLabelNotice
- type StrategyPingLevel
- func (s *StrategyPingLevel) GetAlarmGroupList() []*AlarmNoticeGroup
- func (s *StrategyPingLevel) GetAlarmPageList() []*SysDict
- func (s *StrategyPingLevel) GetLevel() *SysDict
- func (s *StrategyPingLevel) MarshalBinary() (data []byte, err error)
- func (s *StrategyPingLevel) String() string
- func (s *StrategyPingLevel) UnmarshalBinary(data []byte) error
- type StrategyPortLevel
- func (s *StrategyPortLevel) GetAlarmGroupList() []*AlarmNoticeGroup
- func (s *StrategyPortLevel) GetAlarmPageList() []*SysDict
- func (s *StrategyPortLevel) GetLevel() *SysDict
- func (s *StrategyPortLevel) MarshalBinary() (data []byte, err error)
- func (s *StrategyPortLevel) String() string
- func (s *StrategyPortLevel) UnmarshalBinary(data []byte) error
- type StrategySubscriber
- func (c *StrategySubscriber) GetAlarmNoticeType() vobj.NotifyType
- func (c *StrategySubscriber) GetStrategy() *Strategy
- func (c *StrategySubscriber) GetStrategyID() uint32
- func (c *StrategySubscriber) GetUserID() uint32
- func (c *StrategySubscriber) MarshalBinary() (data []byte, err error)
- func (*StrategySubscriber) TableName() string
- func (c *StrategySubscriber) UnmarshalBinary(data []byte) error
- type StrategyTemplate
- type SysDict
- func (c *SysDict) GetCSSClass() string
- func (c *SysDict) GetColorType() string
- func (c *SysDict) GetCreatorID() uint32
- func (c *SysDict) GetDeletedAt() soft_delete.DeletedAt
- func (c *SysDict) GetDictType() vobj.DictType
- func (c *SysDict) GetID() uint32
- func (c *SysDict) GetIcon() string
- func (c *SysDict) GetImageURL() string
- func (c *SysDict) GetLanguageCode() vobj.Language
- func (c *SysDict) GetName() string
- func (c *SysDict) GetRemark() string
- func (c *SysDict) GetStatus() vobj.Status
- func (c *SysDict) GetValue() string
- func (c *SysDict) MarshalBinary() (data []byte, err error)
- func (c *SysDict) String() string
- func (*SysDict) TableName() string
- func (c *SysDict) UnmarshalBinary(data []byte) error
- type SysSendTemplate
- func (c *SysSendTemplate) GetContent() string
- func (c *SysSendTemplate) GetName() string
- func (c *SysSendTemplate) GetRemark() string
- func (c *SysSendTemplate) GetSendType() vobj.AlarmSendType
- func (c *SysSendTemplate) GetStatus() vobj.Status
- func (c *SysSendTemplate) MarshalBinary() (data []byte, err error)
- func (*SysSendTemplate) TableName() string
- func (c *SysSendTemplate) UnmarshalBinary(data []byte) error
- type SysTeamAPI
- func (c *SysTeamAPI) GetAllow() vobj.Allow
- func (c *SysTeamAPI) GetDomain() int32
- func (c *SysTeamAPI) GetModule() int32
- func (c *SysTeamAPI) GetName() string
- func (c *SysTeamAPI) GetPath() string
- func (c *SysTeamAPI) GetRemark() string
- func (c *SysTeamAPI) GetStatus() vobj.Status
- func (c *SysTeamAPI) MarshalBinary() (data []byte, err error)
- func (c *SysTeamAPI) String() string
- func (*SysTeamAPI) TableName() string
- func (c *SysTeamAPI) UnmarshalBinary(data []byte) error
- type SysTeamMember
- func (c *SysTeamMember) GetRole() vobj.Role
- func (c *SysTeamMember) GetStatus() vobj.Status
- func (c *SysTeamMember) GetTeamRoles() []*SysTeamRole
- func (c *SysTeamMember) GetUserID() uint32
- func (c *SysTeamMember) MarshalBinary() (data []byte, err error)
- func (c *SysTeamMember) String() string
- func (*SysTeamMember) TableName() string
- func (c *SysTeamMember) UnmarshalBinary(data []byte) error
- type SysTeamMemberRole
- type SysTeamMenu
- type SysTeamRole
- func (c *SysTeamRole) GetApis() []*SysTeamAPI
- func (c *SysTeamRole) GetMembers() []*SysTeamMember
- func (c *SysTeamRole) GetName() string
- func (c *SysTeamRole) GetRemark() string
- func (c *SysTeamRole) GetStatus() vobj.Status
- func (c *SysTeamRole) MarshalBinary() (data []byte, err error)
- func (c *SysTeamRole) String() string
- func (*SysTeamRole) TableName() string
- func (c *SysTeamRole) UnmarshalBinary(data []byte) error
- type SysTeamRoleAPI
- type TimeEngine
- func (c *TimeEngine) GetName() string
- func (c *TimeEngine) GetRemark() string
- func (c *TimeEngine) GetRules() []*TimeEngineRule
- func (c *TimeEngine) GetStatus() vobj.Status
- func (c *TimeEngine) IsAllowed(time time.Time) bool
- func (c *TimeEngine) MarshalBinary() (data []byte, err error)
- func (c *TimeEngine) String() string
- func (*TimeEngine) TableName() string
- func (c *TimeEngine) UnmarshalBinary(data []byte) error
- type TimeEngineRule
- func (c *TimeEngineRule) GetCategory() vobj.TimeEngineRuleType
- func (c *TimeEngineRule) GetName() string
- func (c *TimeEngineRule) GetRemark() string
- func (c *TimeEngineRule) GetRule() string
- func (c *TimeEngineRule) GetStatus() vobj.Status
- func (c *TimeEngineRule) MarshalBinary() (data []byte, err error)
- func (c *TimeEngineRule) Matcher() types.Matcher
- func (c *TimeEngineRule) String() string
- func (*TimeEngineRule) TableName() string
- func (c *TimeEngineRule) UnmarshalBinary(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AlarmHook ¶
type AlarmHook struct {
AllFieldModel
Name string `gorm:"column:name;type:varchar(64);not null;unique;comment:hook名称" json:"name"`
Remark string `gorm:"column:remark;type:varchar(255);not null;comment:备注" json:"remark"`
URL string `gorm:"column:url;type:varchar(255);not null;comment:hook URL" json:"url"`
APP vobj.HookAPP `gorm:"column:app;type:tinyint;not null;comment:hook应用" json:"app"`
Status vobj.Status `gorm:"column:status;type:tinyint;not null;comment:状态" json:"status"`
Secret string `gorm:"column:secret;type:varchar(255);not null;comment:secret" json:"secret"`
}
AlarmHook mapped from table <alarm_hook>
func (*AlarmHook) MarshalBinary ¶
MarshalBinary redis存储实现
func (*AlarmHook) UnmarshalBinary ¶
UnmarshalBinary redis存储实现
type AlarmNoticeGroup ¶
type AlarmNoticeGroup struct {
AllFieldModel
DeletedAt soft_delete.DeletedAt `` /* 137-byte string literal not displayed */
Name string `` /* 143-byte string literal not displayed */
Status vobj.Status `gorm:"column:status;type:tinyint;not null;default:1;comment:启用状态1:启用;2禁用" json:"status,omitempty"`
Remark string `gorm:"column:remark;type:varchar(255);not null;comment:描述信息" json:"remark,omitempty"`
NoticeMembers []*AlarmNoticeMember `gorm:"foreignKey:AlarmGroupID;comment:通知人信息中间表" json:"notice_members,omitempty"`
AlarmHooks []*AlarmHook `gorm:"many2many:alarm_group_hook" json:"alarm_hooks,omitempty"`
TimeEngines []*TimeEngine `gorm:"many2many:alarm_group_time_engine" json:"time_engines,omitempty"`
// 告警模板
Templates []*SysSendTemplate `gorm:"many2many:alarm_group_templates" json:"templates,omitempty"`
}
AlarmNoticeGroup 告警通知组
func (*AlarmNoticeGroup) IsAllowed ¶ added in v1.2.0
func (c *AlarmNoticeGroup) IsAllowed(t time.Time) bool
IsAllowed 判断条件是否允许
func (*AlarmNoticeGroup) MarshalBinary ¶
func (c *AlarmNoticeGroup) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*AlarmNoticeGroup) TableName ¶
func (*AlarmNoticeGroup) TableName() string
TableName AlarmNoticeGroup's table name
func (*AlarmNoticeGroup) UnmarshalBinary ¶
func (c *AlarmNoticeGroup) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type AlarmNoticeMember ¶
type AlarmNoticeMember struct {
AllFieldModel
AlarmGroup *AlarmNoticeGroup `gorm:"foreignKey:AlarmGroupID" json:"alarm_group"`
AlarmNoticeType vobj.NotifyType `gorm:"column:notice_type;type:int;not null;comment:通知类型;" json:"alarm_notice_type"`
MemberID uint32 `` /* 136-byte string literal not displayed */
AlarmGroupID uint32 `` /* 140-byte string literal not displayed */
DeletedAt soft_delete.DeletedAt `` /* 132-byte string literal not displayed */
Member *SysTeamMember `gorm:"foreignKey:MemberID" json:"member"`
}
AlarmNoticeMember 告警通知用户
func (*AlarmNoticeMember) GetMember ¶ added in v1.1.0
func (c *AlarmNoticeMember) GetMember() *SysTeamMember
GetMember 获取通知人
func (*AlarmNoticeMember) MarshalBinary ¶
func (c *AlarmNoticeMember) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*AlarmNoticeMember) UnmarshalBinary ¶
func (c *AlarmNoticeMember) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type AlarmPageSelf ¶
type AlarmPageSelf struct {
AllFieldModel
UserID uint32 `` /* 132-byte string literal not displayed */
MemberID uint32 `gorm:"column:member_id;type:int unsigned;not null;comment:成员ID" json:"member_id"`
Sort uint32 `gorm:"column:sort;type:int unsigned;not null;default:0;comment:排序(值越小越靠前, 默认为0)" json:"sort"`
AlarmPageID uint32 `` /* 150-byte string literal not displayed */
Member *SysTeamMember `gorm:"foreignKey:MemberID" json:"member"`
AlarmPage *SysDict `gorm:"foreignKey:AlarmPageID" json:"alarm_page"`
}
AlarmPageSelf mapped from table <alarm_page_self>
func (*AlarmPageSelf) MarshalBinary ¶
func (c *AlarmPageSelf) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*AlarmPageSelf) TableName ¶
func (*AlarmPageSelf) TableName() string
TableName Dashboard's table name
func (*AlarmPageSelf) UnmarshalBinary ¶
func (c *AlarmPageSelf) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type AllFieldModel ¶ added in v1.2.0
type AllFieldModel struct {
model.AllFieldModel
// TeamID 团队ID
TeamID uint32 `gorm:"column:team_id;type:int unsigned;not null;comment:团队ID" json:"team_id"`
}
AllFieldModel 基础模型
func (*AllFieldModel) BeforeCreate ¶ added in v1.2.0
func (u *AllFieldModel) BeforeCreate(tx *gorm.DB) (err error)
BeforeCreate 创建前的hook
func (*AllFieldModel) GetTeamID ¶ added in v1.2.0
func (u *AllFieldModel) GetTeamID() uint32
GetTeamID 获取团队ID
type CasbinRule ¶
type CasbinRule struct {
ID uint32 `gorm:"column:id;type:int unsigned;primaryKey;autoIncrement:true" json:"id"`
Ptype string `gorm:"column:ptype;type:varchar(100);uniqueIndex:idx_casbin_rule,priority:1" json:"ptype"`
V0 string `gorm:"column:v0;type:varchar(100);uniqueIndex:idx_casbin_rule,priority:2" json:"v0"`
V1 string `gorm:"column:v1;type:varchar(100);uniqueIndex:idx_casbin_rule,priority:3" json:"v1"`
V2 string `gorm:"column:v2;type:varchar(100);uniqueIndex:idx_casbin_rule,priority:4" json:"v2"`
V3 string `gorm:"column:v3;type:varchar(100);uniqueIndex:idx_casbin_rule,priority:5" json:"v3"`
V4 string `gorm:"column:v4;type:varchar(100);uniqueIndex:idx_casbin_rule,priority:6" json:"v4"`
V5 string `gorm:"column:v5;type:varchar(100);uniqueIndex:idx_casbin_rule,priority:7" json:"v5"`
}
CasbinRule mapped from table <casbin_rule>
func (*CasbinRule) TableName ¶
func (*CasbinRule) TableName() string
TableName CasbinRule's table name
type Dashboard ¶
type Dashboard struct {
AllFieldModel
Name string `gorm:"column:name;type:varchar(64);not null;comment:仪表盘名称" json:"name"` // 仪表盘名称
Status vobj.Status `gorm:"column:status;type:int;not null;comment:仪表盘状态" json:"status"` // 仪表盘状态
Remark string `gorm:"column:remark;type:varchar(255);not null;comment:描述信息" json:"remark"` // 描述信息
Color string `gorm:"column:color;type:varchar(64);not null;comment:颜色" json:"color"`
// 仪表盘图表
Charts []*DashboardChart `gorm:"foreignKey:DashboardID" json:"charts"`
// 仪表盘策略组
StrategyGroups []*StrategyGroup `gorm:"many2many:dashboard_strategy_groups" json:"strategy_groups"`
}
Dashboard mapped from table <dashboard>
func (*Dashboard) MarshalBinary ¶
MarshalBinary redis存储实现
func (*Dashboard) UnmarshalBinary ¶
UnmarshalBinary redis存储实现
type DashboardChart ¶
type DashboardChart struct {
AllFieldModel
Name string `gorm:"column:name;type:varchar(64);not null;comment:仪表盘名称" json:"name"` // 仪表盘名称
Status vobj.Status `gorm:"column:status;type:int;not null;comment:仪表盘状态" json:"status"` // 仪表盘状态
Remark string `gorm:"column:remark;type:varchar(255);not null;comment:描述信息" json:"remark"` // 描述信息
URL string `gorm:"column:url;type:text;not null;comment:图表地址" json:"url"`
DashboardID uint32 `gorm:"column:dashboard_id;type:int unsigned;not null;comment:仪表盘ID" json:"dashboard_id"`
Width string `gorm:"column:width;type:varchar(64);not null;comment:图表宽度" json:"width"`
Height string `gorm:"column:height;type:varchar(64);not null;comment:图表高度" json:"height"`
Sort uint32 `gorm:"column:sort;type:int unsigned;not null;comment:排序,默认0,升序" json:"sort"`
}
DashboardChart mapped from table <dashboard_charts>
func (*DashboardChart) MarshalBinary ¶
func (c *DashboardChart) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*DashboardChart) TableName ¶
func (*DashboardChart) TableName() string
TableName DashboardChart's table name
func (*DashboardChart) UnmarshalBinary ¶
func (c *DashboardChart) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type DashboardSelf ¶
type DashboardSelf struct {
AllFieldModel
DashboardID uint32 `` /* 144-byte string literal not displayed */
UserID uint32 `` /* 131-byte string literal not displayed */
MemberID uint32 `gorm:"column:member_id;type:int unsigned;not null;comment:成员ID" json:"member_id"`
Sort uint32 `gorm:"column:sort;type:int unsigned;not null;default:0;comment:排序(值越小越靠前, 默认为0)" json:"sort"`
Member *SysTeamMember `gorm:"foreignKey:MemberID" json:"member"`
Dashboard *Dashboard `gorm:"foreignKey:DashboardID" json:"dashboard"`
}
DashboardSelf mapped from table <dashboard_self>
func (*DashboardSelf) MarshalBinary ¶
func (c *DashboardSelf) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*DashboardSelf) TableName ¶
func (*DashboardSelf) TableName() string
TableName Dashboard's table name
func (*DashboardSelf) UnmarshalBinary ¶
func (c *DashboardSelf) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type Datasource ¶
type Datasource struct {
AllFieldModel
Name string `gorm:"column:name;type:varchar(64);not null;comment:数据源名称" json:"name"` // 数据源名称
Category vobj.DatasourceType `gorm:"column:category;type:int;not null;comment:数据源类型" json:"category"` // 数据源类型
StorageType vobj.StorageType `gorm:"column:storage_type;type:int;not null;comment:存储类型" json:"storage_type"`
Config *datasource.Config `gorm:"column:config;type:JSON;not null;comment:数据源配置参数" json:"config"` // 数据源配置参数
Endpoint string `gorm:"column:endpoint;type:varchar(255);not null;comment:数据源地址" json:"endpoint"` // 数据源地址
Status vobj.Status `gorm:"column:status;type:int;not null;comment:数据源状态" json:"status"` // 数据源状态
Remark string `gorm:"column:remark;type:varchar(255);not null;comment:描述信息" json:"remark"` // 描述信息
}
Datasource mapped from table <datasource>
func (*Datasource) MarshalBinary ¶
func (c *Datasource) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*Datasource) TableName ¶
func (*Datasource) TableName() string
TableName Datasource's table name
func (*Datasource) UnmarshalBinary ¶
func (c *Datasource) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type DatasourceMetric ¶
type DatasourceMetric struct {
AllFieldModel
Name string `` /* 137-byte string literal not displayed */
Category vobj.MetricType `` /* 176-byte string literal not displayed */
Unit string `gorm:"column:unit;type:varchar(255);not null;comment:单位" json:"unit"` // 单位
Remark string `gorm:"column:remark;type:text;not null;comment:备注" json:"remark"` // 备注
DatasourceID uint32 `` // 所属数据源
/* 158-byte string literal not displayed */
// 更新时间
DeletedAt soft_delete.DeletedAt `` // 删除时间
/* 143-byte string literal not displayed */
// 标签数量
LabelCount uint32 `gorm:"column:label_count;type:int;not null;default:0;comment:指标数量" json:"label_count"`
Labels []*MetricLabel `gorm:"foreignKey:MetricID" json:"labels"`
}
DatasourceMetric mapped from table <datasource_metrics>
func (*DatasourceMetric) MarshalBinary ¶
func (c *DatasourceMetric) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*DatasourceMetric) TableName ¶
func (*DatasourceMetric) TableName() string
TableName DatasourceMetric's table name
func (*DatasourceMetric) UnmarshalBinary ¶
func (c *DatasourceMetric) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type MetricLabel ¶
type MetricLabel struct {
AllFieldModel
Name string `` /* 129-byte string literal not displayed */
MetricID uint32 `` // 所属指标
/* 133-byte string literal not displayed */
DeletedAt soft_delete.DeletedAt `` // 删除时间
/* 129-byte string literal not displayed */
Remark string `gorm:"column:remark;type:varchar(255);not null;comment:备注" json:"remark"` // 备注
LabelValues string `gorm:"column:label_values;type:text;not null;comment:标签值" json:"label_values"`
}
MetricLabel mapped from table <metric_labels>
func (*MetricLabel) GetLabelValues ¶ added in v1.1.0
func (c *MetricLabel) GetLabelValues() []string
GetLabelValues get label values
func (*MetricLabel) MarshalBinary ¶
func (c *MetricLabel) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*MetricLabel) TableName ¶
func (*MetricLabel) TableName() string
TableName MetricLabel's table name
func (*MetricLabel) UnmarshalBinary ¶
func (c *MetricLabel) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type SendStrategy ¶
type SendStrategy struct {
AllFieldModel
Name string `gorm:"column:name;type:varchar(64);not null;comment:策略名称" json:"name"`
// 标签组
Labels label.Labels `gorm:"column:labels;type:JSON;not null;comment:标签" json:"labels"`
// 类型
SendType vobj.SendType `gorm:"column:send_type;type:int;not null;comment:类型" json:"send_type"`
Remark string `gorm:"column:remark;type:varchar(255);not null;comment:备注" json:"remark"`
Status vobj.Status `gorm:"column:status;type:int;not null;comment:策略状态" json:"status"`
// 持续时间,0为永久有效
Duration *types.Duration `gorm:"column:duration;type:bigint(20);not null;comment:持续时间" json:"duration"`
}
SendStrategy 发送策略, 用于控制发送的消息完成抑制或聚合动作
func (*SendStrategy) MarshalBinary ¶
func (c *SendStrategy) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*SendStrategy) TableName ¶
func (*SendStrategy) TableName() string
TableName SendStrategy's table name
func (*SendStrategy) UnmarshalBinary ¶
func (c *SendStrategy) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type Strategy ¶
type Strategy struct {
AllFieldModel
// StrategyType 策略类型
StrategyType vobj.StrategyType `gorm:"column:strategy_type;type:int;not null;comment:策略类型" json:"strategy_type"`
// 模板ID, 用于标记是否从模板创建而来
TemplateID uint32 `gorm:"column:strategy_template_id;type:int unsigned;not null;comment:策略模板ID" json:"template_id"`
GroupID uint32 `` /* 144-byte string literal not displayed */
DeletedAt soft_delete.DeletedAt `` /* 126-byte string literal not displayed */
// 策略模板来源(系统、团队)
TemplateSource vobj.StrategyTemplateSource `` /* 131-byte string literal not displayed */
Name string `` /* 131-byte string literal not displayed */
Expr string `gorm:"column:expr;type:text;not null;comment:告警表达式" json:"expr"`
Labels *label.Labels `gorm:"column:labels;type:JSON;not null;comment:标签" json:"labels"`
Annotations *label.Annotations `gorm:"column:annotations;type:JSON;not null;comment:注解" json:"annotations"`
Remark string `gorm:"column:remark;type:varchar(255);not null;comment:备注" json:"remark"`
Status vobj.Status `gorm:"column:status;type:int;not null;comment:策略状态" json:"status"`
Datasource []*Datasource `gorm:"many2many:strategy_datasource;" json:"datasource"`
// 策略类型
Categories []*SysDict `gorm:"many2many:strategy_categories" json:"categories"`
// 策略告警组
AlarmNoticeGroups []*AlarmNoticeGroup `gorm:"many2many:strategies_alarm_groups;" json:"alarm_groups"`
// 策略组
Group *StrategyGroup `gorm:"foreignKey:GroupID" json:"group"`
// 策略等级
Level *StrategyLevel `gorm:"foreignKey:StrategyID" json:"level"`
}
Strategy mapped from table <Strategy>
func (*Strategy) GetAlarmNoticeGroups ¶ added in v1.2.2
func (c *Strategy) GetAlarmNoticeGroups() []*AlarmNoticeGroup
GetAlarmNoticeGroups 获取告警组
func (*Strategy) GetLevel ¶ added in v1.2.2
func (c *Strategy) GetLevel() *StrategyLevel
GetLevel 获取策略等级
func (*Strategy) MarshalBinary ¶
MarshalBinary redis存储实现
func (*Strategy) UnmarshalBinary ¶
UnmarshalBinary redis存储实现
type StrategyDomainLevel ¶ added in v1.2.0
type StrategyDomainLevel struct {
// 阈值 (证书类型就是剩余天数,端口就是0:关闭,1:开启)
Threshold int64 `json:"threshold,omitempty"`
// 判断条件
Condition vobj.Condition `json:"condition,omitempty"`
// 告警等级ID
Level *SysDict `json:"level,omitempty"`
// 告警页面
AlarmPageList []*SysDict `json:"alarmPageList,omitempty"`
// 策略告警组
AlarmGroupList []*AlarmNoticeGroup `json:"alarm_groups,omitempty"`
}
StrategyDomainLevel 域名证书|端口 等级策略明细
func (*StrategyDomainLevel) GetAlarmGroupList ¶ added in v1.2.2
func (s *StrategyDomainLevel) GetAlarmGroupList() []*AlarmNoticeGroup
GetAlarmGroupList 获取告警组
func (*StrategyDomainLevel) GetAlarmPageList ¶ added in v1.2.2
func (s *StrategyDomainLevel) GetAlarmPageList() []*SysDict
GetAlarmPageList 获取告警页面
func (*StrategyDomainLevel) GetLevel ¶ added in v1.2.2
func (s *StrategyDomainLevel) GetLevel() *SysDict
GetLevel 获取告警等级
func (*StrategyDomainLevel) MarshalBinary ¶ added in v1.2.0
func (s *StrategyDomainLevel) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategyDomainLevel) String ¶ added in v1.2.0
func (s *StrategyDomainLevel) String() string
String 字符串
func (*StrategyDomainLevel) UnmarshalBinary ¶ added in v1.2.0
func (s *StrategyDomainLevel) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategyEventLevel ¶ added in v1.2.0
type StrategyEventLevel struct {
// 值
Value string `json:"value,omitempty"`
// 数据类型
DataType vobj.EventDataType `json:"dataType,omitempty"`
// 条件
Condition vobj.EventCondition `json:"condition,omitempty"`
// object path key
PathKey string `json:"pathKey,omitempty"`
// 告警等级ID
Level *SysDict `json:"level,omitempty"`
// 告警页面
AlarmPageList []*SysDict `json:"alarmPageList,omitempty"`
// 策略告警组
AlarmGroupList []*AlarmNoticeGroup `json:"alarm_groups,omitempty"`
}
StrategyEventLevel 事件策略等级
func (*StrategyEventLevel) GetAlarmGroupList ¶ added in v1.2.2
func (s *StrategyEventLevel) GetAlarmGroupList() []*AlarmNoticeGroup
GetAlarmGroupList 获取告警组
func (*StrategyEventLevel) GetAlarmPageList ¶ added in v1.2.2
func (s *StrategyEventLevel) GetAlarmPageList() []*SysDict
GetAlarmPageList 获取告警页面
func (*StrategyEventLevel) GetLevel ¶ added in v1.2.2
func (s *StrategyEventLevel) GetLevel() *SysDict
GetLevel 获取告警等级
func (*StrategyEventLevel) MarshalBinary ¶ added in v1.2.0
func (s *StrategyEventLevel) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategyEventLevel) String ¶ added in v1.2.0
func (s *StrategyEventLevel) String() string
String json string
func (*StrategyEventLevel) UnmarshalBinary ¶ added in v1.2.0
func (s *StrategyEventLevel) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategyGroup ¶
type StrategyGroup struct {
AllFieldModel
DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:bigint;not null;default:0;uniqueIndex:idx__strategy_group__name,priority:2" json:"deleted_at"`
Name string `gorm:"column:name;type:varchar(64);not null;uniqueIndex:idx__strategy_group__name,priority:1;comment:规则组名称"`
Status vobj.Status `gorm:"column:status;type:tinyint;not null;default:1;comment:启用状态1:启用;2禁用"`
Remark string `gorm:"column:remark;type:varchar(255);not null;comment:描述信息"`
Strategies []*Strategy `gorm:"foreignKey:GroupID"`
Categories []*SysDict `gorm:"many2many:strategy_group_categories" json:"categories"`
}
StrategyGroup 告警规则组
func (*StrategyGroup) MarshalBinary ¶
func (c *StrategyGroup) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategyGroup) TableName ¶
func (*StrategyGroup) TableName() string
TableName Strategy's table name
func (*StrategyGroup) UnmarshalBinary ¶
func (c *StrategyGroup) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategyGroupCategories ¶
type StrategyGroupCategories struct {
StrategyGroupID uint32 `gorm:"primaryKey;column:strategy_group_id;type:int unsigned;primaryKey" json:"strategy_group_id"`
SysDictID uint32 `gorm:"primaryKey;column:sys_dict_id;type:int unsigned;primaryKey" json:"sys_dict_id"`
}
StrategyGroupCategories 策略分组类型中间表
func (*StrategyGroupCategories) MarshalBinary ¶
func (c *StrategyGroupCategories) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategyGroupCategories) TableName ¶
func (*StrategyGroupCategories) TableName() string
TableName StrategyGroupCategories 's table name
func (*StrategyGroupCategories) UnmarshalBinary ¶
func (c *StrategyGroupCategories) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategyHTTPLevel ¶ added in v1.2.0
type StrategyHTTPLevel struct {
// 状态码
StatusCode string `json:"statusCode,omitempty"`
// 响应时间
ResponseTime float64 `json:"responseTime,omitempty"`
// 请求头
Headers []*vobj.Header `json:"headers,omitempty"`
// 请求body
Body string `json:"body,omitempty"`
// 请求方式
Method vobj.HTTPMethod `json:"method,omitempty"`
// 查询参数
QueryParams string `json:"queryParams,omitempty"`
// 状态码判断条件
StatusCodeCondition vobj.Condition `json:"condition,omitempty"`
// 响应时间判断条件
ResponseTimeCondition vobj.Condition `json:"responseTimeCondition,omitempty"`
// 告警等级ID
Level *SysDict `json:"level,omitempty"`
// 告警页面
AlarmPageList []*SysDict `json:"alarmPageList,omitempty"`
// 策略告警组
AlarmGroupList []*AlarmNoticeGroup `json:"alarm_groups,omitempty"`
}
StrategyHTTPLevel HTTP监控策略定义, 用于监控指定URL的响应时间、状态码
func (*StrategyHTTPLevel) GetAlarmGroupList ¶ added in v1.2.2
func (s *StrategyHTTPLevel) GetAlarmGroupList() []*AlarmNoticeGroup
GetAlarmGroupList 获取告警组
func (*StrategyHTTPLevel) GetAlarmPageList ¶ added in v1.2.2
func (s *StrategyHTTPLevel) GetAlarmPageList() []*SysDict
GetAlarmPageList 获取告警页面
func (*StrategyHTTPLevel) GetLevel ¶ added in v1.2.2
func (s *StrategyHTTPLevel) GetLevel() *SysDict
GetLevel 获取告警等级
func (*StrategyHTTPLevel) MarshalBinary ¶ added in v1.2.0
func (s *StrategyHTTPLevel) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategyHTTPLevel) String ¶ added in v1.2.0
func (s *StrategyHTTPLevel) String() string
String 字符串
func (*StrategyHTTPLevel) UnmarshalBinary ¶ added in v1.2.0
func (s *StrategyHTTPLevel) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategyLevel ¶
type StrategyLevel struct {
AllFieldModel
// StrategyType 策略类型
StrategyType vobj.StrategyType `gorm:"column:strategy_type;type:int;not null;comment:策略类型" json:"strategy_type"`
// 策略等级json
RawInfo string `gorm:"column:raw_info;type:text;not null;comment:策略等级json"`
StrategyID uint32 `` /* 127-byte string literal not displayed */
Strategy *Strategy `gorm:"foreignKey:StrategyID"`
// 告警页面 + 告警等级
DictList []*SysDict `gorm:"many2many:strategy_level_dict_list" json:"dictList"`
// 告警组列表
AlarmGroups []*AlarmNoticeGroup `gorm:"many2many:strategy_levels_alarm_groups"`
// 映射数据
StrategyMetricsLevelList []*StrategyMetricLevel `gorm:"-" json:"strategyMetricsLevelList,omitempty"`
StrategyEventLevelList []*StrategyEventLevel `gorm:"-" json:"strategyMQLevelList,omitempty"`
StrategyDomainLevelList []*StrategyDomainLevel `gorm:"-" json:"strategyDomainList,omitempty"`
StrategyPortLevelList []*StrategyPortLevel `gorm:"-" json:"strategyPortList,omitempty"`
StrategyHTTPLevelList []*StrategyHTTPLevel `gorm:"-" json:"strategyHTTPList,omitempty"`
StrategyPingLevelList []*StrategyPingLevel `gorm:"-" json:"strategyPingList,omitempty"`
StrategyLogsLevelList []*StrategyLogsLevel `gorm:"-" json:"strategyLogsList,omitempty"`
// contains filtered or unexported fields
}
StrategyLevel mapped from table <StrategyLevel>
func (*StrategyLevel) AfterFind ¶ added in v1.2.0
func (c *StrategyLevel) AfterFind(_ *gorm.DB) (err error)
AfterFind get strategy level
func (*StrategyLevel) GetAlarmPageList ¶ added in v1.2.0
func (c *StrategyLevel) GetAlarmPageList() []*SysDict
GetAlarmPageList 获取告警页面列表
func (*StrategyLevel) GetLevelByID ¶ added in v1.2.0
func (c *StrategyLevel) GetLevelByID(id uint32) string
GetLevelByID 获取等级
func (*StrategyLevel) GetStrategy ¶ added in v1.2.2
func (c *StrategyLevel) GetStrategy() *Strategy
GetStrategy 获取策略
func (*StrategyLevel) GetStrategyDomainLevelList ¶ added in v1.2.2
func (c *StrategyLevel) GetStrategyDomainLevelList() []*StrategyDomainLevel
GetStrategyDomainLevelList 获取domain策略等级列表
func (*StrategyLevel) GetStrategyEventLevelList ¶ added in v1.2.2
func (c *StrategyLevel) GetStrategyEventLevelList() []*StrategyEventLevel
GetStrategyEventLevelList 获取event策略等级列表
func (*StrategyLevel) GetStrategyHTTPLevelList ¶ added in v1.2.2
func (c *StrategyLevel) GetStrategyHTTPLevelList() []*StrategyHTTPLevel
GetStrategyHTTPLevelList 获取http策略等级列表
func (*StrategyLevel) GetStrategyLogLevelList ¶ added in v1.2.26
func (c *StrategyLevel) GetStrategyLogLevelList() []*StrategyLogsLevel
GetStrategyLogLevelList 获取日志策略等级列表
func (*StrategyLevel) GetStrategyMetricsLevelList ¶ added in v1.2.2
func (c *StrategyLevel) GetStrategyMetricsLevelList() []*StrategyMetricLevel
GetStrategyMetricsLevelList 获取metric策略等级列表
func (*StrategyLevel) GetStrategyPingLevelList ¶ added in v1.2.2
func (c *StrategyLevel) GetStrategyPingLevelList() []*StrategyPingLevel
GetStrategyPingLevelList 获取ping策略等级列表
func (*StrategyLevel) GetStrategyPortLevelList ¶ added in v1.2.2
func (c *StrategyLevel) GetStrategyPortLevelList() []*StrategyPortLevel
GetStrategyPortLevelList 获取port策略等级列表
func (*StrategyLevel) MarshalBinary ¶
func (c *StrategyLevel) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategyLevel) TableName ¶
func (*StrategyLevel) TableName() string
TableName StrategyLevel's table name
func (*StrategyLevel) UnmarshalBinary ¶
func (c *StrategyLevel) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategyLevelTemplate ¶
type StrategyLevelTemplate struct {
AllFieldModel
// 所属策略模板
StrategyTemplateID uint32 `gorm:"column:strategy_template_id;type:int unsigned;not null;comment:策略模板ID" json:"strategy_template_id"`
StrategyTemplate *StrategyTemplate `gorm:"foreignKey:StrategyTemplateID" json:"strategy_template"`
// 持续时间
Duration *types.Duration `gorm:"column:duration;type:bigint(20);not null;comment:告警持续时间" json:"duration"`
// 持续次数
Count uint32 `gorm:"column:count;type:int unsigned;not null;comment:持续次数" json:"count"`
// 持续事件类型
SustainType vobj.Sustain `gorm:"column:sustain_type;type:int(11);not null;comment:持续类型" json:"sustain_type"`
// 执行频率
Interval *types.Duration `gorm:"column:interval;type:bigint(20);not null;comment:执行频率" json:"interval"`
// 条件
Condition string `gorm:"column:condition;type:varchar(2);not null;comment:条件" json:"condition"`
// 阈值
Threshold float64 `gorm:"column:threshold;type:text;not null;comment:阈值" json:"threshold"`
// 告警等级
LevelID uint32 `gorm:"column:level_id;type:int unsigned;not null;comment:告警等级" json:"level_id"`
Level *SysDict `gorm:"foreignKey:LevelID" json:"level"`
// 状态
Status vobj.Status `gorm:"column:status;type:int;not null;comment:策略状态" json:"status"`
}
StrategyLevelTemplate 策略等级模板级别
func (*StrategyLevelTemplate) MarshalBinary ¶
func (c *StrategyLevelTemplate) MarshalBinary() (data []byte, err error)
MarshalBinary redis 存储实现
func (*StrategyLevelTemplate) String ¶
func (c *StrategyLevelTemplate) String() string
String json string
func (*StrategyLevelTemplate) TableName ¶
func (*StrategyLevelTemplate) TableName() string
TableName StrategyLevelTemplate's table name
func (*StrategyLevelTemplate) UnmarshalBinary ¶
func (c *StrategyLevelTemplate) UnmarshalBinary(data []byte) error
UnmarshalBinary redis 存储实现
type StrategyLogsLevel ¶ added in v1.2.26
type StrategyLogsLevel struct {
// 持续时间
Duration int64 `json:"duration,omitempty"`
// 持续次数
Count uint32 `gorm:"column:count;type:int unsigned;not null;comment:持续次数" json:"count,omitempty"`
// 告警等级ID
Level *SysDict `json:"level,omitempty"`
// 告警页面
AlarmPageList []*SysDict `json:"alarmPageList,omitempty"`
// 策略告警组
AlarmGroupList []*AlarmNoticeGroup `json:"alarm_groups,omitempty"`
}
StrategyLogsLevel 策略告警日志等级
func (*StrategyLogsLevel) GetAlarmGroupList ¶ added in v1.2.26
func (s *StrategyLogsLevel) GetAlarmGroupList() []*AlarmNoticeGroup
GetAlarmGroupList 获取告警组
func (*StrategyLogsLevel) GetAlarmPageList ¶ added in v1.2.26
func (s *StrategyLogsLevel) GetAlarmPageList() []*SysDict
GetAlarmPageList 获取告警页面
func (*StrategyLogsLevel) GetCount ¶ added in v1.2.26
func (s *StrategyLogsLevel) GetCount() uint32
GetCount 获取持续次数
func (*StrategyLogsLevel) GetDuration ¶ added in v1.2.26
func (s *StrategyLogsLevel) GetDuration() int64
GetDuration 获取持续时间
func (*StrategyLogsLevel) GetLevel ¶ added in v1.2.26
func (s *StrategyLogsLevel) GetLevel() *SysDict
GetLevel 获取告警等级
func (*StrategyLogsLevel) MarshalBinary ¶ added in v1.2.26
func (s *StrategyLogsLevel) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategyLogsLevel) String ¶ added in v1.2.26
func (s *StrategyLogsLevel) String() string
String 返回字符串
func (*StrategyLogsLevel) UnmarshalBinary ¶ added in v1.2.26
func (s *StrategyLogsLevel) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategyMetricLevel ¶ added in v1.2.0
type StrategyMetricLevel struct {
// 持续时间
Duration int64 `json:"duration,omitempty"`
// 持续次数
Count uint32 `gorm:"column:count;type:int unsigned;not null;comment:持续次数" json:"count,omitempty"`
// 持续事件类型
SustainType vobj.Sustain `gorm:"column:sustain_type;type:int(11);not null;comment:持续类型" json:"sustain_type,omitempty"`
// 条件
Condition vobj.Condition `gorm:"column:condition;type:int;not null;comment:条件" json:"condition,omitempty"`
// 阈值
Threshold float64 `gorm:"column:threshold;type:text;not null;comment:阈值" json:"threshold"`
Level *SysDict `json:"level,omitempty"`
AlarmPageList []*SysDict `json:"alarm_page,omitempty"`
AlarmGroupList []*AlarmNoticeGroup `json:"alarm_groups,omitempty"`
LabelNoticeList []*StrategyMetricsLabelNotice `json:"label_notices,omitempty"`
}
StrategyMetricLevel 策略等级
func (*StrategyMetricLevel) GetAlarmGroupList ¶ added in v1.2.2
func (s *StrategyMetricLevel) GetAlarmGroupList() []*AlarmNoticeGroup
GetAlarmGroupList 获取告警组
func (*StrategyMetricLevel) GetAlarmPageList ¶ added in v1.2.2
func (s *StrategyMetricLevel) GetAlarmPageList() []*SysDict
GetAlarmPageList 获取告警页面
func (*StrategyMetricLevel) GetLabelNoticeList ¶ added in v1.2.2
func (s *StrategyMetricLevel) GetLabelNoticeList() []*StrategyMetricsLabelNotice
GetLabelNoticeList 获取标签告警
func (*StrategyMetricLevel) GetLevel ¶ added in v1.2.2
func (s *StrategyMetricLevel) GetLevel() *SysDict
GetLevel 获取告警等级
func (*StrategyMetricLevel) MarshalBinary ¶ added in v1.2.0
func (s *StrategyMetricLevel) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategyMetricLevel) String ¶ added in v1.2.0
func (s *StrategyMetricLevel) String() string
String json string
func (*StrategyMetricLevel) UnmarshalBinary ¶ added in v1.2.0
func (s *StrategyMetricLevel) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategyMetricsLabelNotice ¶ added in v1.1.38
type StrategyMetricsLabelNotice struct {
// label key
Name string `json:"name"`
// label value
Value string `json:"value"`
// labels告警组
AlarmGroups []*AlarmNoticeGroup `json:"alarm_groups"`
}
StrategyMetricsLabelNotice 策略labels表
func (*StrategyMetricsLabelNotice) MarshalBinary ¶ added in v1.1.38
func (c *StrategyMetricsLabelNotice) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategyMetricsLabelNotice) String ¶ added in v1.2.0
func (c *StrategyMetricsLabelNotice) String() string
String json 序列化实现
func (*StrategyMetricsLabelNotice) UnmarshalBinary ¶ added in v1.1.38
func (c *StrategyMetricsLabelNotice) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategyPingLevel ¶ added in v1.2.0
type StrategyPingLevel struct {
// 总包数
Total uint32 `json:"total,omitempty"`
// 成功包数
Success uint32 `json:"success,omitempty"`
// 丢包率
LossRate float64 `json:"loss_rate,omitempty"`
// 平均延迟
AvgDelay uint32 `json:"avg_delay,omitempty"`
// 最大延迟
MaxDelay uint32 `json:"max_delay,omitempty"`
// 最小延迟
MinDelay uint32 `json:"min_delay,omitempty"`
// 标准差
StdDev uint32 `json:"std_dev,omitempty"`
// 告警等级ID
Level *SysDict `json:"level,omitempty"`
// 告警页面
AlarmPageList []*SysDict `json:"alarmPageList,omitempty"`
// 策略告警组
AlarmGroupList []*AlarmNoticeGroup `json:"alarm_groups,omitempty"`
}
StrategyPingLevel Ping监控策略定义, 用于监控指定IP的网络延迟、丢包率等
func (*StrategyPingLevel) GetAlarmGroupList ¶ added in v1.2.2
func (s *StrategyPingLevel) GetAlarmGroupList() []*AlarmNoticeGroup
GetAlarmGroupList 获取告警组
func (*StrategyPingLevel) GetAlarmPageList ¶ added in v1.2.2
func (s *StrategyPingLevel) GetAlarmPageList() []*SysDict
GetAlarmPageList 获取告警页面
func (*StrategyPingLevel) GetLevel ¶ added in v1.2.2
func (s *StrategyPingLevel) GetLevel() *SysDict
GetLevel 获取告警等级
func (*StrategyPingLevel) MarshalBinary ¶ added in v1.2.0
func (s *StrategyPingLevel) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategyPingLevel) String ¶ added in v1.2.0
func (s *StrategyPingLevel) String() string
String 字符串
func (*StrategyPingLevel) UnmarshalBinary ¶ added in v1.2.0
func (s *StrategyPingLevel) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategyPortLevel ¶ added in v1.2.0
type StrategyPortLevel struct {
// 阈值
Threshold int64 `json:"threshold"`
// 端口
Port uint32 `json:"port"`
// 告警等级I
Level *SysDict `json:"level,omitempty"`
// 告警页面
AlarmPageList []*SysDict `json:"alarmPageList,omitempty"`
// 策略告警组
AlarmGroupList []*AlarmNoticeGroup `json:"alarmGroupList,omitempty"`
}
StrategyPortLevel 策略端口
func (*StrategyPortLevel) GetAlarmGroupList ¶ added in v1.2.2
func (s *StrategyPortLevel) GetAlarmGroupList() []*AlarmNoticeGroup
GetAlarmGroupList 获取告警组
func (*StrategyPortLevel) GetAlarmPageList ¶ added in v1.2.2
func (s *StrategyPortLevel) GetAlarmPageList() []*SysDict
GetAlarmPageList 获取告警页面
func (*StrategyPortLevel) GetLevel ¶ added in v1.2.2
func (s *StrategyPortLevel) GetLevel() *SysDict
GetLevel 获取告警等级
func (*StrategyPortLevel) MarshalBinary ¶ added in v1.2.0
func (s *StrategyPortLevel) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategyPortLevel) String ¶ added in v1.2.0
func (s *StrategyPortLevel) String() string
String 字符串
func (*StrategyPortLevel) UnmarshalBinary ¶ added in v1.2.0
func (s *StrategyPortLevel) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategySubscriber ¶
type StrategySubscriber struct {
AllFieldModel
Strategy *Strategy `gorm:"foreignKey:StrategyID" json:"strategy"`
AlarmNoticeType vobj.NotifyType `gorm:"column:notice_type;type:int;not null;comment:通知类型;" json:"alarm_notice_type"`
UserID uint32 `` /* 130-byte string literal not displayed */
StrategyID uint32 `` /* 132-byte string literal not displayed */
}
StrategySubscriber 策略订阅者信息
func (*StrategySubscriber) GetAlarmNoticeType ¶ added in v1.2.16
func (c *StrategySubscriber) GetAlarmNoticeType() vobj.NotifyType
GetAlarmNoticeType get alarm notice type
func (*StrategySubscriber) GetStrategy ¶ added in v1.2.16
func (c *StrategySubscriber) GetStrategy() *Strategy
GetStrategy get strategy
func (*StrategySubscriber) GetStrategyID ¶ added in v1.2.16
func (c *StrategySubscriber) GetStrategyID() uint32
GetStrategyID get strategy id
func (*StrategySubscriber) GetUserID ¶ added in v1.2.16
func (c *StrategySubscriber) GetUserID() uint32
GetUserID get user id
func (*StrategySubscriber) MarshalBinary ¶
func (c *StrategySubscriber) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategySubscriber) TableName ¶
func (*StrategySubscriber) TableName() string
TableName StrategySubscriber table name
func (*StrategySubscriber) UnmarshalBinary ¶
func (c *StrategySubscriber) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategyTemplate ¶
type StrategyTemplate struct {
AllFieldModel
Alert string `gorm:"column:alert;type:varchar(64);not null;comment:策略名称" json:"alert"`
Expr string `gorm:"column:expr;type:text;not null;comment:告警表达式" json:"expr"`
Status vobj.Status `gorm:"column:status;type:int;not null;comment:策略状态" json:"status"`
Remark string `gorm:"column:remark;type:varchar(255);not null;comment:备注" json:"remark"`
Labels label.Labels `gorm:"column:labels;type:JSON;not null;comment:标签" json:"labels"`
Annotations label.Annotations `gorm:"column:annotations;type:JSON;not null;comment:注解" json:"annotations"`
// 告警等级数据
StrategyLevelTemplates []*StrategyLevelTemplate `gorm:"foreignKey:StrategyTemplateID" json:"strategy_level_templates"`
// 策略模板类型
Categories []*SysDict `gorm:"many2many:strategy_template_categories"`
}
StrategyTemplate 策略模板
func (*StrategyTemplate) MarshalBinary ¶
func (c *StrategyTemplate) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategyTemplate) TableName ¶
func (*StrategyTemplate) TableName() string
TableName StrategyTemplate's table name
func (*StrategyTemplate) UnmarshalBinary ¶
func (c *StrategyTemplate) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type SysDict ¶
type SysDict struct {
AllFieldModel
Name string `` /* 130-byte string literal not displayed */
Value string `gorm:"column:value;type:varchar(100);not null;default:'';comment:字典键值" json:"value,omitempty"`
DictType vobj.DictType `` /* 161-byte string literal not displayed */
ColorType string `gorm:"column:color_type;type:varchar(32);not null;default:hex;comment:颜色类型" json:"colorType,omitempty"`
CSSClass string `gorm:"column:css_class;type:varchar(100);not null;default:#165DFF;comment:css 样式" json:"cssClass,omitempty"`
Icon string `gorm:"column:icon;type:varchar(500);default:'';comment:图标" json:"icon,omitempty"`
ImageURL string `gorm:"column:image_url;type:varchar(500);default:'';comment:图片url" json:"imageURL,omitempty"`
Status vobj.Status `gorm:"column:status;type:tinyint;not null;default:1;comment:状态 1:开启 2:关闭" json:"status,omitempty"`
LanguageCode vobj.Language `` /* 132-byte string literal not displayed */
Remark string `gorm:"column:remark;type:varchar(500);not null;comment:字典备注" json:"remark,omitempty"`
}
SysDict 字典数据
func (*SysDict) GetDeletedAt ¶
func (c *SysDict) GetDeletedAt() soft_delete.DeletedAt
GetDeletedAt get deleted at
func (*SysDict) GetDictType ¶
GetDictType get dict type
func (*SysDict) GetLanguageCode ¶
GetLanguageCode get language code
func (*SysDict) MarshalBinary ¶ added in v1.2.0
MarshalBinary marshal binary
func (*SysDict) UnmarshalBinary ¶ added in v1.2.0
UnmarshalBinary unmarshal binary
type SysSendTemplate ¶ added in v1.2.13
type SysSendTemplate struct {
AllFieldModel
// Name 发送模板名称
Name string `gorm:"column:name;type:varchar(100);not null;uniqueIndex:idx__p__name__send_template,priority:1;comment:发送模板名称"`
// Content 模板内容
Content string `gorm:"column:content;type:text;not null;comment:模板内容" json:"content"`
// SendType 发送模板类型
SendType vobj.AlarmSendType `` /* 159-byte string literal not displayed */
Status vobj.Status `gorm:"column:status;type:tinyint;not null;comment:状态" json:"status"`
// Remark 模板备注
Remark string `gorm:"column:remark;type:varchar(500);not null;comment:模板备注"`
}
SysSendTemplate 发送模板表
func (*SysSendTemplate) GetContent ¶ added in v1.2.13
func (c *SysSendTemplate) GetContent() string
GetContent get content
func (*SysSendTemplate) GetName ¶ added in v1.2.13
func (c *SysSendTemplate) GetName() string
GetName get name
func (*SysSendTemplate) GetRemark ¶ added in v1.2.13
func (c *SysSendTemplate) GetRemark() string
GetRemark get remark
func (*SysSendTemplate) GetSendType ¶ added in v1.2.13
func (c *SysSendTemplate) GetSendType() vobj.AlarmSendType
GetSendType get send type
func (*SysSendTemplate) GetStatus ¶ added in v1.2.13
func (c *SysSendTemplate) GetStatus() vobj.Status
GetStatus get status
func (*SysSendTemplate) MarshalBinary ¶ added in v1.2.13
func (c *SysSendTemplate) MarshalBinary() (data []byte, err error)
MarshalBinary marshal binary
func (*SysSendTemplate) TableName ¶ added in v1.2.13
func (*SysSendTemplate) TableName() string
TableName SysSendTemplate's table name
func (*SysSendTemplate) UnmarshalBinary ¶ added in v1.2.13
func (c *SysSendTemplate) UnmarshalBinary(data []byte) error
UnmarshalBinary unmarshal binary
type SysTeamAPI ¶
type SysTeamAPI struct {
AllFieldModel
Name string `gorm:"column:name;type:varchar(64);not null;uniqueIndex:idx__team_api__name,priority:1;comment:api名称" json:"name"` // api名称
Path string `gorm:"column:path;type:varchar(255);not null;uniqueIndex:idx__team_api__path,priority:1;comment:api路径" json:"path"` // api路径
Status vobj.Status `gorm:"column:status;type:tinyint;not null;comment:状态" json:"status"` // 状态
Remark string `gorm:"column:remark;type:varchar(255);not null;comment:备注" json:"remark"` // 备注
Module int32 `gorm:"column:module;type:int;not null;comment:模块" json:"module"` // 模块
Domain int32 `gorm:"column:domain;type:int;not null;comment:领域" json:"domain"` // 领域
Allow vobj.Allow `gorm:"column:allow;type:tinyint;not null;comment:允许类型" json:"allow"` // 放行规则
}
SysTeamAPI API资源管理
func (*SysTeamAPI) GetAllow ¶ added in v1.1.0
func (c *SysTeamAPI) GetAllow() vobj.Allow
GetAllow 获取放行规则
func (*SysTeamAPI) GetDomain ¶ added in v1.1.0
func (c *SysTeamAPI) GetDomain() int32
GetDomain 获取领域
func (*SysTeamAPI) GetModule ¶ added in v1.1.0
func (c *SysTeamAPI) GetModule() int32
GetModule 获取模块
func (*SysTeamAPI) GetRemark ¶ added in v1.1.0
func (c *SysTeamAPI) GetRemark() string
GetRemark 获取备注
func (*SysTeamAPI) GetStatus ¶ added in v1.1.0
func (c *SysTeamAPI) GetStatus() vobj.Status
GetStatus 获取状态
func (*SysTeamAPI) MarshalBinary ¶
func (c *SysTeamAPI) MarshalBinary() (data []byte, err error)
MarshalBinary redis 存储实现
func (*SysTeamAPI) UnmarshalBinary ¶
func (c *SysTeamAPI) UnmarshalBinary(data []byte) error
UnmarshalBinary redis 存储实现
type SysTeamMember ¶
type SysTeamMember struct {
AllFieldModel
UserID uint32 `` // 系统用户ID
/* 132-byte string literal not displayed */
Status vobj.Status `gorm:"column:status;type:int;not null;comment:状态" json:"status"` // 状态
Role vobj.Role `gorm:"column:role;type:int;not null;comment:是否是管理员" json:"role"` // 是否是管理员
TeamRoles []*SysTeamRole `gorm:"many2many:sys_team_member_roles" json:"team_roles"`
}
SysTeamMember mapped from table <sys_team_members>
func (*SysTeamMember) GetRole ¶ added in v1.2.16
func (c *SysTeamMember) GetRole() vobj.Role
GetRole 获取角色
func (*SysTeamMember) GetStatus ¶ added in v1.2.16
func (c *SysTeamMember) GetStatus() vobj.Status
GetStatus 获取状态
func (*SysTeamMember) GetTeamRoles ¶ added in v1.2.16
func (c *SysTeamMember) GetTeamRoles() []*SysTeamRole
GetTeamRoles 获取团队角色
func (*SysTeamMember) GetUserID ¶ added in v1.1.0
func (c *SysTeamMember) GetUserID() uint32
GetUserID get user id
func (*SysTeamMember) MarshalBinary ¶
func (c *SysTeamMember) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*SysTeamMember) TableName ¶
func (*SysTeamMember) TableName() string
TableName SysTeamMember's table name
func (*SysTeamMember) UnmarshalBinary ¶
func (c *SysTeamMember) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type SysTeamMemberRole ¶
type SysTeamMemberRole struct {
SysTeamMemberID uint32 `` // 团队用户ID
/* 175-byte string literal not displayed */
SysTeamRoleID uint32 `` // 团队角色ID
/* 171-byte string literal not displayed */
}
SysTeamMemberRole mapped from table <sys_team_member_roles>
func (*SysTeamMemberRole) TableName ¶
func (*SysTeamMemberRole) TableName() string
TableName SysTeamMemberRole's table name
type SysTeamMenu ¶
type SysTeamMenu struct {
AllFieldModel
Name string `gorm:"column:name;type:varchar(64);not null;uniqueIndex:idx__team_menu__name,priority:1;comment:菜单名称" json:"name"`
EnName string `` /* 133-byte string literal not displayed */
Path string `gorm:"column:path;type:varchar(255);not null;uniqueIndex:idx__team_menu__path,priority:1;comment:api路径" json:"path"`
Status vobj.Status `gorm:"column:status;type:tinyint;not null;comment:状态" json:"status"`
Icon string `gorm:"column:icon;type:varchar(255);not null;comment:图标" json:"icon"`
ParentID uint32 `gorm:"column:parent_id;type:int unsigned;not null;default:0;comment:父级ID" json:"parent_id"`
Level int32 `gorm:"column:level;type:int;not null;comment:层级" json:"level"`
Parent *SysTeamMenu `gorm:"foreignKey:ParentID;references:ID" json:"parent"`
}
SysTeamMenu mapped from table <sys_menus>
func (*SysTeamMenu) MarshalBinary ¶
func (c *SysTeamMenu) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*SysTeamMenu) TableName ¶
func (*SysTeamMenu) TableName() string
TableName SysAPI's table name
func (*SysTeamMenu) UnmarshalBinary ¶
func (c *SysTeamMenu) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type SysTeamRole ¶
type SysTeamRole struct {
AllFieldModel
Name string `gorm:"column:name;type:varchar(64);not null;comment:角色名称" json:"name"` // 角色名称
Status vobj.Status `gorm:"column:status;type:int;not null;comment:状态" json:"status"` // 状态
Remark string `gorm:"column:remark;type:varchar(255);not null;comment:备注" json:"remark"` // 备注
Apis []*SysTeamAPI `gorm:"many2many:sys_team_role_apis" json:"apis"`
Members []*SysTeamMember `gorm:"many2many:sys_team_member_roles" json:"members"`
}
SysTeamRole mapped from table <sys_team_roles>
func (*SysTeamRole) GetApis ¶ added in v1.2.16
func (c *SysTeamRole) GetApis() []*SysTeamAPI
GetApis 获取团队API
func (*SysTeamRole) GetMembers ¶ added in v1.2.16
func (c *SysTeamRole) GetMembers() []*SysTeamMember
GetMembers 获取团队成员
func (*SysTeamRole) GetName ¶ added in v1.2.16
func (c *SysTeamRole) GetName() string
GetName 获取角色名称
func (*SysTeamRole) GetRemark ¶ added in v1.2.16
func (c *SysTeamRole) GetRemark() string
GetRemark 获取备注
func (*SysTeamRole) GetStatus ¶ added in v1.2.16
func (c *SysTeamRole) GetStatus() vobj.Status
GetStatus 获取状态
func (*SysTeamRole) MarshalBinary ¶
func (c *SysTeamRole) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*SysTeamRole) TableName ¶
func (*SysTeamRole) TableName() string
TableName SysTeamRole's table name
func (*SysTeamRole) UnmarshalBinary ¶
func (c *SysTeamRole) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type SysTeamRoleAPI ¶
type SysTeamRoleAPI struct {
SysTeamRoleID uint32 `gorm:"primaryKey;column:sys_team_role_id;type:int unsigned;primaryKey" json:"sys_team_role_id"`
SysTeamAPIID uint32 `gorm:"primaryKey;column:sys_api_id;type:int unsigned;primaryKey" json:"sys_team_api_id"`
}
SysTeamRoleAPI mapped from table <sys_team_role_apis>
func (*SysTeamRoleAPI) TableName ¶
func (*SysTeamRoleAPI) TableName() string
TableName SysTeamRoleAPI's table name
type TimeEngine ¶ added in v1.2.0
type TimeEngine struct {
AllFieldModel
Name string `gorm:"column:name;type:varchar(64);not null;comment:规则名称" json:"name"` // 规则名称
Remark string `gorm:"column:remark;type:varchar(255);not null;comment:备注" json:"remark"` // 备注
Status vobj.Status `gorm:"column:status;type:int;not null;comment:状态" json:"status"` // 状态
Rules []*TimeEngineRule `gorm:"many2many:time_engine_rule_relation;" json:"rules"`
}
TimeEngine 时间引擎
func (*TimeEngine) GetRemark ¶ added in v1.2.16
func (c *TimeEngine) GetRemark() string
GetRemark 获取备注
func (*TimeEngine) GetRules ¶ added in v1.2.16
func (c *TimeEngine) GetRules() []*TimeEngineRule
GetRules 获取规则
func (*TimeEngine) GetStatus ¶ added in v1.2.16
func (c *TimeEngine) GetStatus() vobj.Status
GetStatus 获取状态
func (*TimeEngine) IsAllowed ¶ added in v1.2.0
func (c *TimeEngine) IsAllowed(time time.Time) bool
IsAllowed 判断条件是否允许
func (*TimeEngine) MarshalBinary ¶ added in v1.2.0
func (c *TimeEngine) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*TimeEngine) TableName ¶ added in v1.2.0
func (*TimeEngine) TableName() string
TableName SysTeamRole's table name
func (*TimeEngine) UnmarshalBinary ¶ added in v1.2.0
func (c *TimeEngine) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type TimeEngineRule ¶ added in v1.2.0
type TimeEngineRule struct {
AllFieldModel
Name string `gorm:"column:name;type:varchar(64);not null;comment:规则名称" json:"name"` // 规则名称
Remark string `gorm:"column:remark;type:varchar(255);not null;comment:备注" json:"remark"` // 备注
Status vobj.Status `gorm:"column:status;type:int;not null;comment:状态" json:"status"` // 状态
Category vobj.TimeEngineRuleType `gorm:"column:category;type:int;not null;comment:规则类型" json:"category"` // 规则类型
Rule string `gorm:"column:rule;type:text;not null;comment:规则,分割数字" json:"rule"` // 规则
}
TimeEngineRule 时间引擎规则
func (*TimeEngineRule) GetCategory ¶ added in v1.2.16
func (c *TimeEngineRule) GetCategory() vobj.TimeEngineRuleType
GetCategory 获取规则类型
func (*TimeEngineRule) GetName ¶ added in v1.2.16
func (c *TimeEngineRule) GetName() string
GetName 获取规则名称
func (*TimeEngineRule) GetRemark ¶ added in v1.2.16
func (c *TimeEngineRule) GetRemark() string
GetRemark 获取备注
func (*TimeEngineRule) GetRule ¶ added in v1.2.16
func (c *TimeEngineRule) GetRule() string
GetRule 获取规则
func (*TimeEngineRule) GetStatus ¶ added in v1.2.16
func (c *TimeEngineRule) GetStatus() vobj.Status
GetStatus 获取状态
func (*TimeEngineRule) MarshalBinary ¶ added in v1.2.0
func (c *TimeEngineRule) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*TimeEngineRule) Matcher ¶ added in v1.2.0
func (c *TimeEngineRule) Matcher() types.Matcher
Matcher 匹配器
func (*TimeEngineRule) String ¶ added in v1.2.0
func (c *TimeEngineRule) String() string
String json string
func (*TimeEngineRule) TableName ¶ added in v1.2.0
func (*TimeEngineRule) TableName() string
TableName SysTeamRole's table name
func (*TimeEngineRule) UnmarshalBinary ¶ added in v1.2.0
func (c *TimeEngineRule) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
Source Files
¶
- alarm_group.go
- alarm_hook.go
- alarm_notice_member.go
- alarm_page_self.go
- base_model.go
- casbin_rule.gen.go
- dashboard.go
- dashboard_chart.go
- dashboard_self.go
- datasource.go
- datasource_metrics.go
- init.go
- metric_labels.go
- send_strategy.go
- strategy.go
- strategy_group.go
- strategy_group_categories.go
- strategy_label_notice.go
- strategy_level_domain.go
- strategy_level_event.go
- strategy_level_http.go
- strategy_level_metric.go
- strategy_level_ping.go
- strategy_level_port.go
- strategy_level_template.go
- strategy_levels.go
- strategy_logs_level.go
- strategy_subscribers.go
- strategy_template.go
- sys_dict.go
- sys_send_template.go
- sys_team_apis.go
- sys_team_member_roles.go
- sys_team_members.go
- sys_team_menu.go
- sys_team_role_apis.go
- sys_team_roles.go
- time_engine.go
- time_engine_rule.go