Documentation ¶
Index ¶
- func NewAgentController(cc container.Container) web.Controller
- func NewAuditController(cc container.Container) web.Controller
- func NewDingdingRobotController(cc container.Container) web.Controller
- func NewEventController(cc container.Container) web.Controller
- func NewGroupController(cc container.Container) web.Controller
- func NewJiraController(cc container.Container) web.Controller
- func NewPublicController(cc container.Container) web.Controller
- func NewQueueController(cc container.Container) web.Controller
- func NewRuleController(cc container.Container) web.Controller
- func NewStatisticsController(cc container.Container) web.Controller
- func NewTemplateController(cc container.Container) web.Controller
- func NewUserController(cc container.Container) web.Controller
- func NewWelcomeController(cc container.Container) web.Controller
- type AgentController
- type AgentResp
- type AggCount
- type AuditController
- type DingdingRobotController
- func (u DingdingRobotController) Add(ctx web.Context, em event.Manager, robotRepo repository.DingdingRobotRepo) (*repository.DingdingRobot, error)
- func (u DingdingRobotController) Delete(ctx web.Context, em event.Manager, robotRepo repository.DingdingRobotRepo) error
- func (u DingdingRobotController) DingdingRobot(ctx web.Context, robotRepo repository.DingdingRobotRepo) (*repository.DingdingRobot, error)
- func (u DingdingRobotController) DingdingRobotNames(ctx web.Context, robotRepo repository.DingdingRobotRepo) ([]DingdingRobotNameResp, error)
- func (u DingdingRobotController) DingdingRobots(ctx web.Context, robotRepo repository.DingdingRobotRepo) web.Response
- func (u DingdingRobotController) Register(router *web.Router)
- func (u DingdingRobotController) Update(ctx web.Context, em event.Manager, robotRepo repository.DingdingRobotRepo) (*repository.DingdingRobot, error)
- type DingdingRobotForm
- type DingdingRobotNameResp
- type EvalSampleReq
- type EventByDatetimeCount
- type EventController
- func (m *EventController) AddCommonEvent(ctx web.Context, eventService service.EventService) web.Response
- func (m *EventController) AddEventRelationNote(ctx web.Context, evtRelationNoteRepo repository.EventRelationNoteRepo) web.Response
- func (m *EventController) AddGrafanaEvent(ctx web.Context, eventService service.EventService) web.Response
- func (m *EventController) AddLogstashEvent(ctx web.Context, eventService service.EventService) web.Response
- func (m *EventController) AddOpenFalconEvent(ctx web.Context, eventService service.EventService) web.Response
- func (m *EventController) AddPrometheusAlertEvent(ctx web.Context, eventService service.EventService) web.Response
- func (m *EventController) AddPrometheusEvent(ctx web.Context, eventService service.EventService) web.Response
- func (m *EventController) Count(ctx web.Context, evtRepo repository.EventRepo) web.Response
- func (m *EventController) DeleteEvent(ctx web.Context, evtRepo repository.EventRepo) web.Response
- func (m *EventController) Event(ctx web.Context, eventRepo repository.EventRepo) (*repository.Event, error)
- func (m *EventController) Events(ctx web.Context, evtRepo repository.EventRepo) (*EventsResp, error)
- func (m *EventController) QueryEventRelation(ctx web.Context, evtRelationRepo repository.EventRelationRepo) (*repository.EventRelation, error)
- func (m *EventController) QueryEventRelationNotes(ctx web.Context, evtRelationNoteRepo repository.EventRelationNoteRepo) (*EventRelationNotesResp, error)
- func (m *EventController) Register(router *web.Router)
- func (m *EventController) ReproduceEvent(ctx web.Context, eventRepo repository.EventRepo, ...) web.Response
- func (m *EventController) TestMatchedRules(ctx web.Context, msgRepo repository.EventRepo, ruleRepo repository.RuleRepo) ([]job.MatchedRule, error)
- type EventGroupAggByDatetimeCount
- type EventGroupAggByDatetimeCountResp
- type EventGroupByRuleCounts
- type EventGroupByUserCounts
- type EventRelationNotesResp
- type EventSearch
- type EventsResp
- type GroupController
- func (g GroupController) CutGroupEvents(webCtx web.Context, evtGrpRepo repository.EventGroupRepo, ...) web.Response
- func (g GroupController) Group(ctx web.Context, groupRepo repository.EventGroupRepo, ...) (*GroupResp, error)
- func (g GroupController) Groups(ctx web.Context, groupRepo repository.EventGroupRepo, ...) (*GroupsResp, error)
- func (g GroupController) RecoverableGroups(recoveryRepo repository.RecoveryRepo) ([]repository.Recovery, error)
- func (g GroupController) Register(router *web.Router)
- type GroupResp
- type GroupsGroupResp
- type GroupsResp
- type JiraController
- func (j JiraController) CustomFields(webCtx web.Context, conf *configs.Config) web.Response
- func (j JiraController) IssueOptions(webCtx web.Context, conf *configs.Config) web.Response
- func (j JiraController) IssueTypes(webCtx web.Context, conf *configs.Config) web.Response
- func (j JiraController) Priorities(webCtx web.Context, conf *configs.Config) web.Response
- func (j JiraController) Register(router *web.Router)
- type MessageGroupByDatetimeCount
- type PublicController
- type QueueController
- func (q *QueueController) Control(ctx web.Context, manager queue.Manager) web.Response
- func (q *QueueController) Delete(ctx web.Context, repo repository.QueueRepo) error
- func (q *QueueController) Job(ctx web.Context, repo repository.QueueRepo) (*QueueJob, error)
- func (q *QueueController) Jobs(ctx web.Context, repo repository.QueueRepo) (*QueueJobsResp, error)
- func (q *QueueController) Register(router *web.Router)
- type QueueJob
- type QueueJobsResp
- type RuleController
- func (r RuleController) Add(ctx web.Context, repo repository.RuleRepo, em event.Manager, ...) (*repository.Rule, error)
- func (r RuleController) Check(ctx web.Context, conf *configs.Config, msgRepo repository.EventRepo) web.Response
- func (r RuleController) Delete(ctx web.Context, em event.Manager, repo repository.RuleRepo) error
- func (r RuleController) EvaluateExpressionSample(ctx web.Context) web.Response
- func (r RuleController) MessageSample(ctx web.Context, groupRepo repository.EventGroupRepo, ...) (*repository.Event, error)
- func (r RuleController) Register(router *web.Router)
- func (r RuleController) Rule(ctx web.Context, ruleRepo repository.RuleRepo) (*repository.Rule, error)
- func (r RuleController) Rules(ctx web.Context, ruleRepo repository.RuleRepo, userRepo repository.UserRepo) (*RulesResp, error)
- func (r RuleController) Tags(ctx web.Context, repo repository.RuleRepo) web.Response
- func (r RuleController) Update(ctx web.Context, ruleRepo repository.RuleRepo, em event.Manager, ...) (*repository.Rule, error)
- type RuleForm
- type RuleSearch
- type RuleTriggerForm
- type RulesResp
- type StatisticsController
- func (s StatisticsController) DailyGroupCounts(ctx web.Context, groupRepo repository.EventGroupRepo) ([]MessageGroupByDatetimeCount, error)
- func (s StatisticsController) EventCountInPeriod(webCtx web.Context, evtRepo repository.EventRepo) ([]EventByDatetimeCount, error)
- func (s StatisticsController) EventGroupAggCounts(webCtx web.Context, evtGrpRepo repository.EventGroupRepo) ([]repository.EventGroupAggCount, error)
- func (s StatisticsController) EventGroupAggInPeriod(webCtx web.Context, evtGrpRepo repository.EventGroupRepo) (EventGroupAggByDatetimeCountResp, error)
- func (s StatisticsController) Register(router *web.Router)
- func (s StatisticsController) RuleGroupCounts(ctx web.Context, groupRepo repository.EventGroupRepo) ([]repository.EventGroupByRuleCount, error)
- func (s StatisticsController) UserGroupCounts(ctx web.Context, groupRepo repository.EventGroupRepo) ([]repository.EventGroupByUserCount, error)
- type TemplateController
- func (t *TemplateController) Add(ctx web.Context, repo repository.TemplateRepo) (*repository.Template, error)
- func (t *TemplateController) Delete(ctx web.Context, repo repository.TemplateRepo) error
- func (t *TemplateController) Get(ctx web.Context, repo repository.TemplateRepo) (*repository.Template, error)
- func (t *TemplateController) Register(router *web.Router)
- func (t *TemplateController) Templates(ctx web.Context, repo repository.TemplateRepo) ([]repository.Template, error)
- func (t *TemplateController) Update(ctx web.Context, repo repository.TemplateRepo) (*repository.Template, error)
- type TemplateForm
- type UserController
- func (u UserController) Add(ctx web.Context, userRepo repository.UserRepo, em event.Manager) (*repository.User, error)
- func (u UserController) Delete(ctx web.Context, userRepo repository.UserRepo, em event.Manager) error
- func (u UserController) Register(router *web.Router)
- func (u UserController) Update(ctx web.Context, userRepo repository.UserRepo, em event.Manager) (*repository.User, error)
- func (u UserController) User(ctx web.Context, userRepo repository.UserRepo) (*repository.User, error)
- func (u UserController) UserNames(ctx web.Context, userRepo repository.UserRepo) ([]UserNameResp, error)
- func (u UserController) Users(ctx web.Context, userRepo repository.UserRepo) web.Response
- type UserForm
- type UserNameResp
- type WelcomeController
- type WelcomeMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAgentController ¶
func NewAgentController(cc container.Container) web.Controller
func NewAuditController ¶
func NewAuditController(cc container.Container) web.Controller
func NewDingdingRobotController ¶
func NewDingdingRobotController(cc container.Container) web.Controller
func NewEventController ¶
func NewEventController(cc container.Container) web.Controller
func NewGroupController ¶
func NewGroupController(cc container.Container) web.Controller
func NewJiraController ¶
func NewJiraController(cc container.Container) web.Controller
func NewPublicController ¶
func NewPublicController(cc container.Container) web.Controller
func NewQueueController ¶
func NewQueueController(cc container.Container) web.Controller
func NewRuleController ¶
func NewRuleController(cc container.Container) web.Controller
func NewStatisticsController ¶
func NewStatisticsController(cc container.Container) web.Controller
NewStatisticsController create a new StatisticsController
func NewTemplateController ¶
func NewTemplateController(cc container.Container) web.Controller
func NewUserController ¶
func NewUserController(cc container.Container) web.Controller
func NewWelcomeController ¶
func NewWelcomeController(cc container.Container) web.Controller
Types ¶
type AgentController ¶
type AgentController struct {
// contains filtered or unexported fields
}
func (AgentController) All ¶
func (c AgentController) All(repo repository.AgentRepo) ([]AgentResp, error)
func (AgentController) Register ¶
func (c AgentController) Register(router *web.Router)
func (AgentController) Remove ¶
func (c AgentController) Remove(req web.Request, repo repository.AgentRepo) error
type AgentResp ¶
type AgentResp struct { repository.Agent Alive bool `json:"alive"` }
type AggCount ¶
type AggCount struct { AggregateKey string `json:"aggregate_key"` Total int64 `json:"total"` TotalMessages int64 `json:"total_messages"` }
AggCount 聚合key包含的事件组数量
type AuditController ¶
type AuditController struct {
// contains filtered or unexported fields
}
func (AuditController) Logs ¶
func (u AuditController) Logs(ctx web.Context, auditRepo repository.AuditLogRepo) web.Response
func (AuditController) Register ¶
func (u AuditController) Register(router *web.Router)
type DingdingRobotController ¶
type DingdingRobotController struct {
// contains filtered or unexported fields
}
func (DingdingRobotController) Add ¶
func (u DingdingRobotController) Add(ctx web.Context, em event.Manager, robotRepo repository.DingdingRobotRepo) (*repository.DingdingRobot, error)
func (DingdingRobotController) Delete ¶
func (u DingdingRobotController) Delete(ctx web.Context, em event.Manager, robotRepo repository.DingdingRobotRepo) error
func (DingdingRobotController) DingdingRobot ¶
func (u DingdingRobotController) DingdingRobot(ctx web.Context, robotRepo repository.DingdingRobotRepo) (*repository.DingdingRobot, error)
func (DingdingRobotController) DingdingRobotNames ¶
func (u DingdingRobotController) DingdingRobotNames(ctx web.Context, robotRepo repository.DingdingRobotRepo) ([]DingdingRobotNameResp, error)
DingdingRobotNames return all robot names only
func (DingdingRobotController) DingdingRobots ¶
func (u DingdingRobotController) DingdingRobots(ctx web.Context, robotRepo repository.DingdingRobotRepo) web.Response
func (DingdingRobotController) Register ¶
func (u DingdingRobotController) Register(router *web.Router)
func (DingdingRobotController) Update ¶
func (u DingdingRobotController) Update(ctx web.Context, em event.Manager, robotRepo repository.DingdingRobotRepo) (*repository.DingdingRobot, error)
type DingdingRobotForm ¶
type DingdingRobotNameResp ¶
type EvalSampleReq ¶
type EvalSampleReq struct { EventSample extension.CommonEvent `json:"event_sample"` EventID string `json:"event_id"` Expression string `json:"expression"` }
type EventByDatetimeCount ¶
EventByDatetimeCount 周期内事件数量统计返回对象
type EventController ¶
type EventController struct {
// contains filtered or unexported fields
}
func (*EventController) AddCommonEvent ¶
func (m *EventController) AddCommonEvent(ctx web.Context, eventService service.EventService) web.Response
func (*EventController) AddEventRelationNote ¶
func (m *EventController) AddEventRelationNote(ctx web.Context, evtRelationNoteRepo repository.EventRelationNoteRepo) web.Response
AddEventRelationNote 添加事件关联备注
func (*EventController) AddGrafanaEvent ¶
func (m *EventController) AddGrafanaEvent(ctx web.Context, eventService service.EventService) web.Response
AddGrafanaEvent Add grafana message
func (*EventController) AddLogstashEvent ¶
func (m *EventController) AddLogstashEvent(ctx web.Context, eventService service.EventService) web.Response
AddLogstashEvent Add logstash message
func (*EventController) AddOpenFalconEvent ¶
func (m *EventController) AddOpenFalconEvent(ctx web.Context, eventService service.EventService) web.Response
add open-falcon message
func (*EventController) AddPrometheusAlertEvent ¶
func (m *EventController) AddPrometheusAlertEvent(ctx web.Context, eventService service.EventService) web.Response
AddPrometheusAlertEvent add prometheus-alert message
func (*EventController) AddPrometheusEvent ¶
func (m *EventController) AddPrometheusEvent(ctx web.Context, eventService service.EventService) web.Response
AddPrometheusEvent add prometheus alert message
func (*EventController) Count ¶
func (m *EventController) Count(ctx web.Context, evtRepo repository.EventRepo) web.Response
Count return message count for your conditions
func (*EventController) DeleteEvent ¶
func (m *EventController) DeleteEvent(ctx web.Context, evtRepo repository.EventRepo) web.Response
DeleteEvent 删除事件
func (*EventController) Event ¶
func (m *EventController) Event(ctx web.Context, eventRepo repository.EventRepo) (*repository.Event, error)
Event return one message
func (*EventController) Events ¶
func (m *EventController) Events(ctx web.Context, evtRepo repository.EventRepo) (*EventsResp, error)
Events return all messages
func (*EventController) QueryEventRelation ¶
func (m *EventController) QueryEventRelation(ctx web.Context, evtRelationRepo repository.EventRelationRepo) (*repository.EventRelation, error)
QueryEventRelation 查询事件关联
func (*EventController) QueryEventRelationNotes ¶
func (m *EventController) QueryEventRelationNotes(ctx web.Context, evtRelationNoteRepo repository.EventRelationNoteRepo) (*EventRelationNotesResp, error)
QueryEventRelationNotes 查询事件关联的备注
func (*EventController) Register ¶
func (m *EventController) Register(router *web.Router)
func (*EventController) ReproduceEvent ¶
func (m *EventController) ReproduceEvent(ctx web.Context, eventRepo repository.EventRepo, eventService service.EventService) web.Response
func (*EventController) TestMatchedRules ¶
func (m *EventController) TestMatchedRules(ctx web.Context, msgRepo repository.EventRepo, ruleRepo repository.RuleRepo) ([]job.MatchedRule, error)
TestMatchedRules 测试 message 匹配哪些规则
type EventGroupAggByDatetimeCount ¶
type EventGroupAggByDatetimeCount struct { Datetime string `json:"datetime"` AggCount []AggCount `json:"agg_count"` }
EventGroupAggByDatetimeCount 时间范围内事件组聚合数量
type EventGroupAggByDatetimeCountResp ¶
type EventGroupAggByDatetimeCountResp struct { Data []EventGroupAggByDatetimeCount `json:"data"` AggregateKeys []string `json:"aggregate_keys"` }
type EventGroupByRuleCounts ¶
type EventGroupByRuleCounts []repository.EventGroupByRuleCount
func (EventGroupByRuleCounts) Len ¶
func (e EventGroupByRuleCounts) Len() int
func (EventGroupByRuleCounts) Less ¶
func (e EventGroupByRuleCounts) Less(i, j int) bool
func (EventGroupByRuleCounts) Swap ¶
func (e EventGroupByRuleCounts) Swap(i, j int)
type EventGroupByUserCounts ¶
type EventGroupByUserCounts []repository.EventGroupByUserCount
func (EventGroupByUserCounts) Len ¶
func (e EventGroupByUserCounts) Len() int
func (EventGroupByUserCounts) Less ¶
func (e EventGroupByUserCounts) Less(i, j int) bool
func (EventGroupByUserCounts) Swap ¶
func (e EventGroupByUserCounts) Swap(i, j int)
type EventRelationNotesResp ¶
type EventRelationNotesResp struct { Notes []repository.EventRelationNote `json:"notes"` Next int64 `json:"next"` }
EventRelationNotesResp 事件关联备注响应对象
type EventSearch ¶
type EventSearch struct { Tags []string `json:"tags"` Meta string `json:"meta"` Status []string `json:"status"` Origin string `json:"origin"` GroupID string `json:"group_id"` }
EventSearch is search conditions for messages
type EventsResp ¶
type EventsResp struct { Events []repository.Event `json:"events"` Next int64 `json:"next"` Search EventSearch `json:"search"` }
EventsResp is a response object for Events API
type GroupController ¶
type GroupController struct {
// contains filtered or unexported fields
}
func (GroupController) CutGroupEvents ¶
func (g GroupController) CutGroupEvents(webCtx web.Context, evtGrpRepo repository.EventGroupRepo, evtGroupSvc service.EventGroupService, em event.Manager) web.Response
CutGroupEvents 缩减事件组中包含的事件,对已经完成聚合的事件组有效, 该操作不会影响事件组上对事件总数的计数
func (GroupController) Group ¶
func (g GroupController) Group( ctx web.Context, groupRepo repository.EventGroupRepo, eventRepo repository.EventRepo, ) (*GroupResp, error)
func (GroupController) Groups ¶
func (g GroupController) Groups(ctx web.Context, groupRepo repository.EventGroupRepo, userRepo repository.UserRepo) (*GroupsResp, error)
Groups list all event groups Arguments:
- offset/limit
- status
- rule_id
- user_id
func (GroupController) RecoverableGroups ¶
func (g GroupController) RecoverableGroups(recoveryRepo repository.RecoveryRepo) ([]repository.Recovery, error)
RecoverableGroups 当前待恢复的报警组
func (GroupController) Register ¶
func (g GroupController) Register(router *web.Router)
type GroupResp ¶
type GroupResp struct { Group repository.EventGroup `json:"group"` Events []repository.Event `json:"events"` Next int64 `json:"next"` }
type GroupsGroupResp ¶
type GroupsGroupResp struct { repository.EventGroup CollectTimeRemain int64 `json:"collect_time_remain"` }
type GroupsResp ¶
type GroupsResp struct { Groups []GroupsGroupResp `json:"groups"` Users map[string]string `json:"users"` Next int64 `json:"next"` }
type JiraController ¶
type JiraController struct {
// contains filtered or unexported fields
}
func (JiraController) CustomFields ¶
func (JiraController) IssueOptions ¶
func (JiraController) IssueTypes ¶
func (JiraController) Priorities ¶
func (JiraController) Register ¶
func (j JiraController) Register(router *web.Router)
type MessageGroupByDatetimeCount ¶
type MessageGroupByDatetimeCount struct { Datetime string `json:"datetime"` Total int64 `json:"total"` TotalMessages int64 `json:"total_messages"` }
MessageGroupByDatetimeCount 周期内事件组数量
type PublicController ¶
type PublicController struct {
// contains filtered or unexported fields
}
func (PublicController) Group ¶
func (p PublicController) Group(ctx web.Context, groupRepo repository.EventGroupRepo, msgRepo repository.EventRepo) web.Response
Group 分组展示
func (PublicController) Register ¶
func (p PublicController) Register(router *web.Router)
func (PublicController) Reports ¶
func (p PublicController) Reports(ctx web.Context, groupRepo repository.EventGroupRepo, msgRepo repository.EventRepo, templateRepo repository.TemplateRepo) web.Response
Reports 报表展示
type QueueController ¶
type QueueController struct {
// contains filtered or unexported fields
}
func (*QueueController) Control ¶
Control controls the queue behaviors Args: op=pause/container/info
func (*QueueController) Delete ¶
func (q *QueueController) Delete(ctx web.Context, repo repository.QueueRepo) error
func (*QueueController) Job ¶
func (q *QueueController) Job(ctx web.Context, repo repository.QueueRepo) (*QueueJob, error)
func (*QueueController) Jobs ¶
func (q *QueueController) Jobs(ctx web.Context, repo repository.QueueRepo) (*QueueJobsResp, error)
func (*QueueController) Register ¶
func (q *QueueController) Register(router *web.Router)
type QueueJob ¶
type QueueJob struct { repository.QueueJob ExecuteTimeRemain int64 `json:"execute_time_remain"` }
type QueueJobsResp ¶
type RuleController ¶
type RuleController struct {
// contains filtered or unexported fields
}
func (RuleController) Add ¶
func (r RuleController) Add(ctx web.Context, repo repository.RuleRepo, em event.Manager, manager action.Manager) (*repository.Rule, error)
Add create a new rule
func (RuleController) Check ¶
func (r RuleController) Check(ctx web.Context, conf *configs.Config, msgRepo repository.EventRepo) web.Response
Check validate the rule
func (RuleController) Delete ¶
func (r RuleController) Delete(ctx web.Context, em event.Manager, repo repository.RuleRepo) error
Delete delete a rule
func (RuleController) EvaluateExpressionSample ¶
func (r RuleController) EvaluateExpressionSample(ctx web.Context) web.Response
func (RuleController) MessageSample ¶
func (r RuleController) MessageSample(ctx web.Context, groupRepo repository.EventGroupRepo, msgRepo repository.EventRepo) (*repository.Event, error)
MessageSample 根据规则id查询一个匹配的消息样本
func (RuleController) Register ¶
func (r RuleController) Register(router *web.Router)
func (RuleController) Rule ¶
func (r RuleController) Rule(ctx web.Context, ruleRepo repository.RuleRepo) (*repository.Rule, error)
Rule return one rule
func (RuleController) Rules ¶
func (r RuleController) Rules(ctx web.Context, ruleRepo repository.RuleRepo, userRepo repository.UserRepo) (*RulesResp, error)
Rules return all rules
func (RuleController) Tags ¶
func (r RuleController) Tags(ctx web.Context, repo repository.RuleRepo) web.Response
Tags return all tags existed
func (RuleController) Update ¶
func (r RuleController) Update(ctx web.Context, ruleRepo repository.RuleRepo, em event.Manager, manager action.Manager) (*repository.Rule, error)
Update replace one rule for specified id
type RuleForm ¶
type RuleForm struct { Name string `json:"name"` Description string `json:"description"` Tags []string `json:"tags"` AggregateRule string `json:"aggregate_rule"` RelationRule string `json:"relation_rule"` ReadyType string `json:"ready_type"` Interval int64 `json:"interval"` DailyTimes []string `json:"daily_times"` TimeRanges []repository.TimeRange `json:"time_ranges"` RealtimeInterval int64 `json:"realtime_interval"` Rule string `json:"rule"` IgnoreRule string `json:"ignore_rule"` Template string `json:"template"` SummaryTemplate string `json:"summary_template"` ReportTemplateID string `json:"report_template_id"` Triggers []RuleTriggerForm `json:"triggers"` Status string `json:"status"` // contains filtered or unexported fields }
RuleForm is a form object using create or update rule
type RuleSearch ¶
type RuleTriggerForm ¶
type RuleTriggerForm struct { ID string `json:"id"` Name string `json:"name"` IsElseTrigger bool `json:"is_else_trigger"` PreCondition string `json:"pre_condition"` Action string `json:"action"` Meta string `json:"meta"` UserRefs []string `json:"user_refs"` }
RuleTriggerForm is a form object using to hold a trigger
type RulesResp ¶
type RulesResp struct { Rules []repository.Rule `json:"rules"` Users map[string]string `json:"users"` Next int64 `json:"next"` Search RuleSearch `json:"search"` }
type StatisticsController ¶
type StatisticsController struct {
// contains filtered or unexported fields
}
StatisticsController 统计功能
func (StatisticsController) DailyGroupCounts ¶
func (s StatisticsController) DailyGroupCounts(ctx web.Context, groupRepo repository.EventGroupRepo) ([]MessageGroupByDatetimeCount, error)
DailyGroupCounts 每日报警次数汇总
func (StatisticsController) EventCountInPeriod ¶
func (s StatisticsController) EventCountInPeriod(webCtx web.Context, evtRepo repository.EventRepo) ([]EventByDatetimeCount, error)
EventCountInPeriod 统计周期内的事件数量 支持的参数: days/step/format/meta/tags/origin/status/relation_id/group_id/event_id
func (StatisticsController) EventGroupAggCounts ¶
func (s StatisticsController) EventGroupAggCounts(webCtx web.Context, evtGrpRepo repository.EventGroupRepo) ([]repository.EventGroupAggCount, error)
EventGroupAggCounts 事件组聚合Key数量统计 参数 rule_id
func (StatisticsController) EventGroupAggInPeriod ¶
func (s StatisticsController) EventGroupAggInPeriod(webCtx web.Context, evtGrpRepo repository.EventGroupRepo) (EventGroupAggByDatetimeCountResp, error)
EventCountInPeriod 统计周期内的事件组数量,按照聚合key分类返回 支持的参数: rule_id
func (StatisticsController) Register ¶
func (s StatisticsController) Register(router *web.Router)
Register 注册路由
func (StatisticsController) RuleGroupCounts ¶
func (s StatisticsController) RuleGroupCounts(ctx web.Context, groupRepo repository.EventGroupRepo) ([]repository.EventGroupByRuleCount, error)
RuleGroupCounts 报警规则报警次数汇总
func (StatisticsController) UserGroupCounts ¶
func (s StatisticsController) UserGroupCounts(ctx web.Context, groupRepo repository.EventGroupRepo) ([]repository.EventGroupByUserCount, error)
UserGroupCounts 用户报警次数汇总
type TemplateController ¶
type TemplateController struct {
// contains filtered or unexported fields
}
func (*TemplateController) Add ¶
func (t *TemplateController) Add(ctx web.Context, repo repository.TemplateRepo) (*repository.Template, error)
func (*TemplateController) Delete ¶
func (t *TemplateController) Delete(ctx web.Context, repo repository.TemplateRepo) error
func (*TemplateController) Get ¶
func (t *TemplateController) Get(ctx web.Context, repo repository.TemplateRepo) (*repository.Template, error)
func (*TemplateController) Register ¶
func (t *TemplateController) Register(router *web.Router)
func (*TemplateController) Templates ¶
func (t *TemplateController) Templates(ctx web.Context, repo repository.TemplateRepo) ([]repository.Template, error)
func (*TemplateController) Update ¶
func (t *TemplateController) Update(ctx web.Context, repo repository.TemplateRepo) (*repository.Template, error)
type TemplateForm ¶
type UserController ¶
type UserController struct {
// contains filtered or unexported fields
}
func (UserController) Add ¶
func (u UserController) Add(ctx web.Context, userRepo repository.UserRepo, em event.Manager) (*repository.User, error)
func (UserController) Delete ¶
func (u UserController) Delete(ctx web.Context, userRepo repository.UserRepo, em event.Manager) error
func (UserController) Register ¶
func (u UserController) Register(router *web.Router)
func (UserController) Update ¶
func (u UserController) Update(ctx web.Context, userRepo repository.UserRepo, em event.Manager) (*repository.User, error)
func (UserController) User ¶
func (u UserController) User(ctx web.Context, userRepo repository.UserRepo) (*repository.User, error)
func (UserController) UserNames ¶
func (u UserController) UserNames(ctx web.Context, userRepo repository.UserRepo) ([]UserNameResp, error)
UserNames return all user names only
func (UserController) Users ¶
func (u UserController) Users(ctx web.Context, userRepo repository.UserRepo) web.Response
type UserForm ¶
type UserForm struct { Name string `json:"name"` Email string `json:"email"` Phone string `json:"phone"` Password string `json:"password"` Role string `json:"role"` Metas []repository.UserMeta `json:"metas"` Status string `json:"status"` // contains filtered or unexported fields }
func (*UserForm) GetMetas ¶
func (userForm *UserForm) GetMetas() []repository.UserMeta
type UserNameResp ¶
type WelcomeController ¶
type WelcomeController struct {
// contains filtered or unexported fields
}
func (*WelcomeController) Home ¶
func (w *WelcomeController) Home(ctx web.Context, req web.Request) WelcomeMessage
Home 欢迎页面,API版本信息 @Summary 欢迎页面,API版本信息 @Success 200 {object} controller.WelcomeMessage @Router / [get]
func (*WelcomeController) Register ¶
func (w *WelcomeController) Register(router *web.Router)
type WelcomeMessage ¶
type WelcomeMessage struct {
Version string `json:"version"`
}