jamboy

package module
v0.0.0-...-6f76032 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enqueue

func Enqueue(ctx context.Context, c *jasper.Command, q amboy.Queue) error

Enqueue adds separate jobs to the queue for every operation captured in the command. These operations will execute in parallel. The output of the operations is captured in the body of the job.

func EnqueueForeground

func EnqueueForeground(ctx context.Context, c *jasper.Command, q amboy.Queue) error

EnqueueForeground adds separate jobs to the queue for every operation captured in the command. These operations will execute in parallel. The output of the commands are logged, using the default grip sender in the foreground.

func Jobs

func Jobs(c *jasper.Command) ([]amboy.Job, error)

Jobs returns a slice of jobs for every operation in the command. The output of the commands are captured in the body of the job.

func JobsForeground

func JobsForeground(c *jasper.Command) ([]amboy.Job, error)

JobsForeground returns a slice of jobs for every operation captured in the command. The output of the commands are logged, using the default grip sender in the foreground.

func NewDownloadJob

func NewDownloadJob(url, path string, force bool) (amboy.Job, error)

NewDownloadJob constructs a new amboy-compatible Job that can download and extract (if tarball) a file to the local filesystem. The job has a dependency on the downloaded file's path, and will only execute if that file does not exist, unless the force flag is passed.

func NewJob

func NewJob(pc jasper.ProcessConstructor, cmd string) amboy.Job

NewJob constructs an amboy job that wraps a provided ProcessConstructor. The identifier of the job includes a hash of the command, so running the same command repeatedly may result in job collisions.

Pass the process constructor to allow the amboy jobs to manipulate processes in an existing Manager.

func NewJobBasic

func NewJobBasic(cmd string) amboy.Job

NewJobBasic constructs an amboy job that uses jasper process management internally. The identifier of the job includes a hash of the command, so running the same command repeatedly may result in job collisions.

func NewJobBasicForeground

func NewJobBasicForeground(opts *options.Create) amboy.Job

NewJobBasicForeground creates an amboy job that writes all output linewise to the current processes global grip logging instance with error and output separated by level.

func NewJobExtended

func NewJobExtended(pc jasper.ProcessConstructor, cmd string, env map[string]string, wd string) amboy.Job

NewJobExtended builds a job that creates a process with environment variables and a working directory defined. The identifier of the job includes a hash of the command, so running the same command repeatedly may result in job collisions.

Pass the process constructor to allow the amboy jobs to manipulate processes in an existing Manager.

func NewJobForeground

func NewJobForeground(pc jasper.ProcessConstructor, opts *options.Create) amboy.Job

NewJobForeground creates an amboy job that writes all output linewise to the current processes global grip logging instance with error and output separated by level.

Pass the process constructor to allow the amboy jobs to manipulate processes in an existing Manager.

func RegisterJobs

func RegisterJobs(pc jasper.ProcessConstructor)

RegisterJobs adds factories for the job types provided by these packages to make it possible to dispatch these jobs to a remote/distributed queue.

Types

type Job

type Job amboy.Job

Job is an alias for an amboy.Job, mostly for purposes of making the godoc for the package appear reasonable.

func NewJobBasicExtended

func NewJobBasicExtended(cmd string, env map[string]string, wd string) Job

NewJobBasicExtended builds a job that creates a process with environment variables and a working directory defined. The identifier of the job includes a hash of the command, so running the same command repeatedly may result in job collisions.

func NewJobOptions

func NewJobOptions(pc jasper.ProcessConstructor, opts *options.Create) Job

NewJobOptions creates a new job using the options to define the parameters of the job. The identifier of the job is the hash of the options structure.

Pass the process constructor to allow the amboy jobs to manipulate processes in an existing Manager.

Jump to

Keyboard shortcuts

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