pipe

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PipedCmd

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

func NewPiped

func NewPiped(cmd string, args ...string) *PipedCmd

func Shell added in v0.0.6

func Shell(fullLine string) *PipedCmd

Shell tries to be like the *sh shell to create a piped command. It will, after splitting the string, run os.Expand on the parts. It works correctly for things like this

Shell("echo hi")
Shell("GOOS=linux go build")
Shell("docker run -it ubuntu")
Shell("docker run -v $HOME/.aws:/root/.aws:ro ubuntu")

It will not work like bash for things like this

Shell("echo '$HOME'")

Since it will first split echo into $HOME, and then escape the HOME

func ShellWithError added in v0.0.6

func ShellWithError(fullLine string) (*PipedCmd, error)

func (*PipedCmd) Execute

func (p *PipedCmd) Execute(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error

func (*PipedCmd) Pipe

func (p *PipedCmd) Pipe(cmd string, args ...string) *PipedCmd

func (*PipedCmd) PipeTo added in v0.0.19

func (p *PipedCmd) PipeTo(into *PipedCmd) *PipedCmd

func (*PipedCmd) Run

func (p *PipedCmd) Run(ctx context.Context) error

func (*PipedCmd) Shell added in v0.0.19

func (p *PipedCmd) Shell(fullLine string) *PipedCmd

func (*PipedCmd) WithDir added in v0.0.35

func (p *PipedCmd) WithDir(d string) *PipedCmd

func (*PipedCmd) WithEnv

func (p *PipedCmd) WithEnv(e []string) *PipedCmd

Jump to

Keyboard shortcuts

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