scheduler

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const CronLines string = "# Fluidkeys added the following line to keep you and your team's keys updated\n" +
	"# automatically with `fk sync`\n" +
	"# To configure this, edit your config file (see `ffk --help` for the location)\n" +
	"@hourly perl -e 'sleep int(rand(3600))' && /usr/local/bin/fk sync --cron-output\n"

CronLines is the string Fluidkeys adds to a user's crontab to run itself

View Source
const (
	// LaunchdFileContents is the agent file for running fk sync every 60 minutes
	LaunchdFileContents = `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Label</key>
        <string>` + launchdLabel + `</string>
        <key>ProgramArguments</key>
        <array>
            <string>/usr/local/bin/fk</string>
            <string>sync</string>
            <string>--cron-output</string>
        </array>
        <key>StartInterval</key>
        <integer>3600</integer>
    </dict>
</plist>
`
)

Variables

This section is empty.

Functions

func Disable

func Disable() (bool, error)

Disable stops Fluidkeys sync task from running regularly

func Enable

func Enable() (bool, error)

Enable schedules Fluidkeys sync task to run regularly

func Name added in v1.1.0

func Name() string

Name returns a friendly name for the scheduler

Types

type ErrModifyingCrontab added in v1.1.0

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

ErrModifyingCrontab is a custom error. It should be used to wrap any errors called during Enable or Disable to ensure the caller knows how to present the user with the steps they can take to manually recify the situation.

func (ErrModifyingCrontab) Error added in v1.1.0

func (e ErrModifyingCrontab) Error() string

Jump to

Keyboard shortcuts

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