executor

package
v0.0.0-...-f267496 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package executor provides an abstration for executing actors using an external tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	StdoutFile string
	StderrFile string

	Stdin string
	// contains filtered or unexported fields
}

Command represents the command to be executed along its stdin.

func New

func New(actorName, stdin string) *Command

New initializes a new Command that works with actorRunner

func NewProcess

func NewProcess(process string, args ...string) *Command

NewProcess initializes a new Command

func (*Command) Execute

func (c *Command) Execute() (*Result, error)

Execute executes a given command passing data to its stdin. It returns a Result struct mapping the info returned by the process executed.

type CommandExecutionError

type CommandExecutionError string

CommandExecutionError is raised for errors happening in this package

func (CommandExecutionError) Error

func (cee CommandExecutionError) Error() string

type Result

type Result struct {
	Stderr   string `json:"stderr"`
	Stdout   string `json:"stdout"`
	ExitCode int    `json:"exit_code"`
}

Result represents the outcome of a command execution.

Jump to

Keyboard shortcuts

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