schedule

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2020 License: GPL-3.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorServiceNotFound   = errors.New("service not found")
	ErrorServiceNotRunning = errors.New("service is not running")
)

Generic errors

View Source
var (
	// ScheduledSections are the command that can be scheduled (backup, retention, check)
	ScheduledSections = []string{
		constants.CommandBackup,
		constants.SectionConfigurationRetention,
		constants.CommandCheck,
	}
)

Functions

func Close

func Close()

Close does nothing in systemd

func Init

func Init() error

Init verifies systemd is available on this system

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
	Nice() int
	Logfile() string
}

Config contains all the information needed to schedule a Job

type Job

type Job struct {
	// contains filtered or unexported fields
}

Job scheduler

func NewJob

func NewJob(config Config) *Job

NewJob instantiates a Job object to schedule jobs

func (*Job) Create

func (j *Job) Create() error

Create a new job

func (*Job) Remove

func (j *Job) Remove() error

Remove a job

func (*Job) Status

func (j *Job) Status() error

Status of a job

func (*Job) Update

func (j *Job) Update() error

Update an existing job

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL