task

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OyaCmdOverride *string

OyaCmdOverride is used in tests, to override the path to the current oya executable. It is used to invoke other tasks from a task body. When tests are run, the current process executable path points to the test runner so it has to be overridden (with 'go run oya.go', roughly speaking).

Functions

func Sort

func Sort(taskNames []Name)

Types

type Builtin

type Builtin struct {
	OnExec func(stdout, stderr io.Writer) error
}

func (Builtin) Exec

func (h Builtin) Exec(workDir string, args []string, params template.Scope, stdout, stderr io.Writer) error

type ErrScriptFail added in v0.0.9

type ErrScriptFail struct {
	ExitCode int
	Message  string
}

func (ErrScriptFail) Error added in v0.0.9

func (e ErrScriptFail) Error() string

type Meta

type Meta struct {
	Doc string
}

type Name

type Name string

func (Name) Aliased added in v0.0.9

func (n Name) Aliased(alias types.Alias) Name

func (Name) IsBuiltIn

func (n Name) IsBuiltIn() bool

func (Name) Split

func (n Name) Split() (types.Alias, string)

type Script

type Script struct {
	Script string
	Shell  string
	Scope  *template.Scope
}

func (Script) Exec

func (s Script) Exec(workDir string, args []string, values template.Scope, stdout, stderr io.Writer) error

type Table

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

func NewTable

func NewTable() Table

func (Table) AddDoc

func (tt Table) AddDoc(taskName Name, s string)

func (Table) AddTask

func (tt Table) AddTask(name Name, task Task)

func (Table) ForEach

func (tt Table) ForEach(f func(taskName Name, task Task, meta Meta) error) error

func (Table) ForEachSorted

func (tt Table) ForEachSorted(f func(taskName Name, task Task, meta Meta) error) error

func (Table) ImportTasks

func (tt Table) ImportTasks(alias types.Alias, other Table)

func (Table) LookupTask

func (tt Table) LookupTask(name Name) (Task, bool)

type Task

type Task interface {
	Exec(workDir string, args []string, scope template.Scope, stdout, stderr io.Writer) error
}

type TaskNames

type TaskNames []Name

func (TaskNames) Len

func (names TaskNames) Len() int

func (TaskNames) Less

func (names TaskNames) Less(i, j int) bool

func (TaskNames) Swap

func (names TaskNames) Swap(i, j int)

Jump to

Keyboard shortcuts

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