binexec

package
v0.0.0-...-f5cbd98 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: Unlicense Imports: 9 Imported by: 0

Documentation

Overview

Package binexec implements a wrapper for os/exec

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	OsCmd *exec.Cmd
	// Cache if set to true the binary won't be deleted after execution.
	// If the ModTime of the cached binclude file changes the cache gets invalidated automtically.
	Cache bool
}

Cmd same as Cmd in the os/exec package

func Command

func Command(fs *binclude.FileSystem, bincludePath string, arg ...string) (*Cmd, error)

Command similar to Command in the os/exec package, but copies the executeable to run from bincludePath to the host os.

func CommandContext

func CommandContext(ctx context.Context, fs *binclude.FileSystem, bincludePath string, arg ...string) (*Cmd, error)

CommandContext similar to CommandContext in the os/exec package but copies the executeable to run from bincludePath to the host os.

func (*Cmd) Run

func (c *Cmd) Run() error

Run is similar to (*Cmd).Run() in the os/exec package, but deletes the executable at Cmd.Path if c.Cache is false

func (*Cmd) Start

func (c *Cmd) Start() error

Start same as (*Cmd).Start() in the os/exec package

func (*Cmd) StderrPipe

func (c *Cmd) StderrPipe() (io.ReadCloser, error)

StderrPipe same as (*Cmd).StderrPipe() in the os/exec package

func (*Cmd) StdinPipe

func (c *Cmd) StdinPipe() (io.WriteCloser, error)

StdinPipe same as (*Cmd).StdinPipe() in the os/exec package

func (*Cmd) StdoutPipe

func (c *Cmd) StdoutPipe() (io.ReadCloser, error)

StdoutPipe same as (*Cmd).StdoutPipe() in the os/exec package

func (*Cmd) String

func (c *Cmd) String() string

String same as (*Cmd).String() in the os/exec package

func (*Cmd) Wait

func (c *Cmd) Wait() error

Wait is similar to (*Cmd).Wait() in the os/exec package, but deletes the executable at Cmd.Path if c.Cache is false

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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