models

package
v0.0.0-...-1569ab3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertMetrics

type AlertMetrics struct {
	BaseModel

	Name        string   `json:"name"`
	Type        string   `json:"type"`
	Expression  string   `json:"expression"`
	Unit        string   `json:"unit"`
	Operator    string   `json:"operator"`
	OperatorArr []string `json:"operatorArr" gorm:"-"`
	Description string   `json:"description"`
	CreateTime  int64    `json:"createTime"`
	UpdateTime  int64    `json:"updateTime"`
}

func (*AlertMetrics) AfterFind

func (a *AlertMetrics) AfterFind(tx *gorm.DB) (err error)

func (*AlertMetrics) BeforeCreate

func (a *AlertMetrics) BeforeCreate(tx *gorm.DB) error

func (*AlertMetrics) BeforeSave

func (a *AlertMetrics) BeforeSave(tx *gorm.DB) error

type AlertMetricsRepo

type AlertMetricsRepo interface {
	GetAll(db *gorm.DB) ([]*AlertMetrics, error)
	FindById(db *gorm.DB, id string) (*AlertMetrics, error)
	Create(db *gorm.DB, alertMetric *AlertMetrics) error
	Delete(db *gorm.DB, alertMetricId string) error
	Page(db *gorm.DB, page *page.ReqPage) (*page.RespPage, error)
	Update(db *gorm.DB, alertMetric *AlertMetrics) error
	Deletes(db *gorm.DB, ids []string) error
}

type AlertObjectArr

type AlertObjectArr struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type AlertRecords

type AlertRecords struct {
	BaseModel

	AlertName  string `json:"alertName"`
	RuleName   string `json:"ruleName"`
	RuleId     string `json:"ruleId"`
	Severity   string `json:"severity"`
	Summary    string `json:"summary"`
	Value      string `json:"value"`
	Attribute  string `json:"attribute"`
	CreateTime int64  `json:"createTime"`
	UpdateTime int64  `json:"updateTime"`
}

func (*AlertRecords) BeforeCreate

func (a *AlertRecords) BeforeCreate(tx *gorm.DB) error

func (*AlertRecords) BeforeSave

func (a *AlertRecords) BeforeSave(tx *gorm.DB) error

type AlertRecordsRepo

type AlertRecordsRepo interface {
	Create(db *gorm.DB, record *AlertRecords) error
	Delete(db *gorm.DB, alertRecordId string) error
	Deletes(db *gorm.DB, ids []string) error
	Page(db *gorm.DB, page *page.ReqPage) (*page.RespPage, error)
}

type AlertRules

type AlertRules struct {
	BaseModel

	Name        string `json:"name"`
	AlertObject string `json:"alertObject"`
	//AlertObjectArr  map[string]string     `json:"alertObjectArr" gorm:"-"`
	AlertObjectArr  []*AlertObjectArr     `json:"alertObjectArr" gorm:"-"`
	RulesArr        []*RuleMetricRelation `json:"rulesArr" gorm:"-"`
	RulesStatus     int                   `json:"rulesStatus"`
	Severity        string                `json:"severity"`
	Webhook         string                `json:"webhook"`
	AlertSilencesId string                `json:"alertSilencesId"`
	Persistent      string                `json:"persistent"`
	AlertInterval   string                `json:"alertInterval"`
	StoreInterval   string                `json:"storeInterval"`
	UserGroupIds    string                `json:"userGroupIds"`
	UserGroupIdsArr []string              `json:"userGroupIdsArr" gorm:"-"`
	Description     string                `json:"description"`
	CreateTime      int64                 `json:"createTime"`
	UpdateTime      int64                 `json:"updateTime"`
}

func (*AlertRules) AfterFind

func (a *AlertRules) AfterFind(tx *gorm.DB) (err error)

func (*AlertRules) BeforeCreate

func (a *AlertRules) BeforeCreate(tx *gorm.DB) error

func (*AlertRules) BeforeSave

func (a *AlertRules) BeforeSave(tx *gorm.DB) error

type AlertRulesRepo

type AlertRulesRepo interface {
	GetAll(db *gorm.DB) ([]*AlertRules, error)
	FindById(db *gorm.DB, id string) (*AlertRules, error)
	FindEnableByIds(db *gorm.DB, ids []string) ([]*AlertRules, error)
	Create(db *gorm.DB, alertRule *AlertRules) error
	Delete(db *gorm.DB, alertRuleId string) error
	Deletes(db *gorm.DB, ids []string) error
	Update(db *gorm.DB, alertRule *AlertRules) error
	UpdateStatus(db *gorm.DB, alertRule *AlertRules) error
	Page(db *gorm.DB, page *page.ReqPage) (*page.RespPage, error)
}

type AlertSilences

type AlertSilences struct {
	BaseModel

	Name        string `json:"name"`
	Type        string `json:"type"`
	StartTime   int64  `json:"startTime"`
	EndTime     int64  `json:"endTime"`
	Description string `json:"description"`
	CreateTime  int64  `json:"createTime"`
	UpdateTime  int64  `json:"updateTime"`
}

func (*AlertSilences) BeforeCreate

func (a *AlertSilences) BeforeCreate(tx *gorm.DB) error

func (*AlertSilences) BeforeSave

func (a *AlertSilences) BeforeSave(tx *gorm.DB) error

type AlertSilencesRepo

type AlertSilencesRepo interface {
	GetAll(db *gorm.DB) ([]*AlertSilences, error)
	Create(db *gorm.DB, silence *AlertSilences) error
	Deletes(db *gorm.DB, ids []string) error
	Update(db *gorm.DB, silence *AlertSilences) error
	Page(db *gorm.DB, page *page.ReqPage) (*page.RespPage, error)
}

type AlertUsers

type AlertUsers struct {
	BaseModel

	Name       string `json:"name"`
	Department string `json:"department"`
	Email      string `json:"email"`
	Phone      string `json:"phone"`
	CreateTime int64  `json:"createTime"`
	UpdateTime int64  `json:"updateTime"`
}

func (*AlertUsers) BeforeCreate

func (a *AlertUsers) BeforeCreate(tx *gorm.DB) error

func (*AlertUsers) BeforeSave

func (a *AlertUsers) BeforeSave(tx *gorm.DB) error

type AlertUsersGroup

type AlertUsersGroup struct {
	BaseModel

	Name          string        `json:"name"`
	Description   string        `json:"description"`
	UserIds       string        `json:"userIds"`
	UserIdsDetail []*AlertUsers `json:"userIdsDetail" gorm:"-"`
	CreateTime    int64         `json:"createTime"`
	UpdateTime    int64         `json:"updateTime"`
}

func (*AlertUsersGroup) BeforeCreate

func (a *AlertUsersGroup) BeforeCreate(tx *gorm.DB) error

func (*AlertUsersGroup) BeforeSave

func (a *AlertUsersGroup) BeforeSave(tx *gorm.DB) error

type AlertUsersGroupRepo

type AlertUsersGroupRepo interface {
	Create(db *gorm.DB, userGroup *AlertUsersGroup) error
	Update(db *gorm.DB, userGroup *AlertUsersGroup) error
	Page(db *gorm.DB, page *page.ReqPage) (*page.RespPage, error)
	FindByIds(db *gorm.DB, ids []string) ([]*AlertUsersGroup, error)
	Deletes(db *gorm.DB, ids []string) error
	All(db *gorm.DB) ([]*AlertUsersGroup, error)
}

type AlertUsersRepo

type AlertUsersRepo interface {
	Create(db *gorm.DB, user *AlertUsers) error
	Deletes(db *gorm.DB, ids []string) error
	Update(db *gorm.DB, alertUser *AlertUsers) error
	Page(db *gorm.DB, page *page.ReqPage) (*page.RespPage, error)
	All(db *gorm.DB) ([]*AlertUsers, error)
	GetUserByIds(db *gorm.DB, ids []string) ([]*AlertUsers, error)
}

type BaseModel

type BaseModel struct {
	ID string `json:"id"`
}

BaseModel info

type RuleMetricRelation

type RuleMetricRelation struct {
	Id         int    `json:"id"`
	RuleId     string `json:"ruleId"`
	MetricId   string `json:"metricId"`
	Expression string `json:"expression"`
	Statistics string `json:"statistics"`
	Operator   string `json:"operator"`
	AlertValue string `json:"alertValue"`
}

type RuleMetricRelationRepo

type RuleMetricRelationRepo interface {
	GetRuleMetricByRuleId(db *gorm.DB, ruleId string) ([]*RuleMetricRelation, error)
	GetCountByMetricID(db *gorm.DB, metricId string) (int64, error)
	Batches(db *gorm.DB, relations []*RuleMetricRelation) error
	Update(db *gorm.DB, relation *RuleMetricRelation) error
	DeleteByRuleId(db *gorm.DB, ruleId string) error
	DeleteByRuleIds(db *gorm.DB, ids []string) error
	FindRuleIdsByMetricId(db *gorm.DB, metricId string) (*[]string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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