engine

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLogger = Logger{
	StdoutWriter: os.Stdout,
	StderrWriter: os.Stderr,
	StdinReader:  os.Stdin,
}

DefaultLogger is the standard output for a logger

Functions

func MapEnvs

func MapEnvs(envs []string) map[string]string

MapEnvs map an array of string env

Types

type DefaultExecuter

type DefaultExecuter struct {
	Logger *Logger
}

DefaultExecuter Execute task with a POSIX emulator

func (DefaultExecuter) Execute

func (e DefaultExecuter) Execute(ctx context.Context, elk *ox.Elk, name string) (int, error)

Execute task and returns a PID

type Engine

type Engine struct {
	Elk      *ox.Elk
	Executer Executer
	Build    func() error
}

Engine is the data structure responsible of processing the content

func (*Engine) Run

func (e *Engine) Run(ctx context.Context, task string) error

Run task declared in ox.yml file

type Executer

type Executer interface {
	Execute(context.Context, *ox.Elk, string) (int, error)
}

Executer runs a task and returns a PID and an error

type Logger

type Logger struct {
	StderrWriter io.Writer
	StdoutWriter io.Writer
	StdinReader  io.Reader
}

Logger is used by the engine to store the output

Jump to

Keyboard shortcuts

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