bizmodel

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 13 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 {
	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 {
	AllFieldModel
	DeletedAt     soft_delete.DeletedAt `` /* 137-byte string literal not displayed */
	Name          string                `` /* 143-byte string literal not displayed */
	Status        vobj.Status           `gorm:"column:status;type:tinyint;not null;default:1;comment:启用状态1:启用;2禁用" json:"status,omitempty"`
	Remark        string                `gorm:"column:remark;type:varchar(255);not null;comment:描述信息" json:"remark,omitempty"`
	NoticeMembers []*AlarmNoticeMember  `gorm:"foreignKey:AlarmGroupID;comment:通知人信息中间表" json:"notice_members,omitempty"`
	AlarmHooks    []*AlarmHook          `gorm:"many2many:alarm_group_hook" json:"alarm_hooks,omitempty"`
	TimeEngines   []*TimeEngine         `gorm:"many2many:alarm_group_time_engine" json:"time_engines,omitempty"`
}

AlarmNoticeGroup 告警通知组

func (*AlarmNoticeGroup) IsAllowed added in v1.2.0

func (c *AlarmNoticeGroup) IsAllowed(t time.Time) bool

IsAllowed 判断条件是否允许

func (*AlarmNoticeGroup) MarshalBinary

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

MarshalBinary redis存储实现

func (*AlarmNoticeGroup) TableName

func (*AlarmNoticeGroup) TableName() string

TableName AlarmNoticeGroup's table name

func (*AlarmNoticeGroup) UnmarshalBinary

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

UnmarshalBinary redis存储实现

type AlarmNoticeMember

type AlarmNoticeMember struct {
	AllFieldModel
	AlarmGroup      *AlarmNoticeGroup     `gorm:"foreignKey:AlarmGroupID" json:"alarm_group"`
	AlarmNoticeType vobj.NotifyType       `gorm:"column:notice_type;type:int;not null;comment:通知类型;" json:"alarm_notice_type"`
	MemberID        uint32                `` /* 136-byte string literal not displayed */
	AlarmGroupID    uint32                `` /* 140-byte string literal not displayed */
	DeletedAt       soft_delete.DeletedAt `` /* 132-byte string literal not displayed */
	Member          *SysTeamMember        `gorm:"foreignKey:MemberID" json:"member"`
}

AlarmNoticeMember 告警通知用户

func (*AlarmNoticeMember) GetMember added in v1.1.0

func (c *AlarmNoticeMember) GetMember() *SysTeamMember

GetMember 获取通知人

func (*AlarmNoticeMember) MarshalBinary

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

MarshalBinary redis存储实现

func (*AlarmNoticeMember) TableName

func (*AlarmNoticeMember) TableName() string

TableName 表名

func (*AlarmNoticeMember) UnmarshalBinary

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

UnmarshalBinary redis存储实现

type AlarmPageSelf

type AlarmPageSelf struct {
	AllFieldModel
	UserID      uint32 `` /* 132-byte string literal not displayed */
	MemberID    uint32 `gorm:"column:member_id;type:int unsigned;not null;comment:成员ID" json:"member_id"`
	Sort        uint32 `gorm:"column:sort;type:int unsigned;not null;default:0;comment:排序(值越小越靠前, 默认为0)" json:"sort"`
	AlarmPageID uint32 `` /* 150-byte string literal not displayed */

	Member    *SysTeamMember `gorm:"foreignKey:MemberID" json:"member"`
	AlarmPage *SysDict       `gorm:"foreignKey:AlarmPageID" json:"alarm_page"`
}

AlarmPageSelf mapped from table <alarm_page_self>

func (*AlarmPageSelf) MarshalBinary

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

MarshalBinary redis存储实现

func (*AlarmPageSelf) 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 AllFieldModel added in v1.2.0

type AllFieldModel struct {
	model.AllFieldModel
	// TeamID 团队ID
	TeamID uint32 `gorm:"column:team_id;type:int unsigned;not null;comment:团队ID" json:"team_id"`
}

AllFieldModel 基础模型

func (*AllFieldModel) BeforeCreate added in v1.2.0

func (u *AllFieldModel) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate 创建前的hook

func (*AllFieldModel) GetTeamID added in v1.2.0

func (u *AllFieldModel) GetTeamID() uint32

GetTeamID 获取团队ID

type CasbinRule

type CasbinRule struct {
	ID    uint32 `gorm:"column:id;type:int unsigned;primaryKey;autoIncrement:true" json:"id"`
	Ptype string `gorm:"column:ptype;type:varchar(100);uniqueIndex:idx_casbin_rule,priority:1" json:"ptype"`
	V0    string `gorm:"column:v0;type:varchar(100);uniqueIndex:idx_casbin_rule,priority:2" json:"v0"`
	V1    string `gorm:"column:v1;type:varchar(100);uniqueIndex:idx_casbin_rule,priority:3" json:"v1"`
	V2    string `gorm:"column:v2;type:varchar(100);uniqueIndex:idx_casbin_rule,priority:4" json:"v2"`
	V3    string `gorm:"column:v3;type:varchar(100);uniqueIndex:idx_casbin_rule,priority:5" json:"v3"`
	V4    string `gorm:"column:v4;type:varchar(100);uniqueIndex:idx_casbin_rule,priority:6" json:"v4"`
	V5    string `gorm:"column:v5;type:varchar(100);uniqueIndex:idx_casbin_rule,priority:7" json:"v5"`
}

CasbinRule mapped from table <casbin_rule>

func (*CasbinRule) 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 {
	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 {
	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 {
	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 {
	AllFieldModel
	Name        string              `gorm:"column:name;type:varchar(64);not null;comment:数据源名称" json:"name"` // 数据源名称
	Category    vobj.DatasourceType `gorm:"column:category;type:int;not null;comment:数据源类型" json:"category"` // 数据源类型
	StorageType vobj.StorageType    `gorm:"column:storage_type;type:int;not null;comment:存储类型" json:"storage_type"`
	Config      *datasource.Config  `gorm:"column:config;type:JSON;not null;comment:数据源配置参数" json:"config"`           // 数据源配置参数
	Endpoint    string              `gorm:"column:endpoint;type:varchar(255);not null;comment:数据源地址" json:"endpoint"` // 数据源地址
	Status      vobj.Status         `gorm:"column:status;type:int;not null;comment:数据源状态" json:"status"`              // 数据源状态
	Remark      string              `gorm:"column:remark;type:varchar(255);not null;comment:描述信息" json:"remark"`      // 描述信息
}

Datasource mapped from table <datasource>

func (*Datasource) MarshalBinary

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

MarshalBinary redis存储实现

func (*Datasource) 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 {
	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 {
	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 {
	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 {
	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"`
	// 策略等级
	Level *StrategyLevel `gorm:"foreignKey:StrategyID" json:"level"`
}

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 StrategyDomainLevel added in v1.2.0

type StrategyDomainLevel struct {
	// 阈值 (证书类型就是剩余天数,端口就是0:关闭,1:开启)
	Threshold int64 `json:"threshold,omitempty"`
	// 判断条件
	Condition vobj.Condition `json:"condition,omitempty"`

	// 告警等级ID
	Level *SysDict `json:"level,omitempty"`
	// 告警页面
	AlarmPageList []*SysDict `json:"alarmPageList,omitempty"`
	// 策略告警组
	AlarmGroupList []*AlarmNoticeGroup `json:"alarm_groups,omitempty"`
}

StrategyDomainLevel 域名证书|端口 等级策略明细

func (*StrategyDomainLevel) MarshalBinary added in v1.2.0

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

MarshalBinary redis存储实现

func (*StrategyDomainLevel) String added in v1.2.0

func (s *StrategyDomainLevel) String() string

String 字符串

func (*StrategyDomainLevel) UnmarshalBinary added in v1.2.0

func (s *StrategyDomainLevel) UnmarshalBinary(data []byte) error

UnmarshalBinary redis存储实现

type StrategyEventLevel added in v1.2.0

type StrategyEventLevel struct {
	// 值
	Value string `json:"value,omitempty"`
	// 数据类型
	DataType vobj.EventDataType `json:"dataType,omitempty"`
	// 条件
	Condition vobj.EventCondition `json:"condition,omitempty"`
	// object path key
	PathKey string `json:"pathKey,omitempty"`

	// 告警等级ID
	Level *SysDict `json:"level,omitempty"`
	// 告警页面
	AlarmPageList []*SysDict `json:"alarmPageList,omitempty"`
	// 策略告警组
	AlarmGroupList []*AlarmNoticeGroup `json:"alarm_groups,omitempty"`
}

StrategyEventLevel 事件策略等级

func (*StrategyEventLevel) MarshalBinary added in v1.2.0

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

MarshalBinary redis存储实现

func (*StrategyEventLevel) String added in v1.2.0

func (c *StrategyEventLevel) String() string

String json string

func (*StrategyEventLevel) UnmarshalBinary added in v1.2.0

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

UnmarshalBinary redis存储实现

type StrategyGroup

type StrategyGroup struct {
	AllFieldModel
	DeletedAt  soft_delete.DeletedAt `gorm:"column:deleted_at;type:bigint;not null;default:0;uniqueIndex:idx__strategy_group__name,priority:2" json:"deleted_at"`
	Name       string                `gorm:"column:name;type:varchar(64);not null;uniqueIndex:idx__strategy_group__name,priority:1;comment:规则组名称"`
	Status     vobj.Status           `gorm:"column:status;type:tinyint;not null;default:1;comment:启用状态1:启用;2禁用"`
	Remark     string                `gorm:"column:remark;type:varchar(255);not null;comment:描述信息"`
	Strategies []*Strategy           `gorm:"foreignKey:GroupID"`
	Categories []*SysDict            `gorm:"many2many:strategy_group_categories" json:"categories"`
}

StrategyGroup 告警规则组

func (*StrategyGroup) MarshalBinary

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

MarshalBinary redis存储实现

func (*StrategyGroup) TableName

func (*StrategyGroup) TableName() string

TableName Strategy's table name

func (*StrategyGroup) UnmarshalBinary

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

UnmarshalBinary redis存储实现

type StrategyGroupCategories

type StrategyGroupCategories struct {
	StrategyGroupID uint32 `gorm:"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 StrategyHTTPLevel added in v1.2.0

type StrategyHTTPLevel struct {
	// 状态码
	StatusCode string `json:"statusCode,omitempty"`
	// 响应时间
	ResponseTime float64 `json:"responseTime,omitempty"`
	// 请求头
	Headers []*vobj.Header `json:"headers,omitempty"`
	// 请求body
	Body string `json:"body,omitempty"`
	// 请求方式
	Method vobj.HTTPMethod `json:"method,omitempty"`
	// 查询参数
	QueryParams string `json:"queryParams,omitempty"`
	// 状态码判断条件
	StatusCodeCondition vobj.Condition `json:"condition,omitempty"`
	// 响应时间判断条件
	ResponseTimeCondition vobj.Condition `json:"responseTimeCondition,omitempty"`

	// 告警等级ID
	Level *SysDict `json:"level,omitempty"`
	// 告警页面
	AlarmPageList []*SysDict `json:"alarmPageList,omitempty"`
	// 策略告警组
	AlarmGroupList []*AlarmNoticeGroup `json:"alarm_groups,omitempty"`
}

StrategyHTTPLevel HTTP监控策略定义, 用于监控指定URL的响应时间、状态码

func (*StrategyHTTPLevel) MarshalBinary added in v1.2.0

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

MarshalBinary redis存储实现

func (*StrategyHTTPLevel) String added in v1.2.0

func (s *StrategyHTTPLevel) String() string

String 字符串

func (*StrategyHTTPLevel) UnmarshalBinary added in v1.2.0

func (s *StrategyHTTPLevel) UnmarshalBinary(data []byte) error

UnmarshalBinary redis存储实现

type StrategyLevel

type StrategyLevel struct {
	AllFieldModel
	// StrategyType 策略类型
	StrategyType vobj.StrategyType `gorm:"column:strategy_type;type:int;not null;comment:策略类型" json:"strategy_type"`
	// 策略等级json
	RawInfo    string    `gorm:"column:raw_info;type:text;not null;comment:策略等级json"`
	StrategyID uint32    `` /* 127-byte string literal not displayed */
	Strategy   *Strategy `gorm:"foreignKey:StrategyID"`
	// 告警页面 + 告警等级
	DictList []*SysDict `gorm:"many2many:strategy_level_dict_list" json:"dictList"`
	// 告警组列表
	AlarmGroups []*AlarmNoticeGroup `gorm:"many2many:strategy_levels_alarm_groups"`

	// 映射数据
	StrategyMetricsLevelList []*StrategyMetricLevel `gorm:"-" json:"strategyMetricsLevelList,omitempty"`
	StrategyEventLevelList   []*StrategyEventLevel  `gorm:"-" json:"strategyMQLevelList,omitempty"`
	StrategyDomainLevelList  []*StrategyDomainLevel `gorm:"-" json:"strategyDomainList,omitempty"`
	StrategyPortLevelList    []*StrategyPortLevel   `gorm:"-" json:"strategyPortList,omitempty"`
	StrategyHTTPLevelList    []*StrategyHTTPLevel   `gorm:"-" json:"strategyHTTPList,omitempty"`
	StrategyPingLevelList    []*StrategyPingLevel   `gorm:"-" json:"strategyPingList,omitempty"`
	// contains filtered or unexported fields
}

StrategyLevel mapped from table <StrategyLevel>

func (*StrategyLevel) AfterFind added in v1.2.0

func (c *StrategyLevel) AfterFind(_ *gorm.DB) (err error)

AfterFind get strategy level

func (*StrategyLevel) GetAlarmPageList added in v1.2.0

func (c *StrategyLevel) GetAlarmPageList() []*SysDict

GetAlarmPageList 获取告警页面列表

func (*StrategyLevel) GetLevelByID added in v1.2.0

func (c *StrategyLevel) GetLevelByID(id uint32) string

GetLevelByID 获取等级

func (*StrategyLevel) 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 {
	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 StrategyMetricLevel added in v1.2.0

type StrategyMetricLevel struct {
	// 持续时间
	Duration int64 `json:"duration,omitempty"`
	// 持续次数
	Count uint32 `gorm:"column:count;type:int unsigned;not null;comment:持续次数" json:"count,omitempty"`
	// 持续事件类型
	SustainType vobj.Sustain `gorm:"column:sustain_type;type:int(11);not null;comment:持续类型" json:"sustain_type,omitempty"`
	// 条件
	Condition vobj.Condition `gorm:"column:condition;type:int;not null;comment:条件" json:"condition,omitempty"`
	// 阈值
	Threshold float64 `gorm:"column:threshold;type:text;not null;comment:阈值" json:"threshold"`

	Level           *SysDict                      `json:"level,omitempty"`
	AlarmPageList   []*SysDict                    `json:"alarm_page,omitempty"`
	AlarmGroupList  []*AlarmNoticeGroup           `json:"alarm_groups,omitempty"`
	LabelNoticeList []*StrategyMetricsLabelNotice `json:"label_notices,omitempty"`
}

StrategyMetricLevel 策略等级

func (*StrategyMetricLevel) MarshalBinary added in v1.2.0

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

MarshalBinary redis存储实现

func (*StrategyMetricLevel) String added in v1.2.0

func (c *StrategyMetricLevel) String() string

String json string

func (*StrategyMetricLevel) UnmarshalBinary added in v1.2.0

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

UnmarshalBinary redis存储实现

type StrategyMetricsLabelNotice added in v1.1.38

type StrategyMetricsLabelNotice struct {
	// label key
	Name string `json:"name"`
	// label value
	Value string `json:"value"`
	// labels告警组
	AlarmGroups []*AlarmNoticeGroup `json:"alarm_groups"`
}

StrategyMetricsLabelNotice 策略labels表

func (*StrategyMetricsLabelNotice) MarshalBinary added in v1.1.38

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

MarshalBinary redis存储实现

func (*StrategyMetricsLabelNotice) String added in v1.2.0

func (c *StrategyMetricsLabelNotice) String() string

String json 序列化实现

func (*StrategyMetricsLabelNotice) UnmarshalBinary added in v1.1.38

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

UnmarshalBinary redis存储实现

type StrategyPingLevel added in v1.2.0

type StrategyPingLevel struct {
	// 总包数
	Total uint32 `json:"total,omitempty"`
	// 成功包数
	Success uint32 `json:"success,omitempty"`
	// 丢包率
	LossRate float64 `json:"loss_rate,omitempty"`
	// 平均延迟
	AvgDelay uint32 `json:"avg_delay,omitempty"`
	// 最大延迟
	MaxDelay uint32 `json:"max_delay,omitempty"`
	// 最小延迟
	MinDelay uint32 `json:"min_delay,omitempty"`
	// 标准差
	StdDev uint32 `json:"std_dev,omitempty"`

	// 告警等级ID
	Level *SysDict `json:"level,omitempty"`
	// 告警页面
	AlarmPageList []*SysDict `json:"alarmPageList,omitempty"`
	// 策略告警组
	AlarmGroupList []*AlarmNoticeGroup `json:"alarm_groups,omitempty"`
}

StrategyPingLevel Ping监控策略定义, 用于监控指定IP的网络延迟、丢包率等

func (*StrategyPingLevel) MarshalBinary added in v1.2.0

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

MarshalBinary redis存储实现

func (*StrategyPingLevel) String added in v1.2.0

func (s *StrategyPingLevel) String() string

String 字符串

func (*StrategyPingLevel) UnmarshalBinary added in v1.2.0

func (s *StrategyPingLevel) UnmarshalBinary(data []byte) error

UnmarshalBinary redis存储实现

type StrategyPortLevel added in v1.2.0

type StrategyPortLevel struct {
	// 阈值
	Threshold int64 `json:"threshold"`
	// 端口
	Port uint32 `json:"port"`

	// 告警等级I
	Level *SysDict `json:"level,omitempty"`
	// 告警页面
	AlarmPageList []*SysDict `json:"alarmPageList,omitempty"`
	// 策略告警组
	AlarmGroupList []*AlarmNoticeGroup `json:"alarmGroupList,omitempty"`
}

StrategyPortLevel 策略端口

func (*StrategyPortLevel) MarshalBinary added in v1.2.0

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

MarshalBinary redis存储实现

func (*StrategyPortLevel) String added in v1.2.0

func (s *StrategyPortLevel) String() string

String 字符串

func (*StrategyPortLevel) UnmarshalBinary added in v1.2.0

func (s *StrategyPortLevel) UnmarshalBinary(data []byte) error

UnmarshalBinary redis存储实现

type StrategySubscriber

type StrategySubscriber struct {
	AllFieldModel
	Strategy        *Strategy       `gorm:"foreignKey:StrategyID" json:"strategy"`
	AlarmNoticeType vobj.NotifyType `gorm:"column:notice_type;type:int;not null;comment:通知类型;" json:"alarm_notice_type"`
	UserID          uint32          `` /* 130-byte string literal not displayed */
	StrategyID      uint32          `` /* 132-byte string literal not displayed */
}

StrategySubscriber 策略订阅者信息

func (*StrategySubscriber) MarshalBinary

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

MarshalBinary redis存储实现

func (*StrategySubscriber) TableName

func (*StrategySubscriber) TableName() string

TableName StrategySubscriber table name

func (*StrategySubscriber) UnmarshalBinary

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

UnmarshalBinary redis存储实现

type StrategyTemplate

type StrategyTemplate struct {
	AllFieldModel
	Alert       string           `gorm:"column:alert;type:varchar(64);not null;comment:策略名称" json:"alert"`
	Expr        string           `gorm:"column:expr;type:text;not null;comment:告警表达式" json:"expr"`
	Status      vobj.Status      `gorm:"column:status;type:int;not null;comment:策略状态" json:"status"`
	Remark      string           `gorm:"column:remark;type:varchar(255);not null;comment:备注" json:"remark"`
	Labels      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 {
	AllFieldModel

	Name         string        `` /* 130-byte string literal not displayed */
	Value        string        `gorm:"column:value;type:varchar(100);not null;default:'';comment:字典键值" json:"value,omitempty"`
	DictType     vobj.DictType `` /* 161-byte string literal not displayed */
	ColorType    string        `gorm:"column:color_type;type:varchar(32);not null;default:hex;comment:颜色类型" json:"colorType,omitempty"`
	CSSClass     string        `gorm:"column:css_class;type:varchar(100);not null;default:#165DFF;comment:css 样式" json:"cssClass,omitempty"`
	Icon         string        `gorm:"column:icon;type:varchar(500);default:'';comment:图标" json:"icon,omitempty"`
	ImageURL     string        `gorm:"column:image_url;type:varchar(500);default:'';comment:图片url" json:"imageURL,omitempty"`
	Status       vobj.Status   `gorm:"column:status;type:tinyint;not null;default:1;comment:状态 1:开启 2:关闭" json:"status,omitempty"`
	LanguageCode vobj.Language `` /* 132-byte string literal not displayed */
	Remark       string        `gorm:"column:remark;type:varchar(500);not null;comment:字典备注" json:"remark,omitempty"`
}

SysDict 字典数据

func (*SysDict) 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) MarshalBinary added in v1.2.0

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

MarshalBinary marshal binary

func (*SysDict) String

func (c *SysDict) String() string

String json string

func (*SysDict) TableName

func (*SysDict) TableName() string

TableName SysDict's table name

func (*SysDict) UnmarshalBinary added in v1.2.0

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

UnmarshalBinary unmarshal binary

type SysTeamAPI

type SysTeamAPI struct {
	AllFieldModel
	Name   string      `gorm:"column:name;type:varchar(64);not null;uniqueIndex:idx__team_api__name,priority:1;comment:api名称" json:"name"`  // api名称
	Path   string      `gorm:"column:path;type:varchar(255);not null;uniqueIndex:idx__team_api__path,priority:1;comment:api路径" json:"path"` // api路径
	Status vobj.Status `gorm:"column:status;type:tinyint;not null;comment:状态" json:"status"`                                                // 状态
	Remark string      `gorm:"column:remark;type:varchar(255);not null;comment:备注" json:"remark"`                                           // 备注
	Module int32       `gorm:"column:module;type:int;not null;comment:模块" json:"module"`                                                    // 模块
	Domain int32       `gorm:"column:domain;type:int;not null;comment:领域" json:"domain"`                                                    // 领域
	Allow  vobj.Allow  `gorm:"column:allow;type:tinyint;not null;comment:允许类型" json:"allow"`                                                // 放行规则
}

SysTeamAPI API资源管理

func (*SysTeamAPI) GetAllow added in v1.1.0

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

GetAllow 获取放行规则

func (*SysTeamAPI) GetDomain added in v1.1.0

func (c *SysTeamAPI) GetDomain() int32

GetDomain 获取领域

func (*SysTeamAPI) GetModule added in v1.1.0

func (c *SysTeamAPI) GetModule() int32

GetModule 获取模块

func (*SysTeamAPI) GetName added in v1.1.0

func (c *SysTeamAPI) GetName() string

GetName 获取API名称

func (*SysTeamAPI) GetPath added in v1.1.0

func (c *SysTeamAPI) GetPath() string

GetPath 获取API路径

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

func (c *SysTeamAPI) String() string

String 字符串

func (*SysTeamAPI) TableName

func (*SysTeamAPI) TableName() string

TableName 表名

func (*SysTeamAPI) UnmarshalBinary

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

UnmarshalBinary redis 存储实现

type SysTeamMember

type SysTeamMember struct {
	AllFieldModel
	UserID uint32 `` // 系统用户ID
	/* 132-byte string literal not displayed */
	Status    vobj.Status    `gorm:"column:status;type:int;not null;comment:状态" json:"status"` // 状态
	Role      vobj.Role      `gorm:"column:role;type:int;not null;comment:是否是管理员" json:"role"` // 是否是管理员
	TeamRoles []*SysTeamRole `gorm:"many2many:sys_team_member_roles" json:"team_roles"`
}

SysTeamMember mapped from table <sys_team_members>

func (*SysTeamMember) 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 {
	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 {
	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

type TimeEngine added in v1.2.0

type TimeEngine struct {
	AllFieldModel
	Name   string            `gorm:"column:name;type:varchar(64);not null;comment:规则名称" json:"name"`    // 规则名称
	Remark string            `gorm:"column:remark;type:varchar(255);not null;comment:备注" json:"remark"` // 备注
	Status vobj.Status       `gorm:"column:status;type:int;not null;comment:状态" json:"status"`          // 状态
	Rules  []*TimeEngineRule `gorm:"many2many:time_engine_rule_relation;" json:"rules"`
}

TimeEngine 时间引擎

func (*TimeEngine) IsAllowed added in v1.2.0

func (c *TimeEngine) IsAllowed(time time.Time) bool

IsAllowed 判断条件是否允许

func (*TimeEngine) MarshalBinary added in v1.2.0

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

MarshalBinary redis存储实现

func (*TimeEngine) String added in v1.2.0

func (c *TimeEngine) String() string

String json string

func (*TimeEngine) TableName added in v1.2.0

func (*TimeEngine) TableName() string

TableName SysTeamRole's table name

func (*TimeEngine) UnmarshalBinary added in v1.2.0

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

UnmarshalBinary redis存储实现

type TimeEngineRule added in v1.2.0

type TimeEngineRule struct {
	AllFieldModel
	Name     string                  `gorm:"column:name;type:varchar(64);not null;comment:规则名称" json:"name"`    // 规则名称
	Remark   string                  `gorm:"column:remark;type:varchar(255);not null;comment:备注" json:"remark"` // 备注
	Status   vobj.Status             `gorm:"column:status;type:int;not null;comment:状态" json:"status"`          // 状态
	Category vobj.TimeEngineRuleType `gorm:"column:category;type:int;not null;comment:规则类型" json:"category"`    // 规则类型
	Rule     string                  `gorm:"column:rule;type:text;not null;comment:规则,分割数字" json:"rule"`        // 规则
}

TimeEngineRule 时间引擎规则

func (*TimeEngineRule) MarshalBinary added in v1.2.0

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

MarshalBinary redis存储实现

func (*TimeEngineRule) Matcher added in v1.2.0

func (c *TimeEngineRule) Matcher() types.Matcher

Matcher 匹配器

func (*TimeEngineRule) String added in v1.2.0

func (c *TimeEngineRule) String() string

String json string

func (*TimeEngineRule) TableName added in v1.2.0

func (*TimeEngineRule) TableName() string

TableName SysTeamRole's table name

func (*TimeEngineRule) UnmarshalBinary added in v1.2.0

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

UnmarshalBinary redis存储实现

Jump to

Keyboard shortcuts

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