build: bldy.build/build/executor Index | Files

package executor

import "bldy.build/build/executor"

Index

Package Files

env.go executor.go

Variables

var ErrNotFound = errors.New("executable file not found in $PATH")

ErrNotFound is the error resulting if a path search failed to find an executable file.

type Action Uses

type Action interface {
    Do(*Executor) error
}

Action interface is used for deferred actions that get performed during the build stage, unlike rules actions are NOT meant to be executed in parralel.

type Executor Uses

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

Executor defines the envinroment in which a target will be built, it provide helper functions for shelling out without having to worry about stdout or stderr outputs.

func New Uses

func New(ctx context.Context, ns namespace.Namespace) *Executor

New initializes and returns a new executor.Executor

func (*Executor) CombinedLog Uses

func (e *Executor) CombinedLog() string

func (*Executor) Context Uses

func (e *Executor) Context() context.Context

Context returns the context that's attached to the Executor

func (*Executor) Create Uses

func (e *Executor) Create(name string) (*os.File, error)

Create creates and returns a new file with the given name in the namespace

func (*Executor) Exec Uses

func (e *Executor) Exec(cmd string, env, args []string) error

Exec executes a command writing it's outputs to the context

func (*Executor) Log Uses

func (e *Executor) Log() []fmt.Stringer

Log returns the logs

func (*Executor) Mkdir Uses

func (e *Executor) Mkdir(name string) error

Mkdir creates a folder in the executor

func (*Executor) Open Uses

func (e *Executor) Open(name string) (*os.File, error)

Open creates and returns a new file with the given name in the namespace

func (*Executor) OpenFile Uses

func (e *Executor) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

OpenFile creates and returns a new file with the given name, flags and mode in the namespace

func (*Executor) Printf Uses

func (e *Executor) Printf(format string, v ...interface{})

Printf wraps sprintf for log items

func (*Executor) Println Uses

func (e *Executor) Println(v ...interface{})

Println wraps sprintf for log items

func (*Executor) Run Uses

func (e *Executor) Run(ctx context.Context, cmd string, args ...string) namespace.Cmd

Run executes a command writing it's outputs to the namespace

func (*Executor) RunCmds Uses

func (e *Executor) RunCmds() []*Run

RunCmds commands returns the commands that ran

type Message Uses

type Message string

Message defines a log Item in the message

func (Message) String Uses

func (m Message) String() string

type Run Uses

type Run struct {
    At     time.Time
    Cmd    string
    Args   []string
    Output []byte
    Env    []string
    Err    error
}

Run defines the execution step

func (*Run) String Uses

func (r *Run) String() string

Package executor imports 12 packages (graph) and is imported by 5 packages. Updated 2018-10-01. Refresh now. Tools for package owners.