Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) BulkCreateReportSchedules(schedules []ReportBulkSchedule) error
- func (c *Client) BulkCreateScanSchedules(schedules []ScanBulkSchedule) error
- func (c *Client) CreateReportSchedule(teamID, cronExpr string) error
- func (c *Client) CreateScanSchedule(programID, teamID, cronExpr string) error
- func (c *Client) DeleteReportSchedule(teamID string) error
- func (c *Client) DeleteScanSchedule(programID string) error
- func (c *Client) GetReportScheduleByID(teamID string) (string, error)
- func (c *Client) GetScanScheduleByID(programID string) (string, error)
- type Config
- type ReportBulkSchedule
- type ReportScheduler
- type ScanBulkSchedule
- type ScanScheduler
Constants ¶
This section is empty.
Variables ¶
var ( // ErrScheduleNotFound is returned when crontinuos answers with 404 status. ErrScheduleNotFound = errors.New("ScheduleNotFound") // ErrInvalidSchedulePeriod is returned when the schedule period is less than the minimum allowed. ErrInvalidSchedulePeriod = errors.New("Schedule program period less than the minimun allowed") // ErrInvalidCronExpr is returned when the given cron expression is not valid. ErrInvalidCronExpr = errors.New("Invalid Cron Expression") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides functionalities for calling vulcan-scheduler.
func (*Client) BulkCreateReportSchedules ¶
func (c *Client) BulkCreateReportSchedules(schedules []ReportBulkSchedule) error
BulkCreateReportSchedules creates report schedules in bulk. It only creates a schedule for a program if no schedule for thar program already exist.
func (*Client) BulkCreateScanSchedules ¶
func (c *Client) BulkCreateScanSchedules(schedules []ScanBulkSchedule) error
BulkCreateScanSchedules creates scan schedules in bulk. It only creates a schedule for a program if no schedule for thar program already exist.
func (*Client) CreateReportSchedule ¶
CreateReportSchedule creates a new report schedule for executing a program.
func (*Client) CreateScanSchedule ¶
CreateScanSchedule creates a new scan schedule for executing a program.
func (*Client) DeleteReportSchedule ¶
DeleteReportSchedule executes a request against the scheduler component for deleting a report schedule.
func (*Client) DeleteScanSchedule ¶
DeleteScanSchedule executes a request against the scheduler component for deleting a scan schedule.
func (*Client) GetReportScheduleByID ¶
GetReportScheduleByID gets the cron string defining the report schedule for a given id. If the scheduler doesn't have a schedule defined for the given id the func will return empty cron string.
type Config ¶
type Config struct { URL string `mapstructure:"url"` MinimumInterval float64 `mapstructure:"minimum_interval"` }
Config holds the configuration needed by the schuduler client.
type ReportBulkSchedule ¶
type ReportBulkSchedule struct { Str string `json:"str"` TeamID string `json:"team_id"` Overwrite bool `json:"overwrite"` }
ReportBulkSchedule defines the information needed to create a report schedule in a bulk create operation.