-
Notifications
You must be signed in to change notification settings - Fork 0
/
schedulerInterface.go
44 lines (38 loc) · 1.41 KB
/
schedulerInterface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) PavedRoad. All rights reserved.
// Licensed under the Apache2. See LICENSE file in the project root
// for full license information.
//
package main
import "os"
// Scheduler defines the interfaces a scheduler must implement
type Scheduler interface {
// Data methods
// For schedulers
GetSchedule() (httpStatusCode int, jsonBlob []byte, err error)
UpdateSchedule(jsonBlob []byte) (httpStatusCode int, jsonb []byte, err error)
CreateSchedule(jsonBlob []byte) (httpStatusCode int, jsonb []byte, err error)
DeleteSchedule() (httpStatusCode int, jsonb []byte, err error)
// For jobs
GetScheduledJobs() ([]byte, error)
GetScheduleJob(UUID string) (httpStatusCode int, jsonBlob []byte, err error)
UpdateScheduleJob(jsonBlob []byte) (httpStatusCode int, jsonb []byte, err error)
CreateScheduleJob(jsonBlob []byte) (httpStatusCode int, jsonb []byte, err error)
DeleteScheduleJob(UUID string) (httpStatusCode int, jsonb []byte, err error)
// Execution methods
Init() error
SetChannels(chan Job, chan Result, chan bool, chan os.Signal)
Shutdown() error
Run() error
//RestartScheduler() error
//RestartResultsCollector() error
// Status methods
Metrics() []byte
//Status()
//RestartScheduler() error
//RestartResultsCollector() error
}
// SchedulerStatus tracks if the scheduler and Results collectors are running
type SchedulerStatus struct {
SchedulerRunning bool
ResultCollectorRunning bool
}