jobs

package
v0.0.0-...-7ca99a0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	ID        string
	Name      string
	Events    []string
	Status    string
	Completed bool
	Error     error
	Fn        JobFunction `json:"-"`
}

Job is a task being run asyncronosly

func All

func All() []*Job

func Get

func Get(ID string) *Job

func NewJob

func NewJob(name string, fn JobFunction) (j *Job)

func (*Job) GenerateID

func (j *Job) GenerateID()

func (*Job) Run

func (j *Job) Run()

func (*Job) SetStatus

func (j *Job) SetStatus(status string)

type JobFunction

type JobFunction func(*Job) error

JobFunction is a function to be run asyncronosly as a job

Jump to

Keyboard shortcuts

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