cmd

package
v0.0.0-...-e64cc87 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SudoHandleCmd

func SudoHandleCmd() string

func Which

func Which(name string) bool

Types

type CommandHelper

type CommandHelper struct {
	IgnoreExist1 bool
	// contains filtered or unexported fields
}

func NewCommandMgr

func NewCommandMgr(opts ...Option) *CommandHelper

func (*CommandHelper) Run

func (c *CommandHelper) Run(name string, arg ...string) error

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()

func (*CustomWriter) Write

func (cw *CustomWriter) Write(p []byte) (n int, err error)

type Option

type Option func(*CommandHelper)

func WithContext

func WithContext(ctx context.Context) Option

func WithEnv

func WithEnv(env ...string) Option

func WithIgnoreExist1

func WithIgnoreExist1() Option

func WithLogger

func WithLogger(logger *log.Logger) Option

func WithOutputFile

func WithOutputFile(outputFile string) Option

func WithTask

func WithTask(taskItem task.Task) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

func WithWorkDir

func WithWorkDir(workDir string) Option

type PipeCommand

type PipeCommand struct {
	Name  string
	Args  []string
	Env   []string
	Dir   string
	Stdin io.Reader
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL