program

package
v0.0.0-...-372e3a9 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoProgramGiven = fmt.Errorf("no program given")

Functions

This section is empty.

Types

type Program

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

Program represents a program that can be Run.

func (Program) Args

func (p Program) Args() []string

func (Program) Bin

func (p Program) Bin() string

func (Program) Run

func (p Program) Run(ctx context.Context, stdout, stderr io.Writer) error

Run runs the program, sending its STDOUT and STDERR to the given writers, and kills it if the context is done before the program has finished.

func (Program) String

func (p Program) String() string

type Template

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

Template represents a program, as a list of strings with at least the program's path as the first argument, plus any arguments. The program's path and arguments can be text templates.

func NewTemplate

func NewTemplate(args []string, logger log.Logger) (*Template, error)

func (*Template) Execute

func (t *Template) Execute(vars map[string]interface{}) (Program, error)

Execute executes each of the template args with the given vars, and return a Program.

func (*Template) String

func (t *Template) String() string

Source Files

  • program.go

Jump to

Keyboard shortcuts

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