Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidTask indicates that the task specified does not exist. ErrInvalidTask = errors.New("Invalid Task") // ErrInvalidOptions indicates that the options specified for a task are not valid. ErrInvalidOptions = errors.New("Invalid Options") )
View Source
var ( // ErrInvalidRate indicates that the rate specified for the task is not valid. ErrInvalidRate = errors.New("Invalid rate") )
Functions ¶
This section is empty.
Types ¶
type ExpireFindingsTask ¶
type ExpireFindingsTask struct {
// contains filtered or unexported fields
}
ExpireFindingsTask is a maintenance task responsible for expiring the findings that are OPEN and have not been found for a configurable time span.
func (*ExpireFindingsTask) Execute ¶
func (t *ExpireFindingsTask) Execute() (TaskResult, error)
Execute executes the ExpireFindingsTask.
func (*ExpireFindingsTask) Name ¶
func (t *ExpireFindingsTask) Name() string
Name returns this task name.
func (*ExpireFindingsTask) Type ¶
func (t *ExpireFindingsTask) Type() string
Type returns this task type.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler is responsible for scheduling and executing the maintenance tasks.
func NewScheduler ¶
func NewScheduler(log *log.Logger, tasks []TaskSchedule) *Scheduler
NewScheduler creates a new maintenance scheduler with given tasks.
type Task ¶
type Task interface { Name() string Type() string Execute() (TaskResult, error) }
Task represents a maintenance task.
type TaskSchedule ¶
type TaskSchedule struct {
// contains filtered or unexported fields
}
TaskSchedule represents a task and its execution rate time in hours.
Click to show internal directories.
Click to hide internal directories.