api_db

package
v0.0.0-...-374d589 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivateJobs

func ActivateJobs(db *gorm.DB, jobNames []string)

ActivateJobs should be called on any jobs that are to be triggered. This will increment their count, as well as set the next run and last run times.

func AddAutomaticJob

func AddAutomaticJob(db *gorm.DB, job api_models.AutomaticJob) error

AddAutomaticJob will create a new job.

func DeleteJob

func DeleteJob(db *gorm.DB, jobName string)

DeleteJob will remove a job from the database.

func RetrieveAllJobs

func RetrieveAllJobs(db *gorm.DB) []api_models.AutomaticJob

RetrieveAllJobs will return a slice with all AutomaticJobs in the database.

func RetrieveNamedJobs

func RetrieveNamedJobs(db *gorm.DB, jobNames []string) []api_models.AutomaticJob

RetrieveNamedJobs will return a slice of all AutomaticJobs that match the jobNames in the string slice provided.

func RetrievePendingJobs

func RetrievePendingJobs(db *gorm.DB) []api_models.AutomaticJob

RetrievePendingJobs will return a slice of all AutomaticJobs in the database that are enabled and due to run at any time.

func ToggleJob

func ToggleJob(db *gorm.DB, jobName string)

ToggleJob will either enable or disable a job, depending on its current state.

func UpdateJob

func UpdateJob(db *gorm.DB, job api_models.AutomaticJob) error

UpdateJob will update an existing job, or create the job if it does not yet exist.

Types

This section is empty.

Jump to

Keyboard shortcuts

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