Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombinedOut ¶
Execute CombinedOut on all library command types/interfaces.
Types ¶
type BaseCmd ¶
type BaseCmd interface {
GetExec() *exec.Cmd
SetInput(string)
SetInputf(string, ...any)
Std(bool, bool, bool)
Stdout(bool)
Stdin(bool)
Stderr(bool)
Run() error
Out() (string, error)
Start() error
CombinedOut() (string, error)
SetAndStartf(string, ...any) error
SetAndCombinedOutf(string, ...any) (string, error)
SetAndOutf(string, ...any) (string, error)
SetAndRunf(string, ...any) error
SetAndStart(string) error
SetAndCombinedOut(string) (string, error)
SetAndOut(string) (string, error)
SetAndRun(string) error
}
The universal base interface for the others, can be converted unidirectionally to all others.
func NewBaseCmd ¶
Creates a new BaseCmd interface, which is completely universal and cross-platform.
func NewBaseCmdf ¶
NewBaseCmd but with a fmt.Sprintf in it.
type UnixCmd ¶
type UnixCmd interface {
BaseCmd
RunWithShell(bool)
UseBashShell(bool)
CustomShell(string, string)
GetChroot() (string, bool)
SetChroot(string)
SetChrootf(string, ...any)
EnableChroot()
DisableChroot()
}
An exclusive interface for unix, which has the specific functions for that OS.
func NewUnixCmd ¶
Creates a UnixCmd interface that is convertible to: UnixCmd -> UnixSudoCmd.
func NewUnixCmdf ¶
NewUnixCmd but with a fmt.Sprintf in it.
type UnixSudoCmd ¶
Unix interface with extra functions to cover sudo execution.
func NewUnixSudoCmd ¶
func NewUnixSudoCmd(command string, optionalPassword ...string) UnixSudoCmd
Creates a UnixCmd interface but with specific functions for executing sudo commands.
func NewUnixSudoCmdf ¶
func NewUnixSudoCmdf(passwd, command string, args ...any) UnixSudoCmd
NewUnixSudoCmd but with a fmt.Sprintf in it.
type WindowsCmd ¶
type WindowsCmd interface {
BaseCmd
RunWithPS(bool)
RunWithoutCmd(bool)
HideCmdWindow(bool)
CustomPSFlags(string)
CustomPSFlagsf(string, ...any)
CustomCmdFlags(string)
CustomCmdFlagsf(string, ...any)
}
The exclusive command interface for windows, you can convert BaseCmd -> WindowsCmd with specific functions for that OS.