Documentation ¶
Overview ¶
Package executor is a generated GoMock package.
Index ¶
- func TaskDetails(task Task) map[string]interface{}
- type MockTask
- func (m *MockTask) Alert() string
- func (m *MockTask) BlockTTL() time.Duration
- func (m *MockTask) EXPECT() *MockTaskMockRecorder
- func (m *MockTask) EventID() string
- func (m *MockTask) Exec(logger *logrus.Logger) error
- func (m *MockTask) ExecutorDetails() interface{}
- func (m *MockTask) ExecutorName() string
- func (m *MockTask) Fingerprint() string
- func (m *MockTask) Rule() string
- type MockTaskExecutor
- type MockTaskExecutorMockRecorder
- type MockTaskMockRecorder
- func (mr *MockTaskMockRecorder) Alert() *gomock.Call
- func (mr *MockTaskMockRecorder) BlockTTL() *gomock.Call
- func (mr *MockTaskMockRecorder) EventID() *gomock.Call
- func (mr *MockTaskMockRecorder) Exec(logger interface{}) *gomock.Call
- func (mr *MockTaskMockRecorder) ExecutorDetails() *gomock.Call
- func (mr *MockTaskMockRecorder) ExecutorName() *gomock.Call
- func (mr *MockTaskMockRecorder) Fingerprint() *gomock.Call
- func (mr *MockTaskMockRecorder) Rule() *gomock.Call
- type Task
- type TaskBase
- type TaskExecutor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TaskDetails ¶
TaskDetails returns task details as a map. It used for logging.
Types ¶
type MockTask ¶
type MockTask struct {
// contains filtered or unexported fields
}
MockTask is a mock of Task interface
func NewMockTask ¶
func NewMockTask(ctrl *gomock.Controller) *MockTask
NewMockTask creates a new mock instance
func (*MockTask) EXPECT ¶
func (m *MockTask) EXPECT() *MockTaskMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockTask) ExecutorDetails ¶
func (m *MockTask) ExecutorDetails() interface{}
ExecutorDetails mocks base method
func (*MockTask) ExecutorName ¶
ExecutorName mocks base method
func (*MockTask) Fingerprint ¶
Fingerprint mocks base method
type MockTaskExecutor ¶
type MockTaskExecutor struct {
// contains filtered or unexported fields
}
MockTaskExecutor is a mock of TaskExecutor interface
func NewMockTaskExecutor ¶
func NewMockTaskExecutor(ctrl *gomock.Controller) *MockTaskExecutor
NewMockTaskExecutor creates a new mock instance
func (*MockTaskExecutor) EXPECT ¶
func (m *MockTaskExecutor) EXPECT() *MockTaskExecutorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockTaskExecutor) NewTask ¶
func (m *MockTaskExecutor) NewTask(eventID, rule, alert string, blockTTL time.Duration, preparedParameters map[string]interface{}) Task
NewTask mocks base method
func (*MockTaskExecutor) ValidateParameters ¶
func (m *MockTaskExecutor) ValidateParameters(parameters map[string]interface{}) error
ValidateParameters mocks base method
type MockTaskExecutorMockRecorder ¶
type MockTaskExecutorMockRecorder struct {
// contains filtered or unexported fields
}
MockTaskExecutorMockRecorder is the mock recorder for MockTaskExecutor
func (*MockTaskExecutorMockRecorder) NewTask ¶
func (mr *MockTaskExecutorMockRecorder) NewTask(eventID, rule, alert, blockTTL, preparedParameters interface{}) *gomock.Call
NewTask indicates an expected call of NewTask
func (*MockTaskExecutorMockRecorder) ValidateParameters ¶
func (mr *MockTaskExecutorMockRecorder) ValidateParameters(parameters interface{}) *gomock.Call
ValidateParameters indicates an expected call of ValidateParameters
type MockTaskMockRecorder ¶
type MockTaskMockRecorder struct {
// contains filtered or unexported fields
}
MockTaskMockRecorder is the mock recorder for MockTask
func (*MockTaskMockRecorder) Alert ¶
func (mr *MockTaskMockRecorder) Alert() *gomock.Call
Alert indicates an expected call of Alert
func (*MockTaskMockRecorder) BlockTTL ¶
func (mr *MockTaskMockRecorder) BlockTTL() *gomock.Call
BlockTTL indicates an expected call of BlockTTL
func (*MockTaskMockRecorder) EventID ¶
func (mr *MockTaskMockRecorder) EventID() *gomock.Call
EventID indicates an expected call of EventID
func (*MockTaskMockRecorder) Exec ¶
func (mr *MockTaskMockRecorder) Exec(logger interface{}) *gomock.Call
Exec indicates an expected call of Exec
func (*MockTaskMockRecorder) ExecutorDetails ¶
func (mr *MockTaskMockRecorder) ExecutorDetails() *gomock.Call
ExecutorDetails indicates an expected call of ExecutorDetails
func (*MockTaskMockRecorder) ExecutorName ¶
func (mr *MockTaskMockRecorder) ExecutorName() *gomock.Call
ExecutorName indicates an expected call of ExecutorName
func (*MockTaskMockRecorder) Fingerprint ¶
func (mr *MockTaskMockRecorder) Fingerprint() *gomock.Call
Fingerprint indicates an expected call of Fingerprint
func (*MockTaskMockRecorder) Rule ¶
func (mr *MockTaskMockRecorder) Rule() *gomock.Call
Rule indicates an expected call of Rule
type Task ¶
type Task interface { // EventID returns event ID. EventID() string // Rule returns rule name. Rule() string // Alert returns alert name. Alert() string // BlockTTL returns TTL for blocking task after execute. // If return 0, task not blocked. BlockTTL() time.Duration ExecutorName() string // ExecutorDetails returns structured information about task (for example, parameters) // It used for TaskDetails function. ExecutorDetails() interface{} // Fingerprint returns uniq string represents task fingerprint. // It used for blocking task. Fingerprint() string // Exec executes task. Exec(logger *logrus.Logger) error }
Task is the interface implemented by executor used for execute tasks and get task information.
type TaskBase ¶
type TaskBase struct {
// contains filtered or unexported fields
}
TaskBase implements basic Task methods.
type TaskExecutor ¶
type TaskExecutor interface { NewTask(eventID, rule, alert string, blockTTL time.Duration, preparedParameters map[string]interface{}) Task ValidateParameters(parameters map[string]interface{}) error }
TaskExecutor is the interface implemented by executor used for validate task parameters and create tasks.
Directories ¶
Path | Synopsis |
---|---|
Package httpe is a generated GoMock package.
|
Package httpe is a generated GoMock package. |
Package jenkins is a generated GoMock package.
|
Package jenkins is a generated GoMock package. |
Package telegram is a generated GoMock package.
|
Package telegram is a generated GoMock package. |