Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrorServiceNotFound = errors.New("service not found") ErrorServiceNotRunning = errors.New("service is not running") )
Generic errors
var ( // ScheduledSections are the command that can be scheduled (backup, retention, check, prune) ScheduledSections = []string{ constants.CommandBackup, constants.SectionConfigurationRetention, constants.CommandCheck, constants.CommandForget, constants.CommandPrune, } )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config interface {
Title() string
SubTitle() string
JobDescription() string
TimerDescription() string
Schedules() []string
Permission() string
WorkingDirectory() string
Command() string
Arguments() []string
Environment() map[string]string
Priority() string
Logfile() string
Configfile() string
GetFlag(string) (string, bool)
}
Config contains all the information needed to schedule a Job
type CrondSchedule ¶ added in v0.11.0
type CrondSchedule struct {
// contains filtered or unexported fields
}
CrondSchedule is a Scheduler using crond
func (*CrondSchedule) Close ¶ added in v0.11.0
func (s *CrondSchedule) Close()
Close does nothing when using crond
func (*CrondSchedule) DisplayStatus ¶ added in v0.11.0
func (s *CrondSchedule) DisplayStatus()
DisplayStatus does nothing in crond
func (*CrondSchedule) Init ¶ added in v0.11.0
func (s *CrondSchedule) Init() error
Init verifies crond is available on this system
func (*CrondSchedule) NewJob ¶ added in v0.11.0
func (s *CrondSchedule) NewJob(config Config) SchedulerJob
NewJob instantiates a Job object (of SchedulerJob interface) to schedule jobs
type Permission ¶
type Permission int
Permission is either system or user
const ( PermissionUser Permission = iota PermissionSystem )
Permission
func (Permission) String ¶
func (p Permission) String() string
type Scheduler ¶ added in v0.11.0
type Scheduler interface {
Init() error
Close()
NewJob(Config) SchedulerJob
DisplayStatus()
}
Scheduler interface
func NewScheduler ¶ added in v0.11.0
NewScheduler creates a Scheduler interface, which is either a CrondSchedule or a SystemdSchedule object
type SchedulerJob ¶ added in v0.11.0
SchedulerJob interface
type SystemdSchedule ¶ added in v0.11.0
type SystemdSchedule struct {
// contains filtered or unexported fields
}
SystemdSchedule is a Scheduler using systemd
func (*SystemdSchedule) Close ¶ added in v0.11.0
func (s *SystemdSchedule) Close()
Close does nothing when using systemd
func (*SystemdSchedule) DisplayStatus ¶ added in v0.11.0
func (s *SystemdSchedule) DisplayStatus()
DisplayStatus display timers in systemd
func (*SystemdSchedule) Init ¶ added in v0.11.0
func (s *SystemdSchedule) Init() error
Init verifies systemd is available on this system
func (*SystemdSchedule) NewJob ¶ added in v0.11.0
func (s *SystemdSchedule) NewJob(config Config) SchedulerJob
NewJob instantiates a Job object (of SchedulerJob interface) to schedule jobs