bizmodel

package
v1.1.26 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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

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: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"`      // 描述信息
	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 */
	// 标签数量
	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) 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 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) 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 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
	// 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"`
	// 采样率
	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"`
	// metric类型策略明细
	Levels []*StrategyLevel `gorm:"foreignKey:StrategyID" json:"levels"`
	// 域名证书|端口 等级策略明细
	DomainLevels []*StrategyDomain `gorm:"foreignKey:StrategyID" json:"domain_levels"`
	// http 协议状态码响应时间 等级策略明细
	HttpLevels []*StrategyHttp `gorm:"foreignKey:StrategyID" json:"http_levels"`
	// 网络连通性 等级策略明细
	PingLevels []*StrategyPing `gorm:"foreignKey:StrategyID" json:"ping_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 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"`
}

func (*StrategyDomain) MarshalBinary added in v1.1.0

func (s *StrategyDomain) MarshalBinary() (data []byte, err error)

MarshalBinary redis存储实现

func (*StrategyDomain) String added in v1.1.0

func (s *StrategyDomain) String() string

String 字符串

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.0

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"`
}

func (*StrategyHttp) MarshalBinary added in v1.1.0

func (s *StrategyHttp) MarshalBinary() (data []byte, err error)

MarshalBinary redis存储实现

func (*StrategyHttp) String added in v1.1.0

func (s *StrategyHttp) String() string

String 字符串

func (*StrategyHttp) TableName added in v1.1.0

func (*StrategyHttp) TableName() string

TableName 表名

func (*StrategyHttp) UnmarshalBinary added in v1.1.0

func (s *StrategyHttp) 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;default:1;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 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"`
}

func (*StrategyPing) MarshalBinary added in v1.1.0

func (s *StrategyPing) MarshalBinary() (data []byte, err error)

MarshalBinary redis存储实现

func (*StrategyPing) String added in v1.1.0

func (s *StrategyPing) String() string

String 字符串

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) 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:字典备注"`

	StrategyLevels []*StrategyLevel `gorm:"many2many:strategy_level_alarm_pages" json:"strategy_levels"`
}

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) 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) 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__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 mapped from table <sys_apis>

func (*SysTeamAPI) GetAllow added in v1.1.0

func (c *SysTeamAPI) GetAllow() vobj.Allow

func (*SysTeamAPI) GetDomain added in v1.1.0

func (c *SysTeamAPI) GetDomain() int32

func (*SysTeamAPI) GetModule added in v1.1.0

func (c *SysTeamAPI) GetModule() int32

func (*SysTeamAPI) GetName added in v1.1.0

func (c *SysTeamAPI) GetName() string

func (*SysTeamAPI) GetPath added in v1.1.0

func (c *SysTeamAPI) GetPath() string

func (*SysTeamAPI) GetRemark added in v1.1.0

func (c *SysTeamAPI) GetRemark() string

func (*SysTeamAPI) GetStatus added in v1.1.0

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

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