Documentation
¶
Index ¶
- Constants
- func ArgsJoin(args ...string) string
- func ArgsJoinAppend(argAppend string, args ...string) string
- func ArgsJoinPrepend(argPrepend string, args ...string) string
- func ArgsJoinSlice(args []string) string
- func ArgsJoinSlicePtr(args *[]string) string
- func ArgsJoinWithSingle(arg1 string, args ...string) string
- func BashArgsErrorWrapper(args ...string) *errorwrapper.Wrapper
- func BashOutput(scriptLines ...string) string
- func BashScriptsErrorWrapper(scriptLines ...string) *errorwrapper.Wrapper
- func ChainCmdSuccess(scriptType scripttype.Variant, scriptLines ...string) (errorWrapper *errorwrapper.Wrapper, isAllSuccess bool)
- func ChangeDirScriptLine(changeDirPath string) string
- func DisposeBuffer(buff *bytes.Buffer)
- func DisposeBytesPtr(allBytes *[]byte)
- func DisposeStringsPtr(allBytes *[]string)
- func GetExitCode(errorWrapper *errorwrapper.Wrapper, exitError *exec.ExitError) int
- func GetScriptOfChangeDirPlusScripts(changeDirPath string, scriptsLines ...string) string
- func IsBashArgsSuccess(args ...string) bool
- func IsBashScriptsSuccess(scriptLines ...string) bool
- func IsShellArgsSuccess(args ...string) bool
- func IsShellScriptsSuccess(scriptLines ...string) bool
- func IsSuccess(scriptType scripttype.Variant, scriptLines ...string) bool
- func IsSuccessBashArgs(args ...string) bool
- func ShellArgsErrorWrapper(args ...string) *errorwrapper.Wrapper
- func ShellOutput(scriptLines ...string) string
- func ShellScriptsErrorWrapper(scriptLines ...string) *errorwrapper.Wrapper
- type BaseBufferStdOutError
- func (it *BaseBufferStdOutError) CombinedBothErrorOutputLines() []string
- func (it *BaseBufferStdOutError) CompiledErrorLines() []string
- func (it *BaseBufferStdOutError) CompiledOutputLines() []string
- func (it *BaseBufferStdOutError) CompiledTrimmedErrorLines() []string
- func (it *BaseBufferStdOutError) CompiledTrimmedErrorOutput() string
- func (it *BaseBufferStdOutError) CompiledTrimmedOutput() string
- func (it *BaseBufferStdOutError) CompiledTrimmedOutputLines() []string
- func (it *BaseBufferStdOutError) Dispose()
- func (it *BaseBufferStdOutError) ErrorBytes() []byte
- func (it *BaseBufferStdOutError) ErrorString() string
- func (it *BaseBufferStdOutError) HasErrorBuffer() bool
- func (it *BaseBufferStdOutError) HasOutputBuffer() bool
- func (it *BaseBufferStdOutError) OutputBytes() []byte
- func (it *BaseBufferStdOutError) OutputString() string
- type BaseCmdWrapper
- type CmdCompiledOutput
- type CmdOnce
- func BashArgs(args ...string) *CmdOnce
- func BashChangeDirPlusRunArgs(changeDirPath string, args ...string) *CmdOnce
- func BashChangeDirPlusRunScripts(changeDirPath string, scriptLines ...string) *CmdOnce
- func BashScripts(scriptLines ...string) *CmdOnce
- func BashScriptsSingleLine(changeDirPath string, scriptLines ...string) *CmdOnce
- func ChangeDirPlusRunScriptsCmdOnce(scriptType scripttype.Variant, changeDirPath string, scriptLines ...string) *CmdOnce
- func Conditional(isTrue bool, trueCmdOne, falseCmdOnce *CmdOnce) *CmdOnce
- func NewCmdOnce(hasOutput, hasSecureData bool, process string, arguments ...string) *CmdOnce
- func NewCmdOnceDefault(process string, arguments ...string) *CmdOnce
- func NewCmdOnceNoOutput(process string, arguments ...string) *CmdOnce
- func NewCmdOnceOutput(process string, arguments ...string) *CmdOnce
- func NewCmdOnceUsingCmd(hasOutput, hasSecureData bool, cmd *exec.Cmd) *CmdOnce
- func NewCmdOnceUsingEmpty() *CmdOnce
- func NewCmdOnceUsingScriptType(hasOutput, hasSecureData bool, scriptType scripttype.Variant, ...) *CmdOnce
- func ScriptArgumentsDefault(scriptType scripttype.Variant, args ...string) *CmdOnce
- func ScriptCmdOnceUsingArguments(hasOutput, hasSecureData bool, scriptType scripttype.Variant, args ...string) *CmdOnce
- func ScriptsDefault(scriptType scripttype.Variant, scriptLines ...string) *CmdOnce
- func ShellArgs(args ...string) *CmdOnce
- func ShellScripts(scriptLines ...string) *CmdOnce
- func (it *CmdOnce) AddEnvVar(varName, varValue string) *CmdOnce
- func (it *CmdOnce) AddEnvVarKeyVal(keyVal corestr.KeyValuePair) *CmdOnce
- func (it *CmdOnce) AddEnvVarsHashmap(hashmap *corestr.Hashmap) *CmdOnce
- func (it *CmdOnce) AddEnvVarsSlice(slice ...string) *CmdOnce
- func (it *CmdOnce) Arguments() []string
- func (it *CmdOnce) ArgumentsSingleLine() string
- func (it *CmdOnce) Clone() *CmdOnce
- func (it *CmdOnce) CloneCmd(isUseStd bool) *exec.Cmd
- func (it *CmdOnce) CmdCloneCompiledOutputBytes() (cmd *exec.Cmd, allBytes []byte, err error)
- func (it *CmdOnce) CmdCloneCompiledOutputString() (fullOutput corestr.SimpleStringOnce, err error)
- func (it *CmdOnce) CmdCloneCompiledOutputStringLines() (fullOutputLines []string, err error)
- func (it *CmdOnce) CmdCloneCompiledOutputTrimStringLines() (fullOutputLines []string, err error)
- func (it *CmdOnce) CmdCloneUsingStds(outBuff, errBuff *bytes.Buffer) *exec.Cmd
- func (it *CmdOnce) CmdCloneWithoutStd() *exec.Cmd
- func (it *CmdOnce) CommandLine() string
- func (it *CmdOnce) CompiledError() string
- func (it *CmdOnce) CompiledErrorBytes() []byte
- func (it *CmdOnce) CompiledErrorLines() []string
- func (it *CmdOnce) CompiledErrorWrapper() *errorwrapper.Wrapper
- func (it *CmdOnce) CompiledOutput() string
- func (it *CmdOnce) CompiledOutputBytes() []byte
- func (it *CmdOnce) CompiledOutputLines() []string
- func (it *CmdOnce) CompiledResult() *Result
- func (it *CmdOnce) CompiledTrimmedErrorLines() []string
- func (it *CmdOnce) CompiledTrimmedOutputLines() []string
- func (it *CmdOnce) Dispose()
- func (it *CmdOnce) DoubleQuoteWholeCommandLine() string
- func (it *CmdOnce) GetCommandLineDataDependingOnSecurity() string
- func (it *CmdOnce) GetFormattedKeyValueData(varName string, varValue string) string
- func (it *CmdOnce) HasAnyIssues() bool
- func (it *CmdOnce) HasCmd() bool
- func (it *CmdOnce) HasCompiledError() bool
- func (it *CmdOnce) HasIssues() bool
- func (it *CmdOnce) IsAlreadyRan() bool
- func (it *CmdOnce) IsNull() bool
- func (it *CmdOnce) IsSuccessfullyExecuted() bool
- func (it *CmdOnce) NewArgs(additionalArgs ...string) *CmdOnce
- func (it *CmdOnce) ProcessName() string
- func (it *CmdOnce) Run() *Result
- func (it *CmdOnce) RunOnce() *Result
- func (it *CmdOnce) RunOnceWithSuccessFlag() (cmdResult *Result, isSuccess bool)
- func (it *CmdOnce) String() string
- func (it *CmdOnce) WholeCommandLine() string
- type CmdOnceCollection
- func BashScriptsLinesCmdOneCollection(isTrimEmptyLines bool, scriptLines ...string) *CmdOnceCollection
- func NewCmdOnceCollection(capacity int) *CmdOnceCollection
- func NewCmdOnceCollection2() *CmdOnceCollection
- func NewCmdOnceCollectionUsingLines(scriptType scripttype.Variant, isTrimEmptyLines bool, scriptLines ...string) *CmdOnceCollection
- func NewCmdOnceCollectionUsingLinesDirect(scriptType scripttype.Variant, isTrimEmptyLines bool, scriptLines ...string) *CmdOnceCollection
- func NewCmdOnceCollectionUsingLinesOfScripts(scriptType scripttype.Variant, scriptLines ...string) *CmdOnceCollection
- func NewCmdOnceCollectionUsingLinesPtr(scriptType scripttype.Variant, isTrimEmptyLines bool, scriptLines *[]string) *CmdOnceCollection
- func (it *CmdOnceCollection) Add(cmdOnce *CmdOnce) *CmdOnceCollection
- func (it *CmdOnceCollection) AddBashArgs(args ...string) *CmdOnceCollection
- func (it *CmdOnceCollection) AddBashChangeDirArgs(changeDir string, args ...string) *CmdOnceCollection
- func (it *CmdOnceCollection) AddBashChangeDirScripts(changeDir string, scripts ...string) *CmdOnceCollection
- func (it *CmdOnceCollection) AddBashEachScriptAsEachCmdOnce(scriptLines ...string) *CmdOnceCollection
- func (it *CmdOnceCollection) AddDefaultScript(scriptType scripttype.Variant, scriptsLines ...string) *CmdOnceCollection
- func (it *CmdOnceCollection) AddDefaultScriptArgs(scriptType scripttype.Variant, args ...string) *CmdOnceCollection
- func (it *CmdOnceCollection) AddEachScriptAsEachCmdOnce(scriptType scripttype.Variant, scriptLines ...string) *CmdOnceCollection
- func (it *CmdOnceCollection) AddEachScriptAsEachCmdOncePtr(scriptType scripttype.Variant, scriptLines *[]string) *CmdOnceCollection
- func (it *CmdOnceCollection) AddMany(cmdOnceItems ...*CmdOnce) *CmdOnceCollection
- func (it *CmdOnceCollection) AsBasicSliceContractsBinder() coreinterface.BasicSlicerContractsBinder
- func (it *CmdOnceCollection) AsBasicSlicerContractsBinder() coreinterface.BasicSlicerContractsBinder
- func (it *CmdOnceCollection) Clear() *CmdOnceCollection
- func (it *CmdOnceCollection) Clone() *CmdOnceCollection
- func (it *CmdOnceCollection) CommandsStrings() []string
- func (it *CmdOnceCollection) CompiledOneErrorWrapper() *errorwrapper.Wrapper
- func (it *CmdOnceCollection) Count() int
- func (it *CmdOnceCollection) Dispose()
- func (it *CmdOnceCollection) ErrorWrappers() []*errorwrapper.Wrapper
- func (it *CmdOnceCollection) ExecuteAll() *errorwrapper.Wrapper
- func (it *CmdOnceCollection) ExecuteAllWithoutLazy() *errorwrapper.Wrapper
- func (it *CmdOnceCollection) ExecuteAllWithoutLazyResults() []*Result
- func (it *CmdOnceCollection) ExecuteUntilErr() *errorwrapper.Wrapper
- func (it *CmdOnceCollection) FailedOutputStringsOnly() []string
- func (it *CmdOnceCollection) HasAnyIssuesRunning() bool
- func (it *CmdOnceCollection) HasAnyItem() bool
- func (it *CmdOnceCollection) HasIndex(index int) bool
- func (it *CmdOnceCollection) IsAllSuccess() bool
- func (it *CmdOnceCollection) IsEmpty() bool
- func (it *CmdOnceCollection) Items() []*CmdOnce
- func (it *CmdOnceCollection) LastIndex() int
- func (it *CmdOnceCollection) Length() int
- func (it *CmdOnceCollection) OutputsStrings() []string
- func (it *CmdOnceCollection) Results() []*Result
- func (it *CmdOnceCollection) String() string
- func (it *CmdOnceCollection) Strings() []string
- func (it *CmdOnceCollection) StringsProcessor(processor func(cmdOnce *CmdOnce) (processedLine string, isTake, isBreak bool)) []string
- func (it *CmdOnceCollection) SuccessStringsOnly() []string
- type CustomMessage
- type Result
- func BashArgsResult(args ...string) *Result
- func NewResult(errorWrapper *errorwrapper.Wrapper, stdOut, stdErr *bytes.Buffer, ...) *Result
- func NewResultUsingBaseBuffer(errorWrapper *errorwrapper.Wrapper, baseBuffer *BaseBufferStdOutError, ...) *Result
- func ShellArgsResult(args ...string) *Result
- func ShellScriptsResult(scriptLines ...string) *Result
- func (it *Result) DetailedOutput() string
- func (it *Result) Dispose()
- func (it *Result) ErrorWrapper() *errorwrapper.Wrapper
- func (it *Result) HasCommandExecuted() bool
- func (it *Result) HasError() bool
- func (it *Result) HasExitError() bool
- func (it *Result) HasValidExitCode() bool
- func (it *Result) IsEmptyError() bool
- func (it *Result) IsExitCode(exitCode int) bool
- func (it *Result) IsExitCodeByte(exitCode byte) bool
- func (it *Result) IsInvalidExitCode() bool
- func (it *Result) IsRunSuccessfully() bool
- func (it *Result) String() string
- type StdIn
Constants ¶
const ( InvalidExitCode = consts.InvalidExitCode SuccessfullyRunningExitCode = consts.CmdSuccessfullyRunningExitCode ScriptsMultiLineJoiner = " && \\ \n" // " && \\ \n" SingleLineScriptsJoiner = " && " // " && " )
Variables ¶
This section is empty.
Functions ¶
func ArgsJoinAppend ¶ added in v0.7.1
func ArgsJoinPrepend ¶ added in v0.7.1
func ArgsJoinSlice ¶ added in v0.5.1
func ArgsJoinSlicePtr ¶ added in v0.5.1
func ArgsJoinWithSingle ¶ added in v0.6.5
func BashArgsErrorWrapper ¶ added in v0.5.1
func BashArgsErrorWrapper( args ...string, ) *errorwrapper.Wrapper
func BashOutput ¶ added in v0.5.0
func BashScriptsErrorWrapper ¶ added in v0.5.2
func BashScriptsErrorWrapper( scriptLines ...string, ) *errorwrapper.Wrapper
func ChainCmdSuccess ¶ added in v0.5.0
func ChainCmdSuccess( scriptType scripttype.Variant, scriptLines ...string, ) (errorWrapper *errorwrapper.Wrapper, isAllSuccess bool)
ChainCmdSuccess if any script is failed to run then don't continue others
Returns true if scriptLines length 0
func ChangeDirScriptLine ¶ added in v0.5.2
ChangeDirScriptLine cd path
func DisposeBuffer ¶ added in v0.7.9
func DisposeBytesPtr ¶ added in v0.7.9
func DisposeBytesPtr(allBytes *[]byte)
func DisposeStringsPtr ¶ added in v0.7.9
func DisposeStringsPtr(allBytes *[]string)
func GetExitCode ¶ added in v0.7.3
func GetExitCode( errorWrapper *errorwrapper.Wrapper, exitError *exec.ExitError, ) int
func GetScriptOfChangeDirPlusScripts ¶ added in v0.5.2
GetScriptOfChangeDirPlusScripts cd path && \ \n scripts...
func IsBashArgsSuccess ¶ added in v0.5.1
func IsBashScriptsSuccess ¶ added in v0.5.1
func IsShellArgsSuccess ¶ added in v0.5.1
func IsShellScriptsSuccess ¶ added in v0.5.1
func IsSuccess ¶ added in v0.5.0
func IsSuccess( scriptType scripttype.Variant, scriptLines ...string, ) bool
func IsSuccessBashArgs ¶ added in v0.5.2
func ShellArgsErrorWrapper ¶ added in v0.5.1
func ShellArgsErrorWrapper( args ...string, ) *errorwrapper.Wrapper
func ShellOutput ¶ added in v0.5.0
func ShellScriptsErrorWrapper ¶ added in v0.5.1
func ShellScriptsErrorWrapper( scriptLines ...string, ) *errorwrapper.Wrapper
Types ¶
type BaseBufferStdOutError ¶
type BaseBufferStdOutError struct {
// contains filtered or unexported fields
}
func (*BaseBufferStdOutError) CombinedBothErrorOutputLines ¶ added in v0.7.9
func (it *BaseBufferStdOutError) CombinedBothErrorOutputLines() []string
func (*BaseBufferStdOutError) CompiledErrorLines ¶
func (it *BaseBufferStdOutError) CompiledErrorLines() []string
func (*BaseBufferStdOutError) CompiledOutputLines ¶
func (it *BaseBufferStdOutError) CompiledOutputLines() []string
func (*BaseBufferStdOutError) CompiledTrimmedErrorLines ¶
func (it *BaseBufferStdOutError) CompiledTrimmedErrorLines() []string
func (*BaseBufferStdOutError) CompiledTrimmedErrorOutput ¶
func (it *BaseBufferStdOutError) CompiledTrimmedErrorOutput() string
func (*BaseBufferStdOutError) CompiledTrimmedOutput ¶
func (it *BaseBufferStdOutError) CompiledTrimmedOutput() string
func (*BaseBufferStdOutError) CompiledTrimmedOutputLines ¶
func (it *BaseBufferStdOutError) CompiledTrimmedOutputLines() []string
func (*BaseBufferStdOutError) Dispose ¶ added in v0.7.9
func (it *BaseBufferStdOutError) Dispose()
func (*BaseBufferStdOutError) ErrorBytes ¶
func (it *BaseBufferStdOutError) ErrorBytes() []byte
func (*BaseBufferStdOutError) ErrorString ¶
func (it *BaseBufferStdOutError) ErrorString() string
func (*BaseBufferStdOutError) HasErrorBuffer ¶
func (it *BaseBufferStdOutError) HasErrorBuffer() bool
func (*BaseBufferStdOutError) HasOutputBuffer ¶
func (it *BaseBufferStdOutError) HasOutputBuffer() bool
func (*BaseBufferStdOutError) OutputBytes ¶
func (it *BaseBufferStdOutError) OutputBytes() []byte
func (*BaseBufferStdOutError) OutputString ¶
func (it *BaseBufferStdOutError) OutputString() string
type BaseCmdWrapper ¶
type BaseCmdWrapper struct {
// contains filtered or unexported fields
}
func (*BaseCmdWrapper) Dispose ¶ added in v0.7.9
func (it *BaseCmdWrapper) Dispose()
type CmdCompiledOutput ¶ added in v0.8.0
type CmdCompiledOutput struct { Cmd *exec.Cmd Output corestr.SimpleStringOnce Error error ProcessName string Arguments []string }
func CombinedOutputError ¶ added in v0.8.0
func CombinedOutputError( stdIn *StdIn, processName string, args ...string, ) *CmdCompiledOutput
CombinedOutputError
stdIn can be nil
func InvalidCmdCompiledOutput ¶ added in v0.8.0
func InvalidCmdCompiledOutput( err error, process string, args []string, ) *CmdCompiledOutput
func (CmdCompiledOutput) Clone ¶ added in v0.8.0
func (it CmdCompiledOutput) Clone() CmdCompiledOutput
func (*CmdCompiledOutput) CloneCmd ¶ added in v0.8.0
func (it *CmdCompiledOutput) CloneCmd() *exec.Cmd
func (*CmdCompiledOutput) ClonePtr ¶ added in v0.8.0
func (it *CmdCompiledOutput) ClonePtr() *CmdCompiledOutput
func (*CmdCompiledOutput) Dispose ¶ added in v0.8.0
func (it *CmdCompiledOutput) Dispose()
type CmdOnce ¶
type CmdOnce struct { Cmd *exec.Cmd CustomMessage *CustomMessage // contains filtered or unexported fields }
func BashChangeDirPlusRunArgs ¶ added in v0.5.2
func BashChangeDirPlusRunScripts ¶ added in v0.5.2
func BashScripts ¶ added in v0.5.1
func BashScriptsSingleLine ¶ added in v0.5.2
func ChangeDirPlusRunScriptsCmdOnce ¶ added in v0.5.2
func ChangeDirPlusRunScriptsCmdOnce( scriptType scripttype.Variant, changeDirPath string, scriptLines ...string, ) *CmdOnce
func Conditional ¶ added in v0.6.5
func NewCmdOnce ¶
func NewCmdOnceDefault ¶
func NewCmdOnceNoOutput ¶
func NewCmdOnceOutput ¶
func NewCmdOnceUsingCmd ¶
func NewCmdOnceUsingEmpty ¶ added in v0.5.0
func NewCmdOnceUsingEmpty() *CmdOnce
func NewCmdOnceUsingScriptType ¶
func NewCmdOnceUsingScriptType( hasOutput, hasSecureData bool, scriptType scripttype.Variant, scriptLines ...string, ) *CmdOnce
func ScriptArgumentsDefault ¶ added in v0.5.1
func ScriptArgumentsDefault( scriptType scripttype.Variant, args ...string, ) *CmdOnce
func ScriptCmdOnceUsingArguments ¶ added in v0.5.1
func ScriptCmdOnceUsingArguments( hasOutput, hasSecureData bool, scriptType scripttype.Variant, args ...string, ) *CmdOnce
func ScriptsDefault ¶ added in v0.5.2
func ScriptsDefault( scriptType scripttype.Variant, scriptLines ...string, ) *CmdOnce
func ShellScripts ¶ added in v0.5.1
func (*CmdOnce) AddEnvVar ¶
AddEnvVar cannot add slice if already executed. Warning : panic if called after execution.
func (*CmdOnce) AddEnvVarKeyVal ¶
func (it *CmdOnce) AddEnvVarKeyVal(keyVal corestr.KeyValuePair) *CmdOnce
AddEnvVarKeyVal cannot add slice if already executed. Warning : panic if called after execution.
func (*CmdOnce) AddEnvVarsHashmap ¶
AddEnvVarsHashmap cannot add slice if already executed. Warning : panic if called after execution.
func (*CmdOnce) AddEnvVarsSlice ¶
AddEnvVarsSlice cannot add slice if already executed. Warning : panic if called after execution. Data needs to be in this format "MY_VAR=some_value"
func (*CmdOnce) ArgumentsSingleLine ¶
ArgumentsSingleLine Arguments Compiled using Space
func (*CmdOnce) Clone ¶
Clone calls constructor NewCmdOnce to create itself using the existing data.
func (*CmdOnce) CloneCmd ¶
CloneCmd Clones and creates a new cmd
If isUseStd true then it will clone it self and returns the cmd and buffer will be created and injected,
or else it will heavily depends on CompiledOutput or CombinedOutput
func (*CmdOnce) CmdCloneCompiledOutputBytes ¶ added in v0.7.9
func (*CmdOnce) CmdCloneCompiledOutputString ¶ added in v0.7.9
func (it *CmdOnce) CmdCloneCompiledOutputString() (fullOutput corestr.SimpleStringOnce, err error)
func (*CmdOnce) CmdCloneCompiledOutputStringLines ¶ added in v0.7.9
func (*CmdOnce) CmdCloneCompiledOutputTrimStringLines ¶ added in v0.7.9
func (*CmdOnce) CmdCloneUsingStds ¶ added in v0.7.9
func (*CmdOnce) CmdCloneWithoutStd ¶ added in v0.7.9
func (*CmdOnce) CommandLine ¶
CommandLine Gets commandline based on security. if receiver.hasSecureData then only returns process name
func (*CmdOnce) CompiledError ¶
CompiledError returns lazy once result.
Developer may check:
- IsSuccessfullyExecuted() reveals if any issue after compile, thus runs the compile or RunOnce() first then returns bool. Or,
- HasAnyIssues() reveals if any issue after compile, thus runs the compile or RunOnce() first then returns bool. Or,
- isAlreadyRan() reveals already executed or not. Doesn't run the process. Or,
- HasCmd() reveals if cmd is nil or not. Or,
- HasIssues() reveals any issues before running cmd. Or,
- CompiledErrorWrapper() to check the final error condition.
func (*CmdOnce) CompiledErrorBytes ¶
CompiledErrorBytes returns lazy once result.
Developer may check:
- IsSuccessfullyExecuted() reveals if any issue after compile, thus runs the compile or RunOnce() first then returns bool. Or,
- HasAnyIssues() reveals if any issue after compile, thus runs the compile or RunOnce() first then returns bool. Or,
- isAlreadyRan() reveals already executed or not. Doesn't run the process. Or,
- HasCmd() reveals if cmd is nil or not. Or,
- HasIssues() reveals any issues before running cmd. Or,
- CompiledErrorWrapper() to check the final error condition.
func (*CmdOnce) CompiledErrorLines ¶
CompiledErrorLines returns lazy once result.
Developer may check:
- IsSuccessfullyExecuted() reveals if any issue after compile, thus runs the compile or RunOnce() first then returns bool. Or,
- HasAnyIssues() reveals if any issue after compile, thus runs the compile or RunOnce() first then returns bool. Or,
- isAlreadyRan() reveals already executed or not. Doesn't run the process. Or,
- HasCmd() reveals if cmd is nil or not. Or,
- HasIssues() reveals any issues before running cmd. Or,
- CompiledErrorWrapper() to check the final error condition.
func (*CmdOnce) CompiledErrorWrapper ¶
func (it *CmdOnce) CompiledErrorWrapper() *errorwrapper.Wrapper
CompiledErrorWrapper Runs cmdone RunOnce then returns the final compiled error
func (*CmdOnce) CompiledOutput ¶
CompiledOutput returns lazy once result.
Developer may check:
- IsSuccessfullyExecuted() reveals if any issue after compile, thus runs the compile or RunOnce() first then returns bool. Or,
- HasAnyIssues() reveals if any issue after compile, thus runs the compile or RunOnce() first then returns bool. Or,
- isAlreadyRan() reveals already executed or not. Doesn't run the process. Or,
- HasCmd() reveals if cmd is nil or not. Or,
- HasIssues() reveals any issues before running cmd. Or,
- CompiledErrorWrapper() to check the final error condition.
func (*CmdOnce) CompiledOutputBytes ¶
CompiledOutputBytes returns lazy once result.
Developer may check:
- IsSuccessfullyExecuted() reveals if any issue after compile, thus runs the compile or RunOnce() first then returns bool. Or,
- HasAnyIssues() reveals if any issue after compile, thus runs the compile or RunOnce() first then returns bool. Or,
- isAlreadyRan() reveals already executed or not. Doesn't run the process. Or,
- HasCmd() reveals if cmd is nil or not. Or,
- HasIssues() reveals any issues before running cmd. Or,
- CompiledErrorWrapper() to check the final error condition.
func (*CmdOnce) CompiledOutputLines ¶
CompiledOutputLines returns lazy once result.
Developer may check:
- IsSuccessfullyExecuted() reveals if any issue after compile, thus runs the compile or RunOnce() first then returns bool. Or,
- HasAnyIssues() reveals if any issue after compile, thus runs the compile or RunOnce() first then returns bool. Or,
- isAlreadyRan() reveals already executed or not. Doesn't run the process. Or,
- HasCmd() reveals if cmd is nil or not. Or,
- HasIssues() reveals any issues before running cmd. Or,
- CompiledErrorWrapper() to check the final error condition.
func (*CmdOnce) CompiledResult ¶
CompiledResult RunOnce and submits the compiled result structure.
func (*CmdOnce) CompiledTrimmedErrorLines ¶
CompiledTrimmedErrorLines returns lazy once result.
Developer may check:
- IsSuccessfullyExecuted() reveals if any issue after compile, thus runs the compile or RunOnce() first then returns bool. Or,
- HasAnyIssues() reveals if any issue after compile, thus runs the compile or RunOnce() first then returns bool. Or,
- isAlreadyRan() reveals already executed or not. Doesn't run the process. Or,
- HasCmd() reveals if cmd is nil or not. Or,
- HasIssues() reveals any issues before running cmd. Or,
- CompiledErrorWrapper() to check the final error condition.
func (*CmdOnce) CompiledTrimmedOutputLines ¶
CompiledTrimmedOutputLines returns lazy once result.
Developer may check:
- IsSuccessfullyExecuted() reveals if any issue after compile, thus runs the compile or RunOnce() first then returns bool. Or,
- HasAnyIssues() reveals if any issue after compile, thus runs the compile or RunOnce() first then returns bool. Or,
- isAlreadyRan() reveals already executed or not. Doesn't run the process. Or,
- HasCmd() reveals if cmd is nil or not. Or,
- HasIssues() reveals any issues before running cmd. Or,
- CompiledErrorWrapper() to check the final error condition.
func (*CmdOnce) DoubleQuoteWholeCommandLine ¶
DoubleQuoteWholeCommandLine Process + Space + ArgumentsCompiledWithSpace
func (*CmdOnce) GetCommandLineDataDependingOnSecurity ¶ added in v0.5.8
func (*CmdOnce) GetFormattedKeyValueData ¶
GetFormattedKeyValueData "MY_VAR=some_value"
func (*CmdOnce) HasAnyIssues ¶
HasAnyIssues executes run command and Gets the compile result and check if any compilation error Any issues include compile or cmd running error.
func (*CmdOnce) HasCompiledError ¶
func (*CmdOnce) HasIssues ¶
HasIssues reveals either cmd is nil or has any other cmd initialize error but it doesn't conclude running issues.
func (*CmdOnce) IsAlreadyRan ¶
func (*CmdOnce) IsSuccessfullyExecuted ¶
IsSuccessfullyExecuted Runs the execution and then returns the success result.
Reveals if any issue after compile, thus runs the compile or RunOnce() first then returns bool.
func (*CmdOnce) ProcessName ¶
func (*CmdOnce) Run ¶
Run non lazy and runs as many times called.
Warning: Costly operation, run it wisely.
Under the hood, it creates the same cmdOnce and call it's RunOnce.
func (*CmdOnce) RunOnce ¶
RunOnce only runs once the process and returns the cached data many times.
func (*CmdOnce) RunOnceWithSuccessFlag ¶
RunOnceWithSuccessFlag Runs the process then returns the isSuccess flag
func (*CmdOnce) String ¶
String()
If cmd is present and HasIssues false then it will call RunOnce and get the output and returns it.
func (*CmdOnce) WholeCommandLine ¶
WholeCommandLine Process + Space + ArgumentsCompiledWithSpace
type CmdOnceCollection ¶ added in v0.5.8
type CmdOnceCollection struct {
// contains filtered or unexported fields
}
func BashScriptsLinesCmdOneCollection ¶ added in v0.5.9
func BashScriptsLinesCmdOneCollection( isTrimEmptyLines bool, scriptLines ...string, ) *CmdOnceCollection
func NewCmdOnceCollection ¶ added in v0.5.8
func NewCmdOnceCollection(capacity int) *CmdOnceCollection
func NewCmdOnceCollection2 ¶ added in v0.5.9
func NewCmdOnceCollection2() *CmdOnceCollection
func NewCmdOnceCollectionUsingLines ¶ added in v0.5.9
func NewCmdOnceCollectionUsingLines( scriptType scripttype.Variant, isTrimEmptyLines bool, scriptLines ...string, ) *CmdOnceCollection
func NewCmdOnceCollectionUsingLinesDirect ¶ added in v0.5.9
func NewCmdOnceCollectionUsingLinesDirect( scriptType scripttype.Variant, isTrimEmptyLines bool, scriptLines ...string, ) *CmdOnceCollection
func NewCmdOnceCollectionUsingLinesOfScripts ¶ added in v0.6.5
func NewCmdOnceCollectionUsingLinesOfScripts( scriptType scripttype.Variant, scriptLines ...string, ) *CmdOnceCollection
func NewCmdOnceCollectionUsingLinesPtr ¶ added in v0.5.9
func NewCmdOnceCollectionUsingLinesPtr( scriptType scripttype.Variant, isTrimEmptyLines bool, scriptLines *[]string, ) *CmdOnceCollection
func (*CmdOnceCollection) Add ¶ added in v0.5.8
func (it *CmdOnceCollection) Add( cmdOnce *CmdOnce, ) *CmdOnceCollection
func (*CmdOnceCollection) AddBashArgs ¶ added in v0.5.8
func (it *CmdOnceCollection) AddBashArgs( args ...string, ) *CmdOnceCollection
func (*CmdOnceCollection) AddBashChangeDirArgs ¶ added in v0.5.8
func (it *CmdOnceCollection) AddBashChangeDirArgs( changeDir string, args ...string, ) *CmdOnceCollection
func (*CmdOnceCollection) AddBashChangeDirScripts ¶ added in v0.5.8
func (it *CmdOnceCollection) AddBashChangeDirScripts( changeDir string, scripts ...string, ) *CmdOnceCollection
func (*CmdOnceCollection) AddBashEachScriptAsEachCmdOnce ¶ added in v0.5.9
func (it *CmdOnceCollection) AddBashEachScriptAsEachCmdOnce( scriptLines ...string, ) *CmdOnceCollection
func (*CmdOnceCollection) AddDefaultScript ¶ added in v0.5.8
func (it *CmdOnceCollection) AddDefaultScript( scriptType scripttype.Variant, scriptsLines ...string, ) *CmdOnceCollection
AddDefaultScript joins using SingleLineScriptsJoiner whereas args joins using space
func (*CmdOnceCollection) AddDefaultScriptArgs ¶ added in v0.5.8
func (it *CmdOnceCollection) AddDefaultScriptArgs( scriptType scripttype.Variant, args ...string, ) *CmdOnceCollection
AddDefaultScriptArgs args joins with space and whereas Scripts joins with SingleLineScriptsJoiner
func (*CmdOnceCollection) AddEachScriptAsEachCmdOnce ¶ added in v0.5.9
func (it *CmdOnceCollection) AddEachScriptAsEachCmdOnce( scriptType scripttype.Variant, scriptLines ...string, ) *CmdOnceCollection
func (*CmdOnceCollection) AddEachScriptAsEachCmdOncePtr ¶ added in v0.5.9
func (it *CmdOnceCollection) AddEachScriptAsEachCmdOncePtr( scriptType scripttype.Variant, scriptLines *[]string, ) *CmdOnceCollection
func (*CmdOnceCollection) AddMany ¶ added in v0.5.8
func (it *CmdOnceCollection) AddMany( cmdOnceItems ...*CmdOnce, ) *CmdOnceCollection
func (*CmdOnceCollection) AsBasicSliceContractsBinder ¶ added in v0.5.8
func (it *CmdOnceCollection) AsBasicSliceContractsBinder() coreinterface.BasicSlicerContractsBinder
func (*CmdOnceCollection) AsBasicSlicerContractsBinder ¶ added in v0.5.8
func (it *CmdOnceCollection) AsBasicSlicerContractsBinder() coreinterface.BasicSlicerContractsBinder
func (*CmdOnceCollection) Clear ¶ added in v0.7.9
func (it *CmdOnceCollection) Clear() *CmdOnceCollection
func (*CmdOnceCollection) Clone ¶ added in v0.5.9
func (it *CmdOnceCollection) Clone() *CmdOnceCollection
func (*CmdOnceCollection) CommandsStrings ¶ added in v0.5.8
func (it *CmdOnceCollection) CommandsStrings() []string
func (*CmdOnceCollection) CompiledOneErrorWrapper ¶ added in v0.5.8
func (it *CmdOnceCollection) CompiledOneErrorWrapper() *errorwrapper.Wrapper
func (*CmdOnceCollection) Count ¶ added in v0.5.8
func (it *CmdOnceCollection) Count() int
func (*CmdOnceCollection) Dispose ¶ added in v0.7.9
func (it *CmdOnceCollection) Dispose()
func (*CmdOnceCollection) ErrorWrappers ¶ added in v0.5.8
func (it *CmdOnceCollection) ErrorWrappers() []*errorwrapper.Wrapper
func (*CmdOnceCollection) ExecuteAll ¶ added in v0.5.9
func (it *CmdOnceCollection) ExecuteAll() *errorwrapper.Wrapper
func (*CmdOnceCollection) ExecuteAllWithoutLazy ¶ added in v0.5.9
func (it *CmdOnceCollection) ExecuteAllWithoutLazy() *errorwrapper.Wrapper
func (*CmdOnceCollection) ExecuteAllWithoutLazyResults ¶ added in v0.5.9
func (it *CmdOnceCollection) ExecuteAllWithoutLazyResults() []*Result
func (*CmdOnceCollection) ExecuteUntilErr ¶ added in v0.5.9
func (it *CmdOnceCollection) ExecuteUntilErr() *errorwrapper.Wrapper
func (*CmdOnceCollection) FailedOutputStringsOnly ¶ added in v0.5.8
func (it *CmdOnceCollection) FailedOutputStringsOnly() []string
FailedOutputStringsOnly returns slice of strings output if cmd has failed only
func (*CmdOnceCollection) HasAnyIssuesRunning ¶ added in v0.5.8
func (it *CmdOnceCollection) HasAnyIssuesRunning() bool
func (*CmdOnceCollection) HasAnyItem ¶ added in v0.5.8
func (it *CmdOnceCollection) HasAnyItem() bool
func (*CmdOnceCollection) HasIndex ¶ added in v0.5.8
func (it *CmdOnceCollection) HasIndex(index int) bool
func (*CmdOnceCollection) IsAllSuccess ¶ added in v0.5.8
func (it *CmdOnceCollection) IsAllSuccess() bool
func (*CmdOnceCollection) IsEmpty ¶ added in v0.5.8
func (it *CmdOnceCollection) IsEmpty() bool
func (*CmdOnceCollection) Items ¶ added in v0.5.8
func (it *CmdOnceCollection) Items() []*CmdOnce
func (*CmdOnceCollection) LastIndex ¶ added in v0.5.8
func (it *CmdOnceCollection) LastIndex() int
func (*CmdOnceCollection) Length ¶ added in v0.5.8
func (it *CmdOnceCollection) Length() int
func (*CmdOnceCollection) OutputsStrings ¶ added in v0.5.8
func (it *CmdOnceCollection) OutputsStrings() []string
func (*CmdOnceCollection) Results ¶ added in v0.5.8
func (it *CmdOnceCollection) Results() []*Result
func (*CmdOnceCollection) String ¶ added in v0.5.8
func (it *CmdOnceCollection) String() string
func (*CmdOnceCollection) Strings ¶ added in v0.5.8
func (it *CmdOnceCollection) Strings() []string
func (*CmdOnceCollection) StringsProcessor ¶ added in v0.5.8
func (it *CmdOnceCollection) StringsProcessor( processor func(cmdOnce *CmdOnce) (processedLine string, isTake, isBreak bool), ) []string
func (*CmdOnceCollection) SuccessStringsOnly ¶ added in v0.5.8
func (it *CmdOnceCollection) SuccessStringsOnly() []string
SuccessStringsOnly returns slice of strings output if cmd has success only
type CustomMessage ¶ added in v0.6.3
type CustomMessage struct {
Success, Failed string
}
type Result ¶
type Result struct { *BaseBufferStdOutError ExitError *exec.ExitError ExitCode int // contains filtered or unexported fields }
func BashArgsResult ¶ added in v0.5.1
func NewResultUsingBaseBuffer ¶
func NewResultUsingBaseBuffer( errorWrapper *errorwrapper.Wrapper, baseBuffer *BaseBufferStdOutError, exitError *exec.ExitError, hasCommandExecuted bool, ) *Result
func ShellArgsResult ¶ added in v0.5.1
func ShellScriptsResult ¶ added in v0.5.1
func (*Result) DetailedOutput ¶
func (*Result) ErrorWrapper ¶
func (it *Result) ErrorWrapper() *errorwrapper.Wrapper
func (*Result) HasCommandExecuted ¶
func (*Result) HasExitError ¶
func (*Result) HasValidExitCode ¶ added in v0.7.3
func (*Result) IsEmptyError ¶
func (*Result) IsExitCode ¶
func (*Result) IsExitCodeByte ¶ added in v0.7.3
func (*Result) IsInvalidExitCode ¶
func (*Result) IsRunSuccessfully ¶ added in v0.7.3
type StdIn ¶ added in v0.8.0
func (*StdIn) StdErrString ¶ added in v0.8.0
func (*StdIn) StdOutString ¶ added in v0.8.0
Source Files
¶
- ArgsJoin.go
- ArgsJoinAppend.go
- ArgsJoinPrepend.go
- ArgsJoinSlice.go
- ArgsJoinSlicePtr.go
- ArgsJoinWithSingle.go
- BaseBufferStdOutError.go
- BaseCmdWrapper.go
- BashArgs.go
- BashArgsErrorWrapper.go
- BashArgsResult.go
- BashChangeDirPlusRunArgs.go
- BashChangeDirPlusRunScripts.go
- BashOutput.go
- BashScripts.go
- BashScriptsErrorWrapper.go
- BashScriptsSingleLine.go
- ChainCmdSuccess.go
- ChangeDirPlusRunScriptsCmdOnce.go
- CmdCompiledOutput.go
- CmdOnce.go
- CmdOnceCollection.go
- CombinedOutput.go
- Conditional.go
- CustomMessage.go
- DisposeBuffer.go
- DisposeBytesPtr.go
- DisposeStringsPtr.go
- GetExitCode.go
- GetScriptOfChangeDirPlusScripts.go
- IsBashArgsSuccess.go
- IsBashScriptsSuccess.go
- IsShellArgsSuccess.go
- IsShellScriptsSuccess.go
- IsSuccess.go
- IsSuccessBashArgs.go
- Result.go
- ShellArgs.go
- ShellArgsErrorWrapper.go
- ShellArgsResult.go
- ShellOutput.go
- ShellScripts.go
- ShellScriptsErrorWrapper.go
- ShellScriptsResult.go
- StdIn.go
- changeDirScriptLine.go
- cmdOutputForError.go
- consts.go
- contructors.go
- failedCmdOneOutputStringProcessor.go
- getNotImplementedCmdOnceForScript.go
- successCmdOneOutputStringProcessor.go
- vars.go