shell

package
v0.2.77 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(cmd string, args ...string) (c *exec.Cmd, stdout *bytes.Buffer, stderr *bytes.Buffer)

func CommandCombinedOut

func CommandCombinedOut(cmd string, args ...string) (*exec.Cmd, *bytes.Buffer)

func CommandStart

func CommandStart(cmd string, args ...string) (*exec.Cmd, error)

func CreateFile

func CreateFile(shellScript string) (filename string, err error)

CreateFile creates an executable shell file

func Run

func Run(shellScript string, args ...string) (response string, err error)

Run a shell command wrapping into .sh or .bat file

func RunExec

func RunExec(cmd string, args ...string) ([]byte, error)

func RunExecBackground

func RunExecBackground(cmd string, args ...string) ([]byte, error)

RunExecBackground start command in background a

func RunFile

func RunFile(filename string, args ...string) (string, error)

func RunOutput

func RunOutput(cmd string, args ...string) (string, error)

Types

type ShellCmd

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

ShellCmd wrap a command

func NewShellCmd

func NewShellCmd(command string, args ...string) (instance *ShellCmd)

func RunBackground

func RunBackground(shellScript string, args ...string) (c *ShellCmd, err error)

func RunFileBackground

func RunFileBackground(filename string, args ...string) (c *ShellCmd, err error)

func StartExecBackground

func StartExecBackground(cmd string, args ...string) (c *ShellCmd, err error)

func (*ShellCmd) GetArgs

func (instance *ShellCmd) GetArgs() []string

func (*ShellCmd) GetCommand

func (instance *ShellCmd) GetCommand() string

func (*ShellCmd) IsBackground

func (instance *ShellCmd) IsBackground() bool

func (*ShellCmd) IsRunning

func (instance *ShellCmd) IsRunning() bool

func (*ShellCmd) Kill

func (instance *ShellCmd) Kill() error

func (*ShellCmd) OnErr

func (instance *ShellCmd) OnErr(callback func(event *gg_events.Event))

func (*ShellCmd) OnOut

func (instance *ShellCmd) OnOut(callback func(event *gg_events.Event))

func (*ShellCmd) OutWasInactiveFor

func (instance *ShellCmd) OutWasInactiveFor(d time.Duration) bool

func (*ShellCmd) Pid

func (instance *ShellCmd) Pid() int

Pid return current or last pid

func (*ShellCmd) Run

func (instance *ShellCmd) Run() (err error)

func (*ShellCmd) SetArgs

func (instance *ShellCmd) SetArgs(values ...string) *ShellCmd

func (*ShellCmd) SetBackground

func (instance *ShellCmd) SetBackground(value bool) *ShellCmd

func (*ShellCmd) SetCommand

func (instance *ShellCmd) SetCommand(value string) *ShellCmd

func (*ShellCmd) SetLogger

func (instance *ShellCmd) SetLogger(value gg_log.ILogger) *ShellCmd

func (*ShellCmd) StdErr

func (instance *ShellCmd) StdErr() string

func (*ShellCmd) StdOut

func (instance *ShellCmd) StdOut() string

func (*ShellCmd) Wait

func (instance *ShellCmd) Wait() (err error)

Jump to

Keyboard shortcuts

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