Documentation ¶
Index ¶
- func ApplyBatchs(batchs []TaskBatch)
- func ApplyTasks(batch TaskBatch) (err error)
- func BuildMessageBody(templateBody string, templateData map[string]interface{}) ([]byte, error)
- func ReplaceGlobals(tasker *Tasker) func()
- type CloseAllIssuesTask
- type CloseTodayIssuesTask
- type ContextData
- type CreateIssueTask
- type NotifyTask
- type SituationReportingTask
- type Task
- type TaskBatch
- type Tasker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyTasks ¶
ApplyTasks applies the task of an evaluated situation
func BuildMessageBody ¶
func ReplaceGlobals ¶
func ReplaceGlobals(tasker *Tasker) func()
ReplaceGlobals affect a new tasker to the global manager singleton
Types ¶
type CloseAllIssuesTask ¶
type CloseAllIssuesTask struct { ID string `json:"id"` StatesToClose string `json:"statesToClose"` }
CloseAllIssuesTask struct for close issues created from the BRMS
func (CloseAllIssuesTask) GetID ¶
func (task CloseAllIssuesTask) GetID() string
GetID returns the task key
func (CloseAllIssuesTask) Perform ¶
func (task CloseAllIssuesTask) Perform(key string, context ContextData) error
Perform executes the task
func (CloseAllIssuesTask) String ¶
func (task CloseAllIssuesTask) String() string
type CloseTodayIssuesTask ¶
CloseTodayIssuesTask struct for close issues created in the current day from the BRMS
func (CloseTodayIssuesTask) GetID ¶
func (task CloseTodayIssuesTask) GetID() string
GetID returns the task key
func (CloseTodayIssuesTask) Perform ¶
func (task CloseTodayIssuesTask) Perform(key string, context ContextData) error
Perform executes the task
func (CloseTodayIssuesTask) String ¶
func (task CloseTodayIssuesTask) String() string
type ContextData ¶
type ContextData struct { RuleID int64 RuleVersion int64 CaseName string SituationID int64 TemplateInstanceID int64 TS time.Time HistorySituationFlattenData map[string]interface{} SituationHistoryID int64 }
ContextData struct to represent the data related to the context in an action perform
func BuildContextData ¶
func BuildContextData(inputs ...map[string]interface{}) ContextData
type CreateIssueTask ¶
type CreateIssueTask struct { ID string `json:"id"` Name string `json:"name"` Level string `json:"level"` Timeout string `json:"timeout"` IsNotification bool `json:"isNotification"` }
CreateIssueTask struct for the creation of an issue from the BRMS
func (CreateIssueTask) GetID ¶
func (task CreateIssueTask) GetID() string
GetID returns the task key
func (CreateIssueTask) Perform ¶
func (task CreateIssueTask) Perform(key string, context ContextData) error
Perform executes the task
func (CreateIssueTask) String ¶
func (task CreateIssueTask) String() string
type NotifyTask ¶
type NotifyTask struct { ID string `json:"id"` Level string `json:"level"` Name string `json:"name"` Description string `json:"description"` Timeout string `json:"timeout"` Context map[string]interface{} `json:"context,omitempty"` }
NotifyTask struct to represent a notification task
func (NotifyTask) Perform ¶
func (task NotifyTask) Perform(key string, context ContextData) error
Perform executes the task
func (NotifyTask) String ¶
func (task NotifyTask) String() string
type SituationReportingTask ¶
type SituationReportingTask struct { ID string `json:"id"` IssueID string `json:"issueId"` Subject string `json:"subject"` BodyTemplate string `json:"bodyTemplate"` To []string `json:"to"` AttachmentFileNames []string `json:"attachmentFileNames"` AttachmentFactIDs []int64 `json:"attachmentFactIds"` Columns []export.Column `json:"columns"` Separator rune `json:"separator"` Timeout string `json:"timeout"` }
SituationReportingTask struct for close issues created in the current day from the BRMS
func (SituationReportingTask) GetID ¶
func (task SituationReportingTask) GetID() string
GetID returns the task key
func (SituationReportingTask) Perform ¶
func (task SituationReportingTask) Perform(key string, context ContextData) error
Perform executes the task
func (SituationReportingTask) String ¶
func (task SituationReportingTask) String() string
type Task ¶
type Task interface { String() string GetID() string Perform(key string, input ContextData) error }
Task interface of tasks
type Tasker ¶
type Tasker struct { BatchReceiver chan []TaskBatch Close chan struct{} }
Tasker represents the actions router, it process the BRMS results and triggers the actions.
func (*Tasker) StartBatchProcessor ¶
func (t *Tasker) StartBatchProcessor()
StartBatchProcessor starts the go routines that will listen to all the incoming batchs
func (*Tasker) StopBatchProcessor ¶
func (t *Tasker) StopBatchProcessor()
StopBatchProcessor stops the batchprocessor