shell

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MulanPSL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecShell

func ExecShell(ctx context.Context, command string) (string, error)

ExecShell 执行shell命令,可设置执行超时时间

func ExecShellEx

func ExecShellEx(ctx context.Context, cmd Cmd, command string) (string, error)

ExecShellEx 执行shell命令,可设置执行超时时间

Types

type Cmd

type Cmd interface {
	New(command string)
	Exec() (string, error)
	Destroy() error
}

type Result

type Result struct {
	// contains filtered or unexported fields
}

type UnixShell

type UnixShell struct {
	*exec.Cmd
}

func (UnixShell) Destroy

func (c UnixShell) Destroy() error

func (UnixShell) Exec

func (c UnixShell) Exec() (string, error)

func (*UnixShell) New

func (c *UnixShell) New(command string)

Jump to

Keyboard shortcuts

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