builder

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBackgroundCommand = fmt.Errorf("background command")
View Source
var ErrEmptyCommand = fmt.Errorf("no command")

Functions

This section is empty.

Types

type BuiltinCommand

type BuiltinCommand struct {
	Args []string
	F    BuiltinCommandFunc
	// contains filtered or unexported fields
}

func (*BuiltinCommand) AddFiles

func (c *BuiltinCommand) AddFiles(files ...*os.File)

func (*BuiltinCommand) Close

func (c *BuiltinCommand) Close() error

func (*BuiltinCommand) FileExt

func (c *BuiltinCommand) FileExt() string

func (*BuiltinCommand) Kill

func (c *BuiltinCommand) Kill()

func (*BuiltinCommand) SameAs

func (c *BuiltinCommand) SameAs(o Command) bool

func (*BuiltinCommand) SetStderr

func (c *BuiltinCommand) SetStderr(w io.Writer) bool

func (*BuiltinCommand) SetStdin

func (c *BuiltinCommand) SetStdin(r io.Reader) bool

func (*BuiltinCommand) SetStdout

func (c *BuiltinCommand) SetStdout(w io.Writer) bool

func (*BuiltinCommand) Start

func (c *BuiltinCommand) Start() error

func (*BuiltinCommand) Wait

func (c *BuiltinCommand) Wait() (int, error)

type BuiltinCommandFunc

type BuiltinCommandFunc func(io.Reader, io.Writer, io.Writer, ...string) int

type Command

type Command interface {
	SetStdout(io.Writer) bool
	SetStderr(io.Writer) bool
	SetStdin(io.Reader) bool
	AddFiles(...*os.File)
	Start() error
	Wait() (int, error)
	Close() error
	FileExt() string
	Kill()
	SameAs(Command) bool
}

type MacroCommand

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

func BuildCommandLine

func BuildCommandLine(commandLine string, builtins map[string]BuiltinCommandFunc) ([]*MacroCommand, error)

func (*MacroCommand) AddPiped

func (mc *MacroCommand) AddPiped(c Command) error

func (*MacroCommand) Anchor

func (mc *MacroCommand) Anchor() string

func (*MacroCommand) Close added in v0.2.3

func (mc *MacroCommand) Close()

func (*MacroCommand) FileExt

func (mc *MacroCommand) FileExt() string

func (*MacroCommand) Kill

func (mc *MacroCommand) Kill()

func (*MacroCommand) Run

func (mc *MacroCommand) Run() (int, error)

func (*MacroCommand) SameAs

func (mc *MacroCommand) SameAs(other *MacroCommand) bool

func (*MacroCommand) SetStderr

func (mc *MacroCommand) SetStderr(w *os.File) bool

func (*MacroCommand) Stdout

func (mc *MacroCommand) Stdout() (io.Reader, bool)

type OsCommand

type OsCommand struct {
	Command *exec.Cmd
	// contains filtered or unexported fields
}

func (*OsCommand) AddFiles

func (c *OsCommand) AddFiles(f ...*os.File)

func (*OsCommand) Close

func (c *OsCommand) Close() error

func (*OsCommand) FileExt

func (c *OsCommand) FileExt() string

func (*OsCommand) Kill

func (c *OsCommand) Kill()

func (*OsCommand) SameAs

func (c *OsCommand) SameAs(o Command) bool

func (*OsCommand) SetStderr

func (c *OsCommand) SetStderr(w io.Writer) bool

func (*OsCommand) SetStdin

func (c *OsCommand) SetStdin(r io.Reader) bool

func (*OsCommand) SetStdout

func (c *OsCommand) SetStdout(w io.Writer) bool

func (*OsCommand) Start

func (c *OsCommand) Start() error

func (*OsCommand) Wait

func (c *OsCommand) Wait() (int, error)

Jump to

Keyboard shortcuts

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