Documentation ¶
Index ¶
- Constants
- Variables
- func ArgsJoin(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 BufferClone(buffer *bytes.Buffer) *bytes.Buffer
- func ClearDispose(cmdOnceRan *CmdOnce)
- func CmdSetOsStandardWriters(cmd *exec.Cmd) *exec.Cmd
- func CmdToScriptLine(cmd *exec.Cmd) string
- func CombinedOutputError(stdIn *StdIn, processName string, args ...string) *cmdCompiledOutput
- func CurrentOsDetails() (*osmixtype.OperatingSystemDetail, *errorwrapper.Wrapper)
- func GetExitCode(errorWrapper coreinterface.IsEmptyChecker, exitError *exec.ExitError) int
- func GetFormattedKeyValueData(varName string, varValue string) string
- func InvalidCmdCompiledOutput(err error, process string, args []string) *cmdCompiledOutput
- func ProcessArgsJoinAppend(process string, args ...string) string
- type BaseCmdWrapper
- type 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) CompiledErrorWrapperWithErrorBufferBytes() (errorBufferBytes []byte, compiledErrorWrapper *errorwrapper.Wrapper)
- func (it *CmdOnce) CompiledErrorWrapperWithErrorBufferLine() (errorBufferLine string, compiledErrorWrapper *errorwrapper.Wrapper)
- func (it *CmdOnce) CompiledFullErrorWrapper() *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) DisposeWithoutErrorWrapper()
- func (it *CmdOnce) DisposeWithoutResult()
- 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) InitializeEnvVars()
- 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) AddBashArgsDefault(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) 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 CurrentOsScriptBuilder
- type FilterScriptBuilderFunc
- type OsMixTypeScriptBuilder
- type Result
- func (it *Result) AllErrorBytes() (errorBufferBytes []byte, compiledErrorWrapper *errorwrapper.Wrapper)
- func (it *Result) AllErrorString() (errorBufferLine string, compiledErrorWrapper *errorwrapper.Wrapper)
- func (it Result) CombinedBothErrorOutputLines() []string
- func (it Result) CompiledErrorLines() []string
- func (it *Result) CompiledFullErrorWrapper() *errorwrapper.Wrapper
- func (it Result) CompiledOutputLines() []string
- func (it Result) CompiledTrimmedErrorLines() []string
- func (it Result) CompiledTrimmedErrorOutput() string
- func (it Result) CompiledTrimmedOutput() string
- func (it Result) CompiledTrimmedOutputLines() []string
- func (it *Result) DetailedOutput() string
- func (it *Result) Dispose()
- func (it *Result) DisposeWithoutErrorWrapper()
- func (it Result) ErrorBytes() []byte
- func (it Result) ErrorString() string
- func (it *Result) ErrorWrapper() *errorwrapper.Wrapper
- func (it *Result) ExitCodeByte() byte
- func (it *Result) HandleError()
- func (it *Result) HasAnyError() bool
- func (it *Result) HasCommandExecuted() bool
- func (it *Result) HasError() bool
- func (it Result) HasErrorBuffer() bool
- func (it Result) HasErrorBufferData() bool
- func (it Result) HasErrorContent() bool
- func (it *Result) HasExitError() bool
- func (it *Result) HasNoError() bool
- func (it Result) HasOutputBuffer() bool
- func (it Result) HasOutputBufferData() bool
- func (it Result) HasOutputContent() bool
- func (it *Result) HasValidExitCode() bool
- func (it *Result) IsEmptyError() bool
- func (it Result) IsEmptyErrorBuffer() bool
- func (it Result) IsEmptyOutput() bool
- func (it *Result) IsExitCode(exitCode int) bool
- func (it *Result) IsExitCodeByte(exitCode byte) bool
- func (it *Result) IsFailed() bool
- func (it *Result) IsInvalid() bool
- func (it *Result) IsInvalidExitCode() bool
- func (it *Result) IsRunSuccessfully() bool
- func (it *Result) IsSuccess() bool
- func (it Result) OutputBytes() []byte
- func (it Result) OutputString() string
- func (it Result) SafeBytes() []byte
- func (it Result) SafeErrorBytes() []byte
- func (it Result) String() string
- func (it Result) StringIf(isErrorOnly bool) string
- type ScriptBuilderFinalizer
- type ScriptBuilderWithTypeProcessorFunc
- type ScriptOnceBuilder
- type ScriptOnceBuilderContractsBinder
- type StdIn
Constants ¶
const ( InvalidExitCode = consts.InvalidExitCode SuccessfullyRunningExitCode = consts.CmdSuccessfullyRunningExitCode ScriptsMultiLineJoiner = " && \\ \n" // " && \\ \n" SingleLineScriptsJoiner = " && " // " && " )
Variables ¶
var ( NewShellScript = &newCmdOnceTypedScriptsCreator{ scriptType: scripttype.Shell, } NewBashScript = &newCmdOnceTypedScriptsCreator{ scriptType: scripttype.Bash, } New = &newCreator{ ShellScript: NewShellScript, BashScript: NewBashScript, } )
Functions ¶
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 ClearDispose ¶ added in v0.9.2
func ClearDispose(cmdOnceRan *CmdOnce)
func CmdSetOsStandardWriters ¶ added in v0.9.6
func CmdToScriptLine ¶ added in v0.9.6
func CurrentOsDetails ¶ added in v0.9.6
func CurrentOsDetails() (*osmixtype.OperatingSystemDetail, *errorwrapper.Wrapper)
func GetExitCode ¶ added in v0.7.3
func GetExitCode( errorWrapper coreinterface.IsEmptyChecker, exitError *exec.ExitError, ) int
func GetFormattedKeyValueData ¶ added in v0.9.6
GetFormattedKeyValueData "MY_VAR=some_value"
func InvalidCmdCompiledOutput ¶ added in v0.8.0
func ProcessArgsJoinAppend ¶ added in v0.9.6
Types ¶
type BaseCmdWrapper ¶
type BaseCmdWrapper struct {
// contains filtered or unexported fields
}
func (*BaseCmdWrapper) Dispose ¶ added in v0.7.9
func (it *BaseCmdWrapper) Dispose()
func (*BaseCmdWrapper) DisposeWithoutErrorWrapper ¶ added in v0.8.9
func (it *BaseCmdWrapper) DisposeWithoutErrorWrapper()
type CmdOnce ¶
func Conditional ¶ added in v0.6.5
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) 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 depend 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 CmdOnce ¶
using RunOnce then returns the final compiled error
func (*CmdOnce) CompiledErrorWrapperWithErrorBufferBytes ¶ added in v0.8.9
func (it *CmdOnce) CompiledErrorWrapperWithErrorBufferBytes() ( errorBufferBytes []byte, compiledErrorWrapper *errorwrapper.Wrapper, )
CompiledErrorWrapperWithErrorBufferBytes
Runs CmdOnce ¶
using RunOnce then returns the final compiled error with error buffer lines
Calls Result.AllErrorBytes() Here, the value in result represent the buffer error bytes (from std) and error wrapper represents the compiled ErrorWrapper
func (*CmdOnce) CompiledErrorWrapperWithErrorBufferLine ¶ added in v0.8.9
func (it *CmdOnce) CompiledErrorWrapperWithErrorBufferLine() ( errorBufferLine string, compiledErrorWrapper *errorwrapper.Wrapper, )
CompiledErrorWrapperWithErrorBufferLine
Runs CmdOnce ¶
using RunOnce then returns the final compiled error with error buffer lines
Calls Result.AllErrorString() Here, the value in result represent the buffer error string (from std) and error wrapper represents the compiled ErrorWrapper
func (*CmdOnce) CompiledFullErrorWrapper ¶ added in v0.8.9
func (it *CmdOnce) CompiledFullErrorWrapper() *errorwrapper.Wrapper
CompiledFullErrorWrapper
Represents compiled error wrapper + std error line
(if baseBufferStdOutError has any error bytes)
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) 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) DisposeWithoutErrorWrapper ¶ added in v0.8.9
func (it *CmdOnce) DisposeWithoutErrorWrapper()
func (*CmdOnce) DisposeWithoutResult ¶ added in v0.9.2
func (it *CmdOnce) DisposeWithoutResult()
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 compiled 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) InitializeEnvVars ¶ added in v0.9.6
func (it *CmdOnce) InitializeEnvVars()
InitializeEnvVars
Warning must be set before run.
func (*CmdOnce) IsAlreadyRan ¶
func (*CmdOnce) IsSuccessfullyExecuted ¶
IsSuccessfullyExecuted Runs the execution and then returns the success result.
Reveals if any issue after compile, thus runs 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) AddBashArgsDefault ¶ added in v0.9.2
func (it *CmdOnceCollection) AddBashArgsDefault( 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) 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 CurrentOsScriptBuilder ¶ added in v0.9.6
type CurrentOsScriptBuilder interface { CurrentOsTypes() []osmixtype.Variant CurrentOsTypesMap() map[osmixtype.Variant]bool BuildersMap() map[osmixtype.Variant]ScriptOnceBuilder ResultsMap() map[osmixtype.Variant]*Result CmdOnceMap() map[osmixtype.Variant]*CmdOnce OutputMap() map[osmixtype.Variant]string DetailedMap() map[osmixtype.Variant]string CmdMap() map[osmixtype.Variant]*exec.Cmd OutputLinesSimpleSliceMap() map[osmixtype.Variant]*corestr.SimpleSlice // HasAnyItem // // Only counts and checks available builders, O(N), expensive HasAnyItem() bool // IsEmpty // // Only counts and checks available builders, O(N), expensive IsEmpty() bool coreinterface.CombinedValidationChecker coreinterface.IsSuccessValidator errcoreinf.CompiledVoidLogger Length() int AvailableLength() int }
type FilterScriptBuilderFunc ¶ added in v0.9.6
type FilterScriptBuilderFunc func(variant osmixtype.Variant, builder ScriptOnceBuilder) (isTake, isBreak bool)
type OsMixTypeScriptBuilder ¶ added in v0.9.6
type OsMixTypeScriptBuilder interface { TaskName() string SetTaskName(taskName string) OsMixTypeScriptBuilder AddNewBuilder( osMixType osmixtype.Variant, scriptType scripttype.Variant, ) OsMixTypeScriptBuilder AddBuilder( osMixType osmixtype.Variant, builder ScriptOnceBuilder, ) OsMixTypeScriptBuilder Description() string SetDescription(description string) OsMixTypeScriptBuilder Url() string SetUrl(url string) OsMixTypeScriptBuilder ExistingOsMixTypes() []osmixtype.Variant SetCurrentEnv( osMixTypes ...osmixtype.Variant, ) *errorwrapper.Wrapper SetCurrentEnvToAll() OsMixTypeScriptBuilder SetCurrentEnvPlus( osMixType osmixtype.Variant, envValues ...corestr.KeyValuePair, ) *errorwrapper.Wrapper SetCurrentEnvPlusIf( isCondition bool, osMixType osmixtype.Variant, envValues ...corestr.KeyValuePair, ) *errorwrapper.Wrapper SetCurrentEnvPlusMapAll(envMap map[string]string) OsMixTypeScriptBuilder EnvVars(osMixType osmixtype.Variant) *corestr.KeyValueCollection HasAnyEnvVarsOnAll(osMixTypes ...osmixtype.Variant) bool IsCurrentEnvSetOnAll(osMixTypes ...osmixtype.Variant) bool AddProcessArgs( process string, args ...string, ) OsMixTypeScriptBuilder AddProcessArgsBy( osMixType osmixtype.Variant, process string, args ...string, ) OsMixTypeScriptBuilder AddArgsByIf( isAdd bool, osMixType osmixtype.Variant, args ...string, ) OsMixTypeScriptBuilder AddProcessArgsByIf( isAdd bool, osMixType osmixtype.Variant, process string, args ...string, ) OsMixTypeScriptBuilder AddArgsBy( osMixType osmixtype.Variant, args ...string, ) OsMixTypeScriptBuilder AddArgs(args ...string) OsMixTypeScriptBuilder AddArgsIf( isAdd bool, args ...string, ) OsMixTypeScriptBuilder Unix() ScriptOnceBuilder Windows() ScriptOnceBuilder Linux() ScriptOnceBuilder MacOs() ScriptOnceBuilder Ubuntu() ScriptOnceBuilder CentOs() ScriptOnceBuilder GetBy( osMixType osmixtype.Variant, ) ScriptOnceBuilder // GetWithStat // // isDefined : found and not null GetWithStat( osMixType osmixtype.Variant, ) (scriptOnceBuilder ScriptOnceBuilder, isDefined bool) HasBuilder( mixType osmixtype.Variant, ) bool // IsValidBuilder // // represents that builder present // and script lines present // and script type is valid // // return it != nil && // it.scriptType.IsValid() && // !it.HasError() && // it.scriptLines.HasAnyItem() IsValidBuilder( mixType osmixtype.Variant, ) bool // IsInvalidBuilder // // invert of IsValidBuilder IsInvalidBuilder( mixType osmixtype.Variant, ) bool // IsAllBuildersValid // // represents that all builder exist // with lines and script type is valid IsAllBuildersValid( mixTypes ...osmixtype.Variant, ) bool IsAnyInvalidBuilders( mixTypes ...osmixtype.Variant, ) bool IsBuilderMissing( mixType osmixtype.Variant, ) bool // IsBuilderMissingOrInvalid // // Either builder not found or, // builder has no script lines or // script type is not valid IsBuilderMissingOrInvalid( mixType osmixtype.Variant, ) bool HasBuilderScriptLines( mixType osmixtype.Variant, ) bool GetBuilder( mixType osmixtype.Variant, ) (scriptBuilder ScriptOnceBuilder, hasBuilder bool) HasAllBuilder( mixTypes ...osmixtype.Variant, ) bool HasAnyBuilder( mixTypes ...osmixtype.Variant, ) bool HasUnix() bool HasWindows() bool HasLinux() bool IsEmptyUnix() bool IsEmptyWindows() bool IsEmptyLinux() bool IsEmptyMacOs() bool IsEmptyBy(osMixType osmixtype.Variant) bool HasAnyItemBy(osMixType osmixtype.Variant) bool LoopInvokeFunc(processorFunc ScriptBuilderWithTypeProcessorFunc) Filter( filter FilterScriptBuilderFunc, ) (resultMap map[osmixtype.Variant]ScriptOnceBuilder) FilterOsMixTypes( filter FilterScriptBuilderFunc, ) (osMixTypes []osmixtype.Variant) GetBuildersMapByOsMixTypes( osMixTypes []osmixtype.Variant, ) (resultMap map[osmixtype.Variant]ScriptOnceBuilder) UnixBuild() *CmdOnce WindowsBuild() *CmdOnce LinuxBuild() *CmdOnce MacOsBuild() *CmdOnce UnixBuildCmd() *exec.Cmd WindowsBuildCmd() *exec.Cmd LinuxBuildCmd() *exec.Cmd MacOsBuildCmd() *exec.Cmd List() []ScriptOnceBuilder ListMap() map[osmixtype.Variant]ScriptOnceBuilder IsNull() bool AvailableBuilders() []ScriptOnceBuilder BuildersMap() map[osmixtype.Variant]ScriptOnceBuilder AvailableBuildersMap() map[osmixtype.Variant]ScriptOnceBuilder ExecutionResultMap() map[osmixtype.Variant]*Result BuildMap() map[osmixtype.Variant]*CmdOnce BuildMapOnly( osMixes ...osmixtype.Variant, ) map[osmixtype.Variant]*CmdOnce ResultMapOnly( osMixes ...osmixtype.Variant, ) map[osmixtype.Variant]*Result BuildCmdMapOnly( osMixes ...osmixtype.Variant, ) map[osmixtype.Variant]*exec.Cmd OutputMapOnly( osMixes ...osmixtype.Variant, ) map[osmixtype.Variant]string OutputLinesSimpleSliceMapOnly( osMixes ...osmixtype.Variant, ) map[osmixtype.Variant]*corestr.SimpleSlice DetailedOutputMapOnly( osMixes ...osmixtype.Variant, ) map[osmixtype.Variant]string BuildersMapOnly( osMixes ...osmixtype.Variant, ) map[osmixtype.Variant]ScriptOnceBuilder CurrentOsTypes() []osmixtype.Variant CurrentOsTypesMap() map[osmixtype.Variant]bool CurrentOsScriptBuilder() CurrentOsScriptBuilder CompiledErrorWrappersMapOnly( osMixes ...osmixtype.Variant, ) (compiledMap map[osmixtype.Variant]*errorwrapper.Wrapper, hasAnyError bool) AllCompiledErrorWrappersMapOnly() ( compiledMap map[osmixtype.Variant]*errorwrapper.Wrapper, hasAnyError bool, ) BuildCmdMap() map[osmixtype.Variant]*exec.Cmd OutputMap() map[osmixtype.Variant]string OutputBytesMap() map[osmixtype.Variant][]byte CombinedOutputMap() map[osmixtype.Variant]coredata.BytesError AsyncExecutionResultMap() map[osmixtype.Variant]*Result StandardOutputCmd() OsMixTypeScriptBuilder AsyncStart(stdIn, stdOut, stderr *bytes.Buffer) ( map[osmixtype.Variant]error, *sync.WaitGroup, ) OutputMapMust() (resultMap map[osmixtype.Variant]string) TrimmedOutputMap() (resultMap map[osmixtype.Variant]string) OutputLinesMap() (resultMap map[osmixtype.Variant][]string) ErrorOutputMap() (resultMap map[osmixtype.Variant]string) TrimmedOutputLinesMap() (resultMap map[osmixtype.Variant][]string) BuildClearMap() (resultMap map[osmixtype.Variant]*CmdOnce) BuildDisposeMap() (resultMap map[osmixtype.Variant]*CmdOnce) // HasAnyItem // // Only counts and checks available builders, O(N), expensive HasAnyItem() bool // IsEmpty // // Only counts and checks available builders, O(N), expensive IsEmpty() bool coreinterface.CombinedValidationChecker coreinterface.IsSuccessValidator errcoreinf.CompiledVoidLogger Length() int // ValidLength // // Only counts and checks available builders, O(N), expensive ValidLength() int String() string StringsMap() (resultMap map[osmixtype.Variant][]string) }
type Result ¶
type Result struct { ExitError *exec.ExitError ExitCode int // contains filtered or unexported fields }
func (*Result) AllErrorBytes ¶ added in v0.8.9
func (it *Result) AllErrorBytes() (errorBufferBytes []byte, compiledErrorWrapper *errorwrapper.Wrapper)
AllErrorBytes
errstr.Result Value represents std error buffer lines errstr.Result ErrorWrapper represents the Result.ErrorWrapper
func (*Result) AllErrorString ¶ added in v0.8.9
func (it *Result) AllErrorString() (errorBufferLine string, compiledErrorWrapper *errorwrapper.Wrapper)
AllErrorString
errstr.Result Value represents std error buffer lines errstr.Result ErrorWrapper represents the Result.ErrorWrapper
func (Result) CombinedBothErrorOutputLines ¶ added in v0.9.2
func (it Result) CombinedBothErrorOutputLines() []string
func (Result) CompiledErrorLines ¶ added in v0.9.2
func (it Result) CompiledErrorLines() []string
func (*Result) CompiledFullErrorWrapper ¶ added in v0.8.9
func (it *Result) CompiledFullErrorWrapper() *errorwrapper.Wrapper
CompiledFullErrorWrapper
Represents compiled error wrapper + std error line
(if baseBufferStdOutError has any error bytes)
func (Result) CompiledOutputLines ¶ added in v0.9.2
func (it Result) CompiledOutputLines() []string
func (Result) CompiledTrimmedErrorLines ¶ added in v0.9.2
func (it Result) CompiledTrimmedErrorLines() []string
func (Result) CompiledTrimmedErrorOutput ¶ added in v0.9.2
func (it Result) CompiledTrimmedErrorOutput() string
func (Result) CompiledTrimmedOutput ¶ added in v0.9.2
func (it Result) CompiledTrimmedOutput() string
func (Result) CompiledTrimmedOutputLines ¶ added in v0.9.2
func (it Result) CompiledTrimmedOutputLines() []string
func (*Result) DetailedOutput ¶
func (*Result) DisposeWithoutErrorWrapper ¶ added in v0.8.9
func (it *Result) DisposeWithoutErrorWrapper()
func (Result) ErrorBytes ¶ added in v0.9.2
func (it Result) ErrorBytes() []byte
func (Result) ErrorString ¶ added in v0.9.2
func (it Result) ErrorString() string
func (*Result) ErrorWrapper ¶
func (it *Result) ErrorWrapper() *errorwrapper.Wrapper
func (*Result) ExitCodeByte ¶ added in v0.8.9
func (*Result) HandleError ¶ added in v0.9.6
func (it *Result) HandleError()
func (*Result) HasAnyError ¶ added in v0.8.9
func (*Result) HasCommandExecuted ¶
func (Result) HasErrorBuffer ¶ added in v0.9.2
func (it Result) HasErrorBuffer() bool
func (Result) HasErrorBufferData ¶ added in v0.9.2
func (it Result) HasErrorBufferData() bool
func (Result) HasErrorContent ¶ added in v0.9.2
func (it Result) HasErrorContent() bool
HasErrorContent
Indicates error buffer has data. alias for HasErrorBufferData
func (*Result) HasExitError ¶
func (*Result) HasNoError ¶ added in v0.8.9
func (Result) HasOutputBuffer ¶ added in v0.9.2
func (it Result) HasOutputBuffer() bool
func (Result) HasOutputBufferData ¶ added in v0.9.2
func (it Result) HasOutputBufferData() bool
func (Result) HasOutputContent ¶ added in v0.9.2
func (it Result) HasOutputContent() bool
HasOutputContent
Indicates output buffer has data. alias for HasOutputBufferData
func (*Result) HasValidExitCode ¶ added in v0.7.3
func (*Result) IsEmptyError ¶
func (Result) IsEmptyErrorBuffer ¶ added in v0.9.2
func (it Result) IsEmptyErrorBuffer() bool
IsEmptyErrorBuffer
Indicates error buffer has NO data.
func (Result) IsEmptyOutput ¶ added in v0.9.2
func (it Result) IsEmptyOutput() bool
IsEmptyOutput
Indicates output buffer has NO data.
func (*Result) IsExitCode ¶
func (*Result) IsExitCodeByte ¶ added in v0.7.3
func (*Result) IsInvalidExitCode ¶
func (*Result) IsRunSuccessfully ¶ added in v0.7.3
func (Result) OutputBytes ¶ added in v0.9.2
func (it Result) OutputBytes() []byte
func (Result) OutputString ¶ added in v0.9.2
func (it Result) OutputString() string
func (Result) SafeBytes ¶ added in v0.9.2
func (it Result) SafeBytes() []byte
SafeBytes
Alias for OutputBytes
func (Result) SafeErrorBytes ¶ added in v0.9.2
func (it Result) SafeErrorBytes() []byte
SafeErrorBytes
Alias for ErrorBytes
type ScriptBuilderFinalizer ¶ added in v0.9.6
type ScriptBuilderFinalizer interface { HasError() bool Result() *Result CompiledErrorWrapper() *errorwrapper.Wrapper ErrorWithTraces() error ErrorStringWithTraces() string // AsyncStart // // Starts cmd in async manner, // have to wait to be waited on // // Check out exec.Cmd Start() AsyncStart() (*exec.Cmd, error) // AsyncStartErrorWrapper // // Starts cmd in async manner, // have to wait to be waited on // // Check out exec.Cmd Start() AsyncStartErrorWrapper() (*exec.Cmd, *errorwrapper.Wrapper) CombinedOutput() ([]byte, error) CombinedOutputErrorWrapper() ([]byte, *errorwrapper.Wrapper) // Output // // Gives compiled output Output() string // OutputMust // // Gives compiled output, // on error panics OutputMust() string // TrimmedOutput // // Gives compiled output string without whitespace lines TrimmedOutput() string // String // // Gives compiled output String() string // Strings // // Gives compiled output lines Strings() []string ErrorOutput() string DetailedOutput() string OutputLines() []string OutputLinesSimpleSlice() *corestr.SimpleSlice TrimmedOutputLines() []string OutputBytes() []byte // StandardOutputCmd // // refers to os standard output inputs binding // // os.Stdin, os.Stdout, os.Stderr StandardOutputCmd() *exec.Cmd Build() *CmdOnce BuildClear() *CmdOnce BuildDispose() *CmdOnce BuildCmd() *exec.Cmd BuildCmdClear() *exec.Cmd NewBuilderWithArgs(args ...string) ScriptOnceBuilder Clone() ScriptOnceBuilder BuildCmdWithStdIn() (cmd *exec.Cmd, stdInWriter *bytes.Buffer) coreinterface.CombinedValidationChecker coreinterface.IsSuccessValidator errcoreinf.CompiledVoidLogger }
type ScriptBuilderWithTypeProcessorFunc ¶ added in v0.9.6
type ScriptBuilderWithTypeProcessorFunc func(variant osmixtype.Variant, builder ScriptOnceBuilder)
type ScriptOnceBuilder ¶ added in v0.9.6
type ScriptOnceBuilder interface { ScriptBuilderFinalizer // CompiledProcessArgs // // All ScriptLines will be compiled to // args and script type will be output as process name CompiledProcessArgs() ( processName string, args []string, ) SetSecure() ScriptOnceBuilder SetPlainOutput() ScriptOnceBuilder EnableOutput() ScriptOnceBuilder DisableOutput() ScriptOnceBuilder SetScriptType( scriptType scripttype.Variant, ) ScriptOnceBuilder SetScriptLines( scriptLines *corestr.SimpleSlice, ) ScriptOnceBuilder SetStdIn( stdIn *bytes.Buffer, ) ScriptOnceBuilder SetStdOut( stdOut *bytes.Buffer, ) ScriptOnceBuilder SetStderr( stderr *bytes.Buffer, ) ScriptOnceBuilder SetScript( scriptType scripttype.Variant, ) ScriptOnceBuilder AllBuffers() ( stdIn, stdOut, stderr *bytes.Buffer, ) SetInputOutput( stdIn, stdOut, stderr *bytes.Buffer, ) ScriptOnceBuilder AppendScriptLines( lines ...string, ) ScriptOnceBuilder Args( args ...string, ) ScriptOnceBuilder ArgsIf( isAdd bool, args ...string, ) ScriptOnceBuilder ProcessArgs( process string, args ...string, ) ScriptOnceBuilder Process( process string, ) ScriptOnceBuilder ProcessArgsIf( isAdd bool, process string, args ...string, ) ScriptOnceBuilder ProcessIf( isAdd bool, process string, ) ScriptOnceBuilder ScriptLines() corestr.SimpleSlice Append(appendItems ...ScriptOnceBuilder) ScriptOnceBuilder // AppendCmd // // Empty or has issues will be ignored. AppendCmd(appendItems ...*exec.Cmd) ScriptOnceBuilder // AppendCmdOnce // // Empty or has issues will be ignored. AppendCmdOnce(appendItems ...*CmdOnce) ScriptOnceBuilder IsDefined() bool // HasPlainOutput // // returns true if not secure output and has output HasPlainOutput() bool // HasInsecureOutput // // returns true if not secure output HasInsecureOutput() bool HasStdIn() bool HasStdOut() bool HasStdErr() bool Length() int HasAnyItem() bool IsEmpty() bool IsNull() bool IsNotNull() bool IsAnyNull() bool IsValidWithoutItems() bool IsDisposed() bool IsFinalized() bool SetCurrentEnv() ScriptOnceBuilder SetCurrentEnvPlus( envValues ...corestr.KeyValuePair, ) ScriptOnceBuilder SetCurrentEnvPlusIf( isCondition bool, envValues ...corestr.KeyValuePair, ) ScriptOnceBuilder SetCurrentEnvPlusMap(envMap map[string]string) ScriptOnceBuilder EnvVars() *corestr.KeyValueCollection HasAnyEnvVars() bool IsCurrentEnvSet() bool Dispose() // Clear // // clears commands stacks Clear() }
type ScriptOnceBuilderContractsBinder ¶ added in v0.9.6
type ScriptOnceBuilderContractsBinder interface { ScriptOnceBuilder AsScriptOnceBuilderContractsBinder() ScriptOnceBuilderContractsBinder }
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
- ArgsJoinPrepend.go
- ArgsJoinSlice.go
- ArgsJoinSlicePtr.go
- ArgsJoinWithSingle.go
- BaseCmdWrapper.go
- BufferClone.go
- ClearDispose.go
- CmdOnce.go
- CmdOnceCollection.go
- CmdSetOsStandardWriters.go
- CmdToScriptLine.go
- CombinedOutput.go
- Conditional.go
- CurrentOsDetails.go
- GetExitCode.go
- GetFormattedKeyValueData.go
- ProcessArgsJoinAppend.go
- Result.go
- StdIn.go
- all-interfaces.go
- baseBufferStdOutError.go
- changeDirScriptLine.go
- cmdCompiledOutput.go
- cmdOutputForError.go
- consts.go
- currentOsScriptBuilder.go
- disposeBuffer.go
- disposeBytesPtr.go
- disposeStringsPtr.go
- failedCmdOneOutputStringProcessor.go
- funcs.go
- getNotImplementedCmdOnceForScript.go
- getScriptOfChangeDirPlusScripts.go
- newCmdCreator.go
- newCmdOnceNoOutputCreator.go
- newCmdOnceScriptBuilder.go
- newCmdOnceScriptCreator.go
- newCmdOnceTypedScriptsCreator.go
- newCreator.go
- newOsTypeScriptBuilderCreator.go
- newOutputGetter.go
- osTypeScriptBuilder.go
- scriptOnceBuilder.go
- successCmdOneOutputStringProcessor.go
- vars.go