command

package
v0.14.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package command provides utilities for running external commands.

Package command provides utilities for running external commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(name string, cmdv []string, timeout time.Duration) error

Run runs the command specified in cmdTemplate which is rendered with the given params and logs stderr and stdout to a new log adapter.

func RunOutput added in v0.3.0

func RunOutput(name string, cmdv []string, timeout time.Duration) (string, string, error)

RunOutput works just like Run but returns stdout and stderr instead of logging it.

Types

type Generator

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

Generator represents a command generator.

func NewGenerator

func NewGenerator(args ...string) *Generator

NewGenerator creates a new generator initialized with the gives arguments.

func (*Generator) Append

func (g *Generator) Append(args ...string)

Append appends the given arguments to the end of the arguments.

func (*Generator) Appendv

func (g *Generator) Appendv(args []string)

Appendv appends the give string slice to the command

func (*Generator) Command

func (g *Generator) Command() []string

Command returns the currently built command.

func (*Generator) Prepend

func (g *Generator) Prepend(args ...string)

Prepend prepends the given arguments to the beginning of the arguments.

func (*Generator) Prependv

func (g *Generator) Prependv(args []string)

Prependv prepends the given string slice to the command.

Jump to

Keyboard shortcuts

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