cron

package module
v0.0.0-...-176584a Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultProperties is a map of all valid cron properties with corresponding default property values
	DefaultProperties = map[string]string{
		"mailto": "",
	}

	// GlobalProperties is a map of all valid global cron properties
	GlobalProperties = map[string]bool{
		"mailto": true,
	}
)

Functions

func CommandList

func CommandList(appName string, format string) error

CommandList lists all scheduled cron tasks for a given app

func CommandReport

func CommandReport(appName string, format string, infoFlag string) error

CommandReport displays a cron report for one or more apps

func CommandRun

func CommandRun(appName string, cronID string, detached bool) error

CommandRun executes a cron command on the fly

func CommandSet

func CommandSet(appName string, property string, value string) error

CommandSet set or clear a cron property for an app

func GenerateCommandID

func GenerateCommandID(appName string, c appjson.CronCommand) string

GenerateCommandID creates a unique ID for a given app/command/schedule combination

func ReportSingleApp

func ReportSingleApp(appName string, format string, infoFlag string) error

ReportSingleApp is an internal function that displays the cron report for one or more apps

func TriggerCronGetProperty

func TriggerCronGetProperty(appName string, key string) error

TriggerCronGetProperty writes the cron key to stdout for a given app container

func TriggerInstall

func TriggerInstall() error

TriggerInstall runs the install step for the cron plugin

func TriggerPostAppCloneSetup

func TriggerPostAppCloneSetup(oldAppName string, newAppName string) error

TriggerPostAppCloneSetup creates new cron files

func TriggerPostAppRenameSetup

func TriggerPostAppRenameSetup(oldAppName string, newAppName string) error

TriggerPostAppRenameSetup renames cron files

func TriggerPostDelete

func TriggerPostDelete(appName string) error

TriggerPostDelete destroys the cron property for a given app container

Types

type TemplateCommand

type TemplateCommand struct {
	// ID is a unique identifier for the cron command
	ID string `json:"id"`

	// App is the app the cron command belongs to
	App string `json:"app"`

	// Command is the command to run
	Command string `json:"command"`

	// Schedule is the cron schedule
	Schedule string `json:"schedule"`

	// AltCommand is an alternate command to run
	AltCommand string `json:"-"`

	// LogFile is the log file to write to
	LogFile string `json:"-"`
}

TemplateCommand is a struct that represents a cron command

func FetchCronEntries

func FetchCronEntries(appName string) ([]TemplateCommand, error)

FetchCronEntries returns a list of cron commands for a given app

func (TemplateCommand) CronCommand

func (t TemplateCommand) CronCommand() string

CronCommand returns the command to run for a given cron command

Directories

Path Synopsis
src

Jump to

Keyboard shortcuts

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