Documentation ¶
Index ¶
- func Models() []any
- type AlarmHook
- type AlarmNoticeGroup
- type AlarmNoticeMember
- type AlarmPageSelf
- type CasbinRule
- type Dashboard
- type DashboardChart
- type DashboardSelf
- type Datasource
- type DatasourceMetric
- type MetricLabel
- type MqDatasource
- type SendStrategy
- type Strategy
- type StrategyDomain
- type StrategyGroup
- type StrategyGroupCategories
- type StrategyHTTP
- type StrategyLevelTemplate
- type StrategyMQLevel
- type StrategyMetricsLabelNotice
- type StrategyMetricsLevel
- type StrategyPing
- type StrategySubscriber
- 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) String() string
- func (*SysDict) TableName() string
- 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
- type SysTeamMemberRole
- type SysTeamMenu
- type SysTeamRole
- type SysTeamRoleAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AlarmHook ¶
type AlarmHook struct { model.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 { model.AllFieldModel DeletedAt soft_delete.DeletedAt `` /* 127-byte string literal not displayed */ Name string `` /* 133-byte string literal not displayed */ Status vobj.Status `gorm:"column:status;type:tinyint;not null;default:1;comment:启用状态1:启用;2禁用" json:"status"` Remark string `gorm:"column:remark;type:varchar(255);not null;comment:描述信息" json:"remark"` NoticeMembers []*AlarmNoticeMember `gorm:"foreignKey:AlarmGroupID;comment:通知人信息中间表" json:"notice_members"` AlarmHooks []*AlarmHook `gorm:"many2many:alarm_group_hook" json:"alarm_hooks"` }
AlarmNoticeGroup 告警通知组
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 { model.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 { model.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 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 { model.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 { model.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"` ChartType vobj.DashboardChartType `gorm:"column:chart_type;type:int;not null;comment:图表类型" json:"chart_type"` 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"` }
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 { model.AllFieldModel DashboardID uint `` /* 144-byte string literal not displayed */ UserID uint `` /* 131-byte string literal not displayed */ MemberID uint `gorm:"column:member_id;type:int unsigned;not null;comment:成员ID" json:"member_id"` Sort uint `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 { model.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 string `gorm:"column:config;type:text;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 { model.AllFieldModel Name string `` /* 127-byte string literal not displayed */ Category vobj.MetricType `gorm:"column:category;type:int;not null;comment:指标类型(对应prometheus四种数据类型)" json:"category"` 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 `` // 所属数据源 /* 148-byte string literal not displayed */ // 更新时间 DeletedAt soft_delete.DeletedAt `` // 删除时间 /* 133-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 { model.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 MqDatasource ¶ added in v1.1.37
type MqDatasource struct { model.AllFieldModel Name string `gorm:"column:name;type:varchar(64);not null;comment:数据源名称" json:"name"` // mq数据源名称 DatasourceType vobj.DatasourceType `gorm:"column:datasource_type;type:int;not null;comment:数据源类型" json:"datasourceType"` // 数据源类型 StorageType vobj.StorageType `gorm:"column:storage_type;type:int;not null;comment:存储类型" json:"storageType"` Config string `gorm:"column:config;type:text;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"` // 描述信息 }
MqDatasource mapped from table <datasource>
func (*MqDatasource) MarshalBinary ¶ added in v1.1.37
func (c *MqDatasource) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*MqDatasource) String ¶ added in v1.1.37
func (c *MqDatasource) String() string
String json string
func (*MqDatasource) TableName ¶ added in v1.1.37
func (*MqDatasource) TableName() string
TableName MqDatasource's table name
func (*MqDatasource) UnmarshalBinary ¶ added in v1.1.37
func (c *MqDatasource) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type SendStrategy ¶
type SendStrategy struct { model.AllFieldModel Name string `gorm:"column:name;type:varchar(64);not null;comment:策略名称" json:"name"` // 标签组 Labels vobj.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 { model.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 *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"` 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"` }
Strategy mapped from table <Strategy>
func (*Strategy) MarshalBinary ¶
MarshalBinary redis存储实现
func (*Strategy) UnmarshalBinary ¶
UnmarshalBinary redis存储实现
type StrategyDomain ¶ added in v1.1.0
type StrategyDomain struct { model.AllFieldModel // 所属策略 StrategyID uint32 `` /* 135-byte string literal not displayed */ Strategy *Strategy `gorm:"foreignKey:StrategyID" json:"strategy"` // 告警等级ID LevelID uint32 `gorm:"column:level_id;type:int unsigned;not null;comment:告警等级ID" json:"level_id"` Level *SysDict `gorm:"foreignKey:LevelID" json:"level"` // 执行频率 Interval uint32 `gorm:"column:interval;type:int unsigned;not null;comment:执行频率seconds" json:"interval"` // 阈值 (证书类型就是剩余天数,端口就是0:关闭,1:开启) Threshold uint32 `gorm:"column:threshold;type:int unsigned;not null;comment:阈值" json:"threshold"` // 策略告警组 AlarmNoticeGroups []*AlarmNoticeGroup `gorm:"many2many:strategy_domain_alarm_groups;" json:"alarm_groups"` }
StrategyDomain 域名证书|端口 等级策略明细
func (*StrategyDomain) MarshalBinary ¶ added in v1.1.0
func (s *StrategyDomain) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategyDomain) TableName ¶ added in v1.1.0
func (*StrategyDomain) TableName() string
TableName 表名
func (*StrategyDomain) UnmarshalBinary ¶ added in v1.1.0
func (s *StrategyDomain) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategyGroup ¶
type StrategyGroup struct { model.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:"column:strategy_group_id;type:int unsigned;primaryKey" json:"strategy_group_id"` SysDictID uint32 `gorm:"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 StrategyHTTP ¶ added in v1.1.37
type StrategyHTTP struct { model.AllFieldModel // 所属策略 StrategyID uint32 `` /* 133-byte string literal not displayed */ Strategy *Strategy `gorm:"foreignKey:StrategyID" json:"strategy"` // 告警等级ID LevelID uint32 `gorm:"column:level_id;type:int unsigned;not null;comment:告警等级ID" json:"level_id"` Level *SysDict `gorm:"foreignKey:LevelID" json:"level"` // 执行频率 Interval uint32 `gorm:"column:interval;type:int unsigned;not null;comment:执行频率seconds" json:"interval"` // 策略告警组 AlarmNoticeGroups []*AlarmNoticeGroup `gorm:"many2many:strategy_http_alarm_groups;" json:"alarm_groups"` // 状态码 StatusCodes []int `gorm:"column:status_codes;type:JSON;not null;comment:状态码" json:"status_codes"` // 响应时间 ResponseTime int `gorm:"column:response_time;type:int;not null;comment:响应时间" json:"response_time"` // 请求头 Headers map[string]string `gorm:"column:headers;type:JSON;not null;comment:请求头" json:"headers"` // 请求body Body string `gorm:"column:body;type:varchar(512);not null;comment:请求body" json:"body"` // 请求方式 Method vobj.HTTPMethod `gorm:"column:method;type:int;not null;comment:请求方式" json:"method"` }
StrategyHTTP HTTP监控策略定义, 用于监控指定URL的响应时间、状态码
func (*StrategyHTTP) MarshalBinary ¶ added in v1.1.37
func (s *StrategyHTTP) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategyHTTP) TableName ¶ added in v1.1.37
func (*StrategyHTTP) TableName() string
TableName 表名
func (*StrategyHTTP) UnmarshalBinary ¶ added in v1.1.37
func (s *StrategyHTTP) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategyLevelTemplate ¶
type StrategyLevelTemplate struct { model.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 StrategyMQLevel ¶ added in v1.1.38
type StrategyMQLevel struct { model.AllFieldModel // 值 Value string `gorm:"column:value;type:varchar(255);not null;comment:MQ值" json:"value"` // 数据类型 DataType vobj.MQDataType `gorm:"column:data_type;type:int;not null;comment:数据类型" json:"data_type"` // 条件 Condition vobj.MQCondition `gorm:"column:condition;type:int;not null;comment:条件" json:"condition"` // 所属策略 StrategyID uint32 `` /* 129-byte string literal not displayed */ Strategy *Strategy `gorm:"foreignKey:StrategyID" json:"strategy"` // 告警等级 AlarmLevelID uint32 `` /* 141-byte string literal not displayed */ AlarmLevel *SysDict `gorm:"foreignKey:AlarmLevelID" json:"alarmLevel"` // 状态 Status vobj.Status `gorm:"column:status;type:int;not null;default:1;comment:策略状态" json:"status"` // 告警页面 AlarmPage []*SysDict `gorm:"many2many:strategy_mq_level_alarm_pages" json:"alarm_page"` // 策略告警组 AlarmGroups []*AlarmNoticeGroup `gorm:"many2many:strategy_mq_level_alarm_groups;" json:"alarm_groups"` // object path key PathKey string `gorm:"column:path_key;path_key:varchar(255);not null;comment:objectPathKey" json:"path_key"` }
StrategyMQLevel MQ策略等级
func (*StrategyMQLevel) MarshalBinary ¶ added in v1.1.38
func (c *StrategyMQLevel) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategyMQLevel) String ¶ added in v1.1.38
func (c *StrategyMQLevel) String() string
String json string
func (*StrategyMQLevel) TableName ¶ added in v1.1.38
func (*StrategyMQLevel) TableName() string
TableName StrategyMQLevel's table name
func (*StrategyMQLevel) UnmarshalBinary ¶ added in v1.1.38
func (c *StrategyMQLevel) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategyMetricsLabelNotice ¶ added in v1.1.38
type StrategyMetricsLabelNotice struct { model.AllFieldModel // label key Name string `gorm:"column:name;type:varchar(255);not null;comment:label名称;uniqueIndex:idx__level_id__name" json:"name"` // label value Value string `gorm:"column:value;type:varchar(255);not null;comment:标签值" json:"value"` // 策略等级ID LevelID uint32 `gorm:"column:level_id;type:int unsigned;not null;comment:策略等级ID;uniqueIndex:idx__level_id__name" json:"level_id"` // labels告警组 AlarmGroups []*AlarmNoticeGroup `gorm:"many2many:strategy_metrics_labels_alarm_groups;" 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) TableName ¶ added in v1.1.38
func (*StrategyMetricsLabelNotice) TableName() string
TableName StrategyLabelNotice 's table name
func (*StrategyMetricsLabelNotice) UnmarshalBinary ¶ added in v1.1.38
func (c *StrategyMetricsLabelNotice) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategyMetricsLevel ¶ added in v1.1.38
type StrategyMetricsLevel struct { model.AllFieldModel // 所属策略 StrategyID uint32 `` /* 127-byte string literal not displayed */ Strategy *Strategy `gorm:"foreignKey:StrategyID" json:"strategy"` // 持续时间 Duration int64 `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 int64 `gorm:"column:interval;type:bigint(20);not null;comment:执行频率" json:"interval"` // 条件 Condition vobj.Condition `gorm:"column:condition;type:int;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:告警等级;uniqueIndex:idx__strategy_id__level_id" json:"level_id"` Level *SysDict `gorm:"foreignKey:LevelID" json:"level"` // 状态 Status vobj.Status `gorm:"column:status;type:int;not null;default:1;comment:策略状态" json:"status"` // 告警页面 AlarmPage []*SysDict `gorm:"many2many:strategy_metrics_level_alarm_pages" json:"alarm_page"` // 策略告警组 AlarmGroups []*AlarmNoticeGroup `gorm:"many2many:strategy_metrics_level_alarm_groups;" json:"alarm_groups"` // 策略labels LabelNotices []*StrategyMetricsLabelNotice `gorm:"foreignKey:LevelID;" json:"label_notices"` }
StrategyMetricsLevel 策略等级
func (*StrategyMetricsLevel) MarshalBinary ¶ added in v1.1.38
func (c *StrategyMetricsLevel) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategyMetricsLevel) String ¶ added in v1.1.38
func (c *StrategyMetricsLevel) String() string
String json string
func (*StrategyMetricsLevel) TableName ¶ added in v1.1.38
func (*StrategyMetricsLevel) TableName() string
TableName StrategyMetricsLevel's table name
func (*StrategyMetricsLevel) UnmarshalBinary ¶ added in v1.1.38
func (c *StrategyMetricsLevel) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategyPing ¶ added in v1.1.0
type StrategyPing struct { model.AllFieldModel // 所属策略 StrategyID uint32 `` /* 133-byte string literal not displayed */ Strategy *Strategy `gorm:"foreignKey:StrategyID" json:"strategy"` // 告警等级ID LevelID uint32 `gorm:"column:level_id;type:int unsigned;not null;comment:告警等级ID" json:"level_id"` Level *SysDict `gorm:"foreignKey:LevelID" json:"level"` // 执行频率 Interval uint32 `gorm:"column:interval;type:int unsigned;not null;comment:执行频率seconds" json:"interval"` // 策略告警组 AlarmNoticeGroups []*AlarmNoticeGroup `gorm:"many2many:strategy_ping_alarm_groups;" json:"alarm_groups"` // 总包数 Total uint32 `gorm:"column:total;type:int unsigned;not null;comment:总包数" json:"total"` // 成功包数 Success uint32 `gorm:"column:success;type:int unsigned;not null;comment:成功包数" json:"success"` // 丢包率 LossRate float64 `gorm:"column:loss_rate;type:float;not null;comment:丢包率" json:"loss_rate"` // 平均延迟 AvgDelay uint32 `gorm:"column:avg_delay;type:int unsigned;not null;comment:平均延迟" json:"avg_delay"` // 最大延迟 MaxDelay uint32 `gorm:"column:max_delay;type:int unsigned;not null;comment:最大延迟" json:"max_delay"` // 最小延迟 MinDelay uint32 `gorm:"column:min_delay;type:int unsigned;not null;comment:最小延迟" json:"min_delay"` // 标准差 StdDev uint32 `gorm:"column:std_dev;type:int unsigned;not null;comment:标准差" json:"std_dev"` }
StrategyPing Ping监控策略定义, 用于监控指定IP的网络延迟、丢包率等
func (*StrategyPing) MarshalBinary ¶ added in v1.1.0
func (s *StrategyPing) MarshalBinary() (data []byte, err error)
MarshalBinary redis存储实现
func (*StrategyPing) TableName ¶ added in v1.1.0
func (*StrategyPing) TableName() string
TableName 表名
func (*StrategyPing) UnmarshalBinary ¶ added in v1.1.0
func (s *StrategyPing) UnmarshalBinary(data []byte) error
UnmarshalBinary redis存储实现
type StrategySubscriber ¶
type StrategySubscriber struct { model.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) 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 { model.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 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"` // 告警等级数据 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 { model.AllFieldModel Name string `gorm:"column:name;type:varchar(100);not null;uniqueIndex:idx__p__name__dict,priority:1;comment:字典名称"` Value string `gorm:"column:value;type:varchar(100);not null;default:'';comment:字典键值"` DictType vobj.DictType `` /* 135-byte string literal not displayed */ ColorType string `gorm:"column:color_type;type:varchar(32);not null;default:hex;comment:颜色类型"` CSSClass string `gorm:"column:css_class;type:varchar(100);not null;default:#165DFF;comment:css 样式"` Icon string `gorm:"column:icon;type:varchar(500);default:'';comment:图标"` ImageURL string `gorm:"column:image_url;type:varchar(500);default:'';comment:图片url"` Status vobj.Status `gorm:"column:status;type:tinyint;not null;default:1;comment:状态 1:开启 2:关闭"` LanguageCode vobj.Language `gorm:"column:language_code;type:tinyint;not null;default:1;comment:语言:zh-CN:中文 en-US:英文"` Remark string `gorm:"column:remark;type:varchar(500);not null;comment:字典备注"` StrategyMetricsLevel []*StrategyMetricsLevel `gorm:"many2many:strategy_metrics_level_alarm_pages" json:"strategy_levels"` }
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
type SysTeamAPI ¶
type SysTeamAPI struct { model.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 { model.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) 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 { model.BaseModel SysTeamMemberID uint32 `` // 团队用户ID /* 164-byte string literal not displayed */ SysTeamRoleID uint32 `` // 团队角色ID /* 160-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 { model.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 { model.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) 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 { model.BaseModel SysTeamRoleID uint32 `gorm:"column:sys_team_role_id;type:int unsigned;primaryKey" json:"sys_team_role_id"` SysTeamAPIID uint32 `gorm:"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
Source Files ¶
- alarm_group.go
- alarm_hook.go
- alarm_notice_member.go
- alarm_page_self.go
- casbin_rule.gen.go
- dashboard.go
- dashboard_chart.go
- dashboard_self.go
- datasource.go
- datasource_metrics.go
- init.go
- metric_labels.go
- mq_datasource.go
- send_strategy.go
- strategy.go
- strategy_domain.go
- strategy_group.go
- strategy_group_categories.go
- strategy_http.go
- strategy_labels.go
- strategy_level_template.go
- strategy_metrics_level.go
- strategy_mq_level.go
- strategy_ping.go
- strategy_subscribers.go
- strategy_template.go
- sys_dict.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