exec

package
v0.0.0-...-717c872 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerExecutor

type DockerExecutor struct {
	// contains filtered or unexported fields
}

DockerExecutor executes tasks inside containers.

func Docker

func Docker(conf plan.Config) (*DockerExecutor, error)

Docker returns an initialized DockerExecutor, or an error if it can't contact Docker server.

func (*DockerExecutor) Run

func (d *DockerExecutor) Run(t task.Task) error

Run the task by launching a new Docker container for it.

type Executor

type Executor interface {
	// Run executes the task and returns the result.
	Run(t task.Task) error
}

Executor is an interface for task executors.

type FuncExecutor

type FuncExecutor func(task.Task) error

FuncExecutor wraps a function. It gives each task as a parameter to the function.

func (FuncExecutor) Run

func (f FuncExecutor) Run(t task.Task) error

Run the task t by giving it to the function this executor was initialized with.

type NoopExecutor

type NoopExecutor struct {
}

NoopExecutor does not execute tasks, only logs them.

func Noop

func Noop() *NoopExecutor

Noop returns a new NoopExecutor.

func (*NoopExecutor) Run

func (n *NoopExecutor) Run(t task.Task) error

Run the task by logging its command.

type ProcExecutor

type ProcExecutor struct {
	// contains filtered or unexported fields
}

ProcExecutor executes tasks by giving them to the system shell. It uses the -c parameter.

func Proc

func Proc(timeout time.Duration) *ProcExecutor

Proc returns a new ProcExecutor.

func (*ProcExecutor) Run

func (pe *ProcExecutor) Run(t task.Task) error

Run the task by spawning a shell (sh -c <cmd>).

Jump to

Keyboard shortcuts

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