bizmodel

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlarmModels

func AlarmModels() []any

AlarmModels 注册biz model下告警相关模型

func Models

func Models() []any

Models 注册biz model下全部模型

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

func (c *AlarmHook) MarshalBinary() (data []byte, err error)

MarshalBinary redis存储实现

func (*AlarmHook) String

func (c *AlarmHook) String() string

String json string

func (*AlarmHook) TableName

func (*AlarmHook) TableName() string

TableName AlarmHook's table name

func (*AlarmHook) UnmarshalBinary

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

UnmarshalBinary redis存储实现

type AlarmNoticeGroup

type AlarmNoticeGroup struct {
	model.AllFieldModel
	Name          string               `gorm:"column:name;type:varchar(64);not null;uniqueIndex:idx__name,priority:1;comment:告警组名称" json:"name"`
	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 */
}

AlarmNoticeMember 告警通知用户

func (*AlarmNoticeMember) MarshalBinary

func (c *AlarmNoticeMember) MarshalBinary() (data []byte, err error)

MarshalBinary redis存储实现

func (*AlarmNoticeMember) TableName

func (*AlarmNoticeMember) TableName() string

TableName AlarmNoticeMember's table name

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

func (c *AlarmPageSelf) String() string

String json string

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

func (c *CasbinRule) String() string

String json string

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

func (c *Dashboard) MarshalBinary() (data []byte, err error)

MarshalBinary redis存储实现

func (*Dashboard) String

func (c *Dashboard) String() string

String json string

func (*Dashboard) TableName

func (*Dashboard) TableName() string

TableName Dashboard's table name

func (*Dashboard) UnmarshalBinary

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

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

func (c *DashboardChart) String() string

String json string

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

func (c *DashboardSelf) String() string

String json string

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:varchar(255);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"`      // 描述信息
	Metrics     []*DatasourceMetric `gorm:"foreignKey:DatasourceID" json:"metrics"`

	// 采样率
	Step uint32 `gorm:"column:step;type:int;not null;comment:采样率" json:"step"`
}

Datasource mapped from table <datasource>

func (*Datasource) MarshalBinary

func (c *Datasource) MarshalBinary() (data []byte, err error)

MarshalBinary redis存储实现

func (*Datasource) String

func (c *Datasource) String() string

String json string

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

func (c *DatasourceMetric) String() string

String json string

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 []*MetricLabelValue `gorm:"foreignKey:LabelID" json:"label_values"`
}

MetricLabel mapped from table <metric_labels>

func (*MetricLabel) MarshalBinary

func (c *MetricLabel) MarshalBinary() (data []byte, err error)

MarshalBinary redis存储实现

func (*MetricLabel) String

func (c *MetricLabel) String() string

String json string

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 MetricLabelValue

type MetricLabelValue struct {
	model.AllFieldModel
	Name    string `gorm:"column:name;type:varchar(255);not null;comment:值;uniqueIndex:idx__name__label_id__deleted_at,priority:3" json:"name"` // 数据源名称
	LabelID uint32 ``                                                                                                                           // 所属数据源
	/* 140-byte string literal not displayed */
	DeletedAt soft_delete.DeletedAt `` // 删除时间
	/* 139-byte string literal not displayed */
}

MetricLabelValue mapped from table <datasource_label_values>

func (*MetricLabelValue) MarshalBinary

func (c *MetricLabelValue) MarshalBinary() (data []byte, err error)

MarshalBinary redis存储实现

func (*MetricLabelValue) String

func (c *MetricLabelValue) String() string

String json string

func (*MetricLabelValue) TableName

func (*MetricLabelValue) TableName() string

TableName MetricLabelValue's table name

func (*MetricLabelValue) UnmarshalBinary

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

UnmarshalBinary redis存储实现

type RealtimeAlarm

type RealtimeAlarm struct {
	model.EasyModel
	// 发生这条告警的具体策略信息
	StrategyID uint32 `gorm:"column:strategy_id;type:int unsigned;not null;uniqueIndex:idx__ar__strategy_id,priority:1;comment:策略ID"`
	LevelID    uint32 `gorm:"column:level_id;type:int unsigned;not null;uniqueIndex:idx__ar__level_id,priority:1;comment:告警等级ID"`
	// 告警状态: 1告警;2恢复
	Status vobj.AlertStatus `gorm:"column:status;type:tinyint;not null;default:1;comment:告警状态: 1告警;2恢复"`
	// 告警时间
	StartsAt int64 `gorm:"column:starts_at;type:bigint;not null;comment:告警时间"`
	// 恢复时间
	EndsAt int64 `gorm:"column:ends_at;type:bigint;not null;comment:恢复时间"`
	// 原始信息json
	RawInfo string `gorm:"column:raw_info;type:text;not null;comment:原始信息json"`
	// 告警摘要
	Summary string `gorm:"column:summary;type:varchar(255);not null;comment:告警摘要"`
	// 告警明细
	Description string `gorm:"column:description;type:text;not null;comment:告警明细"`
	// 触发告警表达式
	Expr string `gorm:"column:expr;type:text;not null;comment:告警表达式"`
	// 数据源
	DatasourceID uint32 `gorm:"column:datasource_id;type:int unsigned;not null;comment:数据源ID"`
	// 指纹
	Fingerprint string `gorm:"column:fingerprint;type:varchar(255);not null;comment:fingerprint;uniqueIndex"`
}

RealtimeAlarm mapped from table <RealtimeAlarm>

func (*RealtimeAlarm) MarshalBinary

func (c *RealtimeAlarm) MarshalBinary() (data []byte, err error)

MarshalBinary redis存储实现

func (*RealtimeAlarm) String

func (c *RealtimeAlarm) String() string

String json string

func (*RealtimeAlarm) TableName

func (*RealtimeAlarm) TableName() string

TableName RealtimeAlarm's table name

func (*RealtimeAlarm) UnmarshalBinary

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

UnmarshalBinary redis存储实现

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

func (c *SendStrategy) String() string

String json string

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
	// 模板ID, 用于标记是否从模板创建而来
	TemplateID uint32 `gorm:"column:strategy_template_id;type:int unsigned;not null;comment:策略模板ID" json:"template_id"`
	GroupID    uint32 `gorm:"column:group_id;type:int unsigned;not null;comment:策略规则组ID;" json:"group_id"`
	// 策略模板来源(系统、团队)
	TemplateSource vobj.StrategyTemplateSource `` /* 131-byte string literal not displayed */
	Name           string                      `gorm:"column:alert;type:varchar(64);not null;comment:策略名称" json:"name"`
	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"`
	// 采样率
	Step uint32 `gorm:"column:step;type:int;not null;comment:采样率" json:"step"`

	Datasource []*Datasource `gorm:"many2many:strategy_datasource;" json:"datasource"`
	// 策略类型
	Categories []*SysDict       `gorm:"many2many:strategy_categories" json:"categories"`
	Levels     []*StrategyLevel `gorm:"foreignKey:StrategyID" json:"levels"`
	// 策略告警组
	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

func (c *Strategy) MarshalBinary() (data []byte, err error)

MarshalBinary redis存储实现

func (*Strategy) String

func (c *Strategy) String() string

String json string

func (*Strategy) TableName

func (*Strategy) TableName() string

TableName Strategy's table name

func (*Strategy) UnmarshalBinary

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

UnmarshalBinary redis存储实现

type StrategyGroup

type StrategyGroup struct {
	model.AllFieldModel
	Name       string      `gorm:"column:name;type:varchar(64);not null;uniqueIndex:idx__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 StrategyLabelNotice

type StrategyLabelNotice 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:strategies_labels_alarm_groups;" json:"alarm_groups"`
}

StrategyLabelNotice 策略labels表

func (*StrategyLabelNotice) MarshalBinary

func (c *StrategyLabelNotice) MarshalBinary() (data []byte, err error)

MarshalBinary redis存储实现

func (*StrategyLabelNotice) TableName

func (*StrategyLabelNotice) TableName() string

TableName StrategyLabelNotice 's table name

func (*StrategyLabelNotice) UnmarshalBinary

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

UnmarshalBinary redis存储实现

type StrategyLevel

type StrategyLevel 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;comment:策略状态" json:"status"`
	// 告警页面
	AlarmPage []*SysDict `gorm:"many2many:strategy_level_alarm_pages" json:"alarm_page"`
	// 策略告警组
	AlarmGroups []*AlarmNoticeGroup `gorm:"many2many:strategy_level_alarm_groups;" json:"alarm_groups"`
	// 策略labels
	LabelNotices []*StrategyLabelNotice `gorm:"foreignKey:LevelID;" json:"label_notices"`
}

StrategyLevel 策略等级

func (*StrategyLevel) MarshalBinary

func (c *StrategyLevel) MarshalBinary() (data []byte, err error)

MarshalBinary redis存储实现

func (*StrategyLevel) String

func (c *StrategyLevel) String() string

String json string

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

func (c *StrategyTemplate) String() string

String json string

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:warning;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:字典备注"`
}

SysDict 字典数据

func (*SysDict) GetCSSClass

func (c *SysDict) GetCSSClass() string

GetCSSClass get css class

func (*SysDict) GetColorType

func (c *SysDict) GetColorType() string

GetColorType get color type

func (*SysDict) GetCreatedAt

func (c *SysDict) GetCreatedAt() *types.Time

GetCreatedAt get created at

func (*SysDict) GetCreatorID

func (c *SysDict) GetCreatorID() uint32

GetCreatorID get creator id

func (*SysDict) GetDeletedAt

func (c *SysDict) GetDeletedAt() soft_delete.DeletedAt

GetDeletedAt get deleted at

func (*SysDict) GetDictType

func (c *SysDict) GetDictType() vobj.DictType

GetDictType get dict type

func (*SysDict) GetID

func (c *SysDict) GetID() uint32

GetID get id

func (*SysDict) GetIcon

func (c *SysDict) GetIcon() string

GetIcon get icon

func (*SysDict) GetImageURL

func (c *SysDict) GetImageURL() string

GetImageURL get image url

func (*SysDict) GetLanguageCode

func (c *SysDict) GetLanguageCode() vobj.Language

GetLanguageCode get language code

func (*SysDict) GetName

func (c *SysDict) GetName() string

GetName get name

func (*SysDict) GetRemark

func (c *SysDict) GetRemark() string

GetRemark get remark

func (*SysDict) GetStatus

func (c *SysDict) GetStatus() vobj.Status

GetStatus get status

func (*SysDict) GetUpdatedAt

func (c *SysDict) GetUpdatedAt() *types.Time

GetUpdatedAt get updated at

func (*SysDict) GetValue

func (c *SysDict) GetValue() string

GetValue get value

func (*SysDict) String

func (c *SysDict) String() string

String json string

func (*SysDict) TableName

func (*SysDict) TableName() string

TableName SysDict's table name

type SysTeamAPI

type SysTeamAPI struct {
	model.AllFieldModel
	Name   string      `gorm:"column:name;type:varchar(64);not null;uniqueIndex:idx__sa__name,priority:1;comment:api名称" json:"name"`  // api名称
	Path   string      `gorm:"column:path;type:varchar(255);not null;uniqueIndex:idx__sa__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"`                                              // 领域
}

SysTeamAPI mapped from table <sys_apis>

func (*SysTeamAPI) MarshalBinary

func (c *SysTeamAPI) MarshalBinary() (data []byte, err error)

MarshalBinary redis 存储实现

func (*SysTeamAPI) String

func (c *SysTeamAPI) String() string

String json string

func (*SysTeamAPI) TableName

func (*SysTeamAPI) TableName() string

TableName SysTeamAPI's table name

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 */
	TeamID uint32 `` // 团队ID
	/* 126-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) MarshalBinary

func (c *SysTeamMember) MarshalBinary() (data []byte, err error)

MarshalBinary redis存储实现

func (*SysTeamMember) String

func (c *SysTeamMember) String() string

String json string

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

func (c *SysTeamMemberRole) String() string

String json string

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__sa__name,priority:1;comment:菜单名称" json:"name"`
	EnName   string      `` /* 126-byte string literal not displayed */
	Path     string      `gorm:"column:path;type:varchar(255);not null;uniqueIndex:idx__sa__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) String

func (c *SysTeamMenu) String() string

String json string

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
	TeamID uint32        `gorm:"column:team_id;type:int unsigned;not null;comment:团队ID" json:"team_id"` // 团队ID
	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"`
}

SysTeamRole mapped from table <sys_team_roles>

func (*SysTeamRole) MarshalBinary

func (c *SysTeamRole) MarshalBinary() (data []byte, err error)

MarshalBinary redis存储实现

func (*SysTeamRole) String

func (c *SysTeamRole) String() string

String json string

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

func (c *SysTeamRoleAPI) String() string

String json string

func (*SysTeamRoleAPI) TableName

func (*SysTeamRoleAPI) TableName() string

TableName SysTeamRoleAPI's table name

Jump to

Keyboard shortcuts

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