Documentation ¶
Index ¶
- func CreateRepositoryEventQuerier(msgRepo repository.EventRepo) func(groupID primitive.ObjectID, limit int64) []repository.Event
- type Action
- type AliyunVoiceCallAction
- type DingdingAction
- type DingdingMeta
- type EmailAction
- type EmailMeta
- type EventQuerier
- type HTTPAction
- type HTTPHeaderMeta
- type HTTPMeta
- type JiraAction
- type JiraMeta
- type Manager
- type Payload
- func (payload *Payload) Decode(data []byte) error
- func (payload *Payload) Encode() []byte
- func (payload *Payload) EventType() string
- func (payload *Payload) Events(limit int64) []repository.Event
- func (payload *Payload) FirstEvent() repository.Event
- func (payload *Payload) Init(eventQuerier EventQuerier)
- func (payload *Payload) IsPlain() bool
- func (payload *Payload) IsRecoverable() bool
- func (payload *Payload) IsRecovery() bool
- func (payload *Payload) MessageType() string
- func (payload *Payload) Messages(limit int64) []repository.Event
- type Provider
- type QueueAction
- type SmsAliyun
- type SmsYunxin
- type VoiceCallMeta
- type WechatAction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateRepositoryEventQuerier ¶
func CreateRepositoryEventQuerier(msgRepo repository.EventRepo) func(groupID primitive.ObjectID, limit int64) []repository.Event
CreateRepositoryEventQuerier 创建仓库事件查询器
Types ¶
type Action ¶
type Action interface { Validate(meta string, userRefs []string) error Handle(rule repository.Rule, trigger repository.Trigger, grp repository.EventGroup) error }
Action 触发动作接口
type AliyunVoiceCallAction ¶
type AliyunVoiceCallAction struct {
// contains filtered or unexported fields
}
func NewPhoneCallAliyunAction ¶
func NewPhoneCallAliyunAction(manager Manager) *AliyunVoiceCallAction
func (AliyunVoiceCallAction) Handle ¶
func (w AliyunVoiceCallAction) Handle(rule repository.Rule, trigger repository.Trigger, grp repository.EventGroup) error
type DingdingAction ¶
type DingdingAction struct {
// contains filtered or unexported fields
}
DingdingAction 钉钉发送动作
func NewDingdingAction ¶
func NewDingdingAction(manager Manager) *DingdingAction
NewDingdingAction create a new dingdingAction
func (DingdingAction) Handle ¶
func (d DingdingAction) Handle(rule repository.Rule, trigger repository.Trigger, grp repository.EventGroup) error
Handle 钉钉动作处理
type DingdingMeta ¶
DingdingMeta 钉钉发送元数据
type EmailAction ¶
type EmailAction struct {
// contains filtered or unexported fields
}
func NewEmailAction ¶
func NewEmailAction(manager Manager, conf *configs.Config) *EmailAction
func (EmailAction) Handle ¶
func (e EmailAction) Handle(rule repository.Rule, trigger repository.Trigger, grp repository.EventGroup) error
type EventQuerier ¶
type EventQuerier func(groupID primitive.ObjectID, limit int64) []repository.Event
EventQuerier 事件查询接口
type HTTPAction ¶
type HTTPAction struct {
// contains filtered or unexported fields
}
HTTPAction HTTP 动作
func NewHTTPAction ¶
func NewHTTPAction(manager Manager) *HTTPAction
NewHTTPAction create a new HTTPAction
func (HTTPAction) Handle ¶
func (act HTTPAction) Handle(rule repository.Rule, trigger repository.Trigger, grp repository.EventGroup) error
Handle 动作处理
type HTTPHeaderMeta ¶
HTTPHeaderMeta HTTP 请求头
type HTTPMeta ¶
type HTTPMeta struct { URL string `json:"url"` Method string `json:"method"` Headers []HTTPHeaderMeta `json:"headers"` Body string `json:"body"` }
HTTPMeta HTTP 元数据
type JiraAction ¶
type JiraAction struct {
// contains filtered or unexported fields
}
JiraAction Jira 发送动作
func NewJiraAction ¶
func NewJiraAction(manager Manager) *JiraAction
NewJiraAction create a new jira Action
func (JiraAction) Handle ¶
func (act JiraAction) Handle(rule repository.Rule, trigger repository.Trigger, grp repository.EventGroup) error
Handle 动作处理
type JiraMeta ¶
type JiraMeta struct { Issue jira.Issue `json:"issue"` Constraints []jira.CustomField `json:"constraints"` }
JiraMeta Jira 动作元数据
type Manager ¶
type Manager interface { Resolve(f interface{}) error MustResolve(f interface{}) Get(key interface{}) (interface{}, error) Dispatch(action string) QueueAction Run(action string) Action Register(name string, action Action) }
Manager 动作管理器接口
type Payload ¶
type Payload struct { Action string `json:"action"` Rule repository.Rule `json:"rule"` Trigger repository.Trigger `json:"trigger"` Group repository.EventGroup `json:"group"` RuleTemplateParsed string `json:"rule_template_parsed"` PreviewURL string `json:"preview_url"` ReportURL string `json:"report_url"` // contains filtered or unexported fields }
Payload 事件描述生成时使用的对象,用于模板解析
func CreatePayload ¶
func CreatePayload(conf *configs.Config, eventQuerier EventQuerier, action string, rule repository.Rule, trigger repository.Trigger, grp repository.EventGroup) *Payload
CreatePayload 创建一个 Payload
func (*Payload) Events ¶
func (payload *Payload) Events(limit int64) []repository.Event
Events get messages for group
func (*Payload) FirstEvent ¶
func (payload *Payload) FirstEvent() repository.Event
FirstEvent get first event
func (*Payload) Init ¶
func (payload *Payload) Init(eventQuerier EventQuerier)
Init initialize a payload
func (*Payload) IsRecoverable ¶
IsRecoverable return whether the messages in group is recoverable message
func (*Payload) IsRecovery ¶
IsRecovery return whether the messages in group is recovery message
func (*Payload) MessageType ¶
MessageType return message type in group This method is depressed
type QueueAction ¶
type QueueAction struct {
// contains filtered or unexported fields
}
QueueAction 动作队列
func (QueueAction) Handle ¶
func (q QueueAction) Handle(rule repository.Rule, tr repository.Trigger, grp repository.EventGroup) (trigger repository.Trigger, err error)
Handle 动作处理
type SmsAliyun ¶
type SmsAliyun struct {
// contains filtered or unexported fields
}
func NewSmsAliyunAction ¶
func (SmsAliyun) Handle ¶
func (w SmsAliyun) Handle(rule repository.Rule, trigger repository.Trigger, grp repository.EventGroup) error
type SmsYunxin ¶
type SmsYunxin struct {
// contains filtered or unexported fields
}
func NewSmsYunxinAction ¶
func (SmsYunxin) Handle ¶
func (w SmsYunxin) Handle(rule repository.Rule, trigger repository.Trigger, grp repository.EventGroup) error
type VoiceCallMeta ¶
type VoiceCallMeta struct {
Title string `json:"title"`
}
type WechatAction ¶
type WechatAction struct {
// contains filtered or unexported fields
}
func NewWechatAction ¶
func NewWechatAction(manager Manager) *WechatAction
func (WechatAction) Handle ¶
func (w WechatAction) Handle(rule repository.Rule, trigger repository.Trigger, grp repository.EventGroup) error