executor

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExecutionimeout = errors.New("execution timeout")
	ErrRestNotOk       = errors.New("rest return non 2XX response")
)

Functions

This section is empty.

Types

type DockerExec

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

func NewDockerExec

func NewDockerExec(image string, timeout time.Duration) *DockerExec

func (*DockerExec) Exec

func (e *DockerExec) Exec(code []byte, arg string, env interface{}) (ExecResult, error)

type ExecResult

type ExecResult struct {
	Output  []byte
	Code    uint32
	Version string
}

type Executor

type Executor interface {
	Exec(exec []byte, arg string, env interface{}) (ExecResult, error)
}

func NewExecutor

func NewExecutor(executor string) (exec Executor, err error)

NewExecutor returns executor by name and executor URL

type MultiError

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

MultiError encapsulates error messages from the underlying executors into one error.

func (*MultiError) Error

func (e *MultiError) Error() string

Error implements error interface for MultiError by returning all error messages concatenated.

type MultiExec

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

MutliExec is a higher-order executor that utlizes the underlying executors to perform Exec.

func NewMultiExec

func NewMultiExec(execs []Executor, strategy string) (*MultiExec, error)

NewMultiExec creates a new MultiExec instance.

func (*MultiExec) Exec

func (e *MultiExec) Exec(code []byte, arg string, env interface{}) (ExecResult, error)

Exec implements Executor interface for MultiExec.

type RestExec

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

func NewRestExec

func NewRestExec(url string, timeout time.Duration) *RestExec

func (*RestExec) Exec

func (e *RestExec) Exec(code []byte, arg string, env interface{}) (ExecResult, error)

Jump to

Keyboard shortcuts

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