tasks

package
v0.6.181 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogErr

func LogErr(f func() error) func()

func RunTaskAsDaemon

func RunTaskAsDaemon(tasks []Task, store RunTaskAsDaemonStore) error

func RunTasks

func RunTasks(tasks []Task) error

Types

type RunTaskAsDaemonStore added in v0.6.24

type RunTaskAsDaemonStore interface {
	BuildBrevHome() error
	GetBrevHomePath() (string, error)
}

type Task

type Task interface {
	Run() error
	Configure() error
	GetTaskSpec() TaskSpec
}

type TaskRunner

type TaskRunner struct {
	Tasks       []Task
	StopSignals chan os.Signal
}

func NewTaskRunner

func NewTaskRunner(tasks []Task) *TaskRunner

func (TaskRunner) Run

func (tr TaskRunner) Run() error

func (*TaskRunner) SendStop

func (tr *TaskRunner) SendStop()

func (TaskRunner) WaitTillSignal

func (tr TaskRunner) WaitTillSignal(ctxfn func() context.Context)

type TaskSpec

type TaskSpec struct {
	Cron               string // can be "" if want to run once // https://pkg.go.dev/github.com/robfig/cron?utm_source=godoc#hdr-CRON_Expression_Format
	RunCronImmediately bool   // only applied if cron not ""
}

Jump to

Keyboard shortcuts

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