Documentation ¶
Index ¶
- func ApplyBatchs(batchs []TaskBatch)
- func ApplyTasks(batch TaskBatch) (err error)
- func BuildMessageBody(templateBody string, templateData map[string]interface{}) ([]byte, error)
- func GetSituationKnowledge(situationID int64, situationInstanceID int64, situationTS time.Time) (map[string]interface{}, error)
- func ReplaceGlobals(tasker *Tasker) func()
- type CloseAllIssuesTask
- type CloseTodayIssuesTask
- type ContextData
- type CreateIssueTask
- type NotifyTask
- type PersistDataTask
- 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 GetSituationKnowledge ¶
func ReplaceGlobals ¶
func ReplaceGlobals(tasker *Tasker) func()
ReplaceGlobals affect a new tasker to the global manager singleton
Types ¶
type CloseAllIssuesTask ¶ added in v4.1.3
type CloseAllIssuesTask struct { ID string `json:"id"` StatesToClose string `json:"statesToClose"` }
CloseAllIssuesTask struct for close issues created from the BRMS
func (CloseAllIssuesTask) GetID ¶ added in v4.1.3
func (task CloseAllIssuesTask) GetID() string
GetID returns the task key
func (CloseAllIssuesTask) Perform ¶ added in v4.1.3
func (task CloseAllIssuesTask) Perform(key string, context ContextData) error
Perform executes the task
func (CloseAllIssuesTask) String ¶ added in v4.1.3
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 { SituationID int64 TS time.Time TemplateInstanceID int64 RuleID int64 RuleVersion int64 CaseName string }
ContextData struct to represent the data related to the context in an action perform
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 PersistDataTask ¶
PersistDataTask struct to represent a persit metadata task (use to persist situation instance metadata)
func (PersistDataTask) GetID ¶
func (task PersistDataTask) GetID() string
GetID returns the task key
func (PersistDataTask) Perform ¶
func (task PersistDataTask) Perform(key string, context ContextData) error
Perform executes the task
func (PersistDataTask) String ¶
func (task PersistDataTask) String() string
type SituationReportingTask ¶
type SituationReportingTask struct { ID string `json:"id"` Subject string `json:"subject"` BodyTemplate string `json:"bodyTemplate"` To []string `json:"to"` AttachmentFileNames []string `json:"attachmentFileNames"` AttachmentFactIDs []int64 `json:"attachmentFactIds"` Columns []string `json:"columns"` ColumnsLabel []string `json:"columnsLabel"` Separator rune `json:"separator"` SMTPHost string `json:"smtpHost"` SMTPPort string `json:"smtpPort"` SMTPUsername string `json:"smtpUsername"` SMTPPassword string `json:"smtpPassword"` 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