Documentation
¶
Index ¶
- Constants
- func ExecName(name string) string
- func FilepathClean(s string) string
- func FilepathHasDirPrefix(s, prefix string) bool
- func FilepathSplitAt(s string, n int) string
- func FsCaseFilename(filename string) (string, error)
- func GetEnv(env []string, key string) string
- func GetFreeTcpPort() (int, error)
- func HomeEnvVar() string
- func KillExecCmd(cmd *exec.Cmd) error
- func OpenBrowser(url string) error
- func OpenFilemanager(filename string) error
- func OpenTerminal(filename string) error
- func RandomPort(simpleSeed, min, max int) int
- func RunCmdCombinedOutput(cmd *Cmd, rd io.Reader) ([]byte, error)
- func RunCmdI(ci CmdI) error
- func RunCmdOutputs(cmd *Cmd, rd io.Reader) (sout []byte, serr []byte, _ error)
- func RunCmdStdoutAndStderrInErr(cmd *Cmd, rd io.Reader) ([]byte, error)
- func SetEnv(env []string, key, value string) []string
- func SetEnvs(env []string, addEnv []string) []string
- func SetupExecCmdSysProcAttr(cmd *exec.Cmd)
- func ShellRunArgs(args ...string) []string
- func UnquoteEnvValues(env []string) []string
- type BasicCmd
- type CallbackOnStartCmd
- type Cmd
- type CmdI
- type SetSidCmd
- type ShellCmd
- type TmpFiles
- func (tf *TmpFiles) MkdirInTmp(path string) (string, error)
- func (tf *TmpFiles) MkdirInTmpOrPanic(path string) string
- func (tf *TmpFiles) RemoveAll() error
- func (tf *TmpFiles) WriteFileInTmp(path string, src []byte) (string, error)
- func (tf *TmpFiles) WriteFileInTmp2OrPanic(path string, src string) string
- func (tf *TmpFiles) WriteFileInTmpOrPanic(path string, src []byte) string
Constants ¶
View Source
const EscapeRune = '\\'
Variables ¶
This section is empty.
Functions ¶
func FilepathClean ¶ added in v1.1.0
func FilepathHasDirPrefix ¶
func FilepathSplitAt ¶
Result does not start with separator.
func FsCaseFilename ¶ added in v1.3.3
func GetFreeTcpPort ¶ added in v1.1.0
func HomeEnvVar ¶
func HomeEnvVar() string
func KillExecCmd ¶
func OpenBrowser ¶ added in v1.1.0
doesn't wait for the cmd to end
func OpenFilemanager ¶ added in v1.1.0
doesn't wait for the cmd to end
func OpenTerminal ¶ added in v1.3.1
doesn't wait for the cmd to end
func RandomPort ¶ added in v1.1.0
func RunCmdCombinedOutput ¶ added in v1.1.0
func RunCmdOutputs ¶ added in v1.1.0
func RunCmdStdoutAndStderrInErr ¶ added in v1.1.0
Adds stderr to err if it happens.
func SetupExecCmdSysProcAttr ¶
func ShellRunArgs ¶
func UnquoteEnvValues ¶ added in v1.3.1
Types ¶
type BasicCmd ¶ added in v1.3.3
type BasicCmd struct {
// contains filtered or unexported fields
}
func NewBasicCmd ¶ added in v1.3.3
type CallbackOnStartCmd ¶ added in v1.3.3
type CallbackOnStartCmd struct {
CmdI
// contains filtered or unexported fields
}
ex: usefull to print something before any cmd output is printed
func NewCallbackOnStartCmd ¶ added in v1.3.3
func NewCallbackOnStartCmd(cmdi CmdI, cb func(CmdI)) *CallbackOnStartCmd
func (*CallbackOnStartCmd) Start ¶ added in v1.3.3
func (c *CallbackOnStartCmd) Start() error
func (*CallbackOnStartCmd) Wait ¶ added in v1.3.3
func (c *CallbackOnStartCmd) Wait() error
type Cmd ¶ added in v1.1.0
type Cmd struct {
*exec.Cmd
PreOutputCallback func()
NoEnsureStop bool
// contains filtered or unexported fields
}
func (*Cmd) Cancel ¶ added in v1.1.0
func (cmd *Cmd) Cancel()
can be called before a Start(), clears all possible resources
func (*Cmd) SetupStdio ¶ added in v1.1.0
type SetSidCmd ¶ added in v1.3.3
type SetSidCmd struct {
CmdI
// contains filtered or unexported fields
}
type TmpFiles ¶
type TmpFiles struct {
Dir string
}
func NewTmpFiles ¶
func (*TmpFiles) MkdirInTmpOrPanic ¶
Returns the filename
func (*TmpFiles) WriteFileInTmp ¶
func (*TmpFiles) WriteFileInTmp2OrPanic ¶
Returns the filename
Click to show internal directories.
Click to hide internal directories.