Documentation
¶
Index ¶
- func SudoHandleCmd() string
- func Which(name string) bool
- type CommandHelper
- func (c *CommandHelper) Run(name string, arg ...string) error
- func (c *CommandHelper) RunPipe(commands ...PipeCommand) (string, error)
- func (c *CommandHelper) RunPipeToFile(outputFile string, commands ...PipeCommand) (string, error)
- func (c *CommandHelper) RunWithStdout(name string, arg ...string) (string, error)
- type CustomWriter
- type Option
- func WithContext(ctx context.Context) Option
- func WithEnv(env ...string) Option
- func WithIgnoreExist1() Option
- func WithLogger(logger *log.Logger) Option
- func WithOutputFile(outputFile string) Option
- func WithTask(taskItem task.Task) Option
- func WithTimeout(timeout time.Duration) Option
- func WithWorkDir(workDir string) Option
- type PipeCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SudoHandleCmd ¶
func SudoHandleCmd() string
Types ¶
type CommandHelper ¶
type CommandHelper struct {
IgnoreExist1 bool
// contains filtered or unexported fields
}
func NewCommandMgr ¶
func NewCommandMgr(opts ...Option) *CommandHelper
func (*CommandHelper) RunPipe ¶
func (c *CommandHelper) RunPipe(commands ...PipeCommand) (string, error)
func (*CommandHelper) RunPipeToFile ¶
func (c *CommandHelper) RunPipeToFile(outputFile string, commands ...PipeCommand) (string, error)
func (*CommandHelper) RunWithStdout ¶
func (c *CommandHelper) RunWithStdout(name string, arg ...string) (string, error)
type CustomWriter ¶
type CustomWriter struct {
// contains filtered or unexported fields
}
func (*CustomWriter) Flush ¶
func (cw *CustomWriter) Flush()
type Option ¶
type Option func(*CommandHelper)
func WithContext ¶
func WithIgnoreExist1 ¶
func WithIgnoreExist1() Option
func WithLogger ¶
func WithOutputFile ¶
func WithTimeout ¶
func WithWorkDir ¶
Click to show internal directories.
Click to hide internal directories.