exec

package
v2.0.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package exec provides a interface to run external commands as an abstraction layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(ex Executor, url string) error

Types

type ExecuteOptions

type ExecuteOptions struct {
	Cmd    string
	Args   []string
	Envs   []string
	Dir    string
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

ExecuteOptions specify parameters to the Execute method.

type Executor

type Executor interface {
	// Command executes the specified command.
	Command(opts ExecuteOptions) error
}

type FakeExec

type FakeExec struct {
	OutStderr  string
	OutStdout  string
	OutErr     error
	CalledOpts ExecuteOptions
}

func (*FakeExec) Command

func (e *FakeExec) Command(opts ExecuteOptions) error

type OsExec

type OsExec struct{}

func (*OsExec) Command

func (*OsExec) Command(opts ExecuteOptions) error

Jump to

Keyboard shortcuts

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