Documentation
¶
Index ¶
Constants ¶
View Source
const ( MaxTimeRangeDays = 365 DefaultPageSize = 10 DateFormat = "2006-01-02" UnknownUserName = "未知用户" )
常量定义
Variables ¶
View Source
var ( ErrGroupExists = errors.New("值班组已存在") ErrGroupIDEmpty = errors.New("值班组ID为空") ErrGroupNotFound = errors.New("值班组不存在") ErrGroupHasSendGroup = errors.New("值班组存在关联发送组,无法删除") ErrInvalidTimeRange = errors.New("时间范围无效") ErrInvalidShiftDays = errors.New("轮班天数无效") ErrMembersNotFound = errors.New("部分成员不存在") ErrTimeRangeTooLong = errors.New("查询时间范围不能超过一年") )
业务错误定义
Functions ¶
This section is empty.
Types ¶
type AlertManagerEventService ¶
type AlertManagerEventService interface {
GetMonitorAlertEventList(ctx context.Context, req *model.GetMonitorAlertEventListReq) (model.ListResp[*model.MonitorAlertEvent], error)
EventAlertSilence(ctx context.Context, req *model.EventAlertSilenceReq) error
EventAlertClaim(ctx context.Context, req *model.EventAlertClaimReq) error
EventAlertUnSilence(ctx context.Context, req *model.EventAlertUnSilenceReq) error
}
AlertManagerEventService 定义告警事件管理服务接口
func NewAlertManagerEventService ¶
func NewAlertManagerEventService(dao alert.AlertManagerEventDAO, cache cache.MonitorCache, l *zap.Logger, userDao userDao.UserDAO, sendDao alert.AlertManagerSendDAO) AlertManagerEventService
NewAlertManagerEventService 创建告警事件管理服务实例
type AlertManagerOnDutyService ¶
type AlertManagerOnDutyService interface {
GetMonitorOnDutyGroupList(ctx context.Context, req *model.GetMonitorOnDutyGroupListReq) (model.ListResp[*model.MonitorOnDutyGroup], error)
CreateMonitorOnDutyGroup(ctx context.Context, req *model.CreateMonitorOnDutyGroupReq) error
CreateMonitorOnDutyGroupChange(ctx context.Context, req *model.CreateMonitorOnDutyGroupChangeReq) error
UpdateMonitorOnDutyGroup(ctx context.Context, req *model.UpdateMonitorOnDutyGroupReq) error
DeleteMonitorOnDutyGroup(ctx context.Context, req *model.DeleteMonitorOnDutyGroupReq) error
GetMonitorOnDutyGroup(ctx context.Context, req *model.GetMonitorOnDutyGroupReq) (*model.MonitorOnDutyGroup, error)
GetMonitorOnDutyGroupFuturePlan(ctx context.Context, req *model.GetMonitorOnDutyGroupFuturePlanReq) (model.ListResp[*model.MonitorOnDutyOne], error)
GetMonitorOnDutyHistory(ctx context.Context, req *model.GetMonitorOnDutyHistoryReq) (model.ListResp[*model.MonitorOnDutyHistory], error)
GetMonitorOnDutyGroupChangeList(ctx context.Context, req *model.GetMonitorOnDutyGroupChangeListReq) (model.ListResp[*model.MonitorOnDutyChange], error)
}
func NewAlertManagerOnDutyService ¶
func NewAlertManagerOnDutyService(dao alert.AlertManagerOnDutyDAO, sendDao alert.AlertManagerSendDAO, cache cache.MonitorCache, l *zap.Logger, userDao userDao.UserDAO) AlertManagerOnDutyService
type AlertManagerPoolService ¶
type AlertManagerPoolService interface {
GetMonitorAlertManagerPoolList(ctx context.Context, req *model.GetMonitorAlertManagerPoolListReq) (model.ListResp[*model.MonitorAlertManagerPool], error)
CreateMonitorAlertManagerPool(ctx context.Context, req *model.CreateMonitorAlertManagerPoolReq) error
UpdateMonitorAlertManagerPool(ctx context.Context, req *model.UpdateMonitorAlertManagerPoolReq) error
DeleteMonitorAlertManagerPool(ctx context.Context, req *model.DeleteMonitorAlertManagerPoolReq) error
GetMonitorAlertManagerPool(ctx context.Context, req *model.GetMonitorAlertManagerPoolReq) (*model.MonitorAlertManagerPool, error)
}
func NewAlertManagerPoolService ¶
func NewAlertManagerPoolService( dao alert.AlertManagerPoolDAO, sendDao alert.AlertManagerSendDAO, l *zap.Logger, cache cache.MonitorCache, ) AlertManagerPoolService
type AlertManagerRecordService ¶
type AlertManagerRecordService interface {
GetMonitorRecordRuleList(ctx context.Context, req *model.GetMonitorRecordRuleListReq) (model.ListResp[*model.MonitorRecordRule], error)
CreateMonitorRecordRule(ctx context.Context, req *model.CreateMonitorRecordRuleReq) error
UpdateMonitorRecordRule(ctx context.Context, req *model.UpdateMonitorRecordRuleReq) error
DeleteMonitorRecordRule(ctx context.Context, req *model.DeleteMonitorRecordRuleReq) error
GetMonitorRecordRule(ctx context.Context, req *model.GetMonitorRecordRuleReq) (*model.MonitorRecordRule, error)
}
func NewAlertManagerRecordService ¶
func NewAlertManagerRecordService(dao alert.AlertManagerRecordDAO, poolDao scrape.ScrapePoolDAO, l *zap.Logger, cache cache.MonitorCache) AlertManagerRecordService
type AlertManagerRuleService ¶
type AlertManagerRuleService interface {
GetMonitorAlertRuleList(ctx context.Context, req *model.GetMonitorAlertRuleListReq) (model.ListResp[*model.MonitorAlertRule], error)
CreateMonitorAlertRule(ctx context.Context, req *model.CreateMonitorAlertRuleReq) error
UpdateMonitorAlertRule(ctx context.Context, req *model.UpdateMonitorAlertRuleReq) error
DeleteMonitorAlertRule(ctx context.Context, req *model.DeleteMonitorAlertRuleReq) error
PromqlExprCheck(ctx context.Context, req *model.PromqlAlertRuleExprCheckReq) (bool, error)
GetMonitorAlertRule(ctx context.Context, req *model.GetMonitorAlertRuleReq) (*model.MonitorAlertRule, error)
}
func NewAlertManagerRuleService ¶
func NewAlertManagerRuleService( logger *zap.Logger, ruleDAO alert.AlertManagerRuleDAO, poolDAO alert.AlertManagerPoolDAO, sendGroupDAO alert.AlertManagerSendDAO, cache cache.MonitorCache, ) AlertManagerRuleService
type AlertManagerSendService ¶
type AlertManagerSendService interface {
GetMonitorSendGroupList(ctx context.Context, req *model.GetMonitorSendGroupListReq) (model.ListResp[*model.MonitorSendGroup], error)
CreateMonitorSendGroup(ctx context.Context, req *model.CreateMonitorSendGroupReq) error
UpdateMonitorSendGroup(ctx context.Context, req *model.UpdateMonitorSendGroupReq) error
DeleteMonitorSendGroup(ctx context.Context, req *model.DeleteMonitorSendGroupReq) error
GetMonitorSendGroup(ctx context.Context, req *model.GetMonitorSendGroupReq) (*model.MonitorSendGroup, error)
GetMonitorSendGroupAll(ctx context.Context) (model.ListResp[*model.MonitorSendGroup], error)
}
func NewAlertManagerSendService ¶
func NewAlertManagerSendService(dao alert.AlertManagerSendDAO, ruleDao alert.AlertManagerRuleDAO, l *zap.Logger, userDao userDao.UserDAO, cache cache.MonitorCache) AlertManagerSendService
Click to show internal directories.
Click to hide internal directories.