command

package
v0.0.0-...-d35c247 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: MIT Imports: 10 Imported by: 4 modules, 7 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdSignal

func CmdSignal(cmd *exec.Cmd, signal os.Signal) error

func NewCmdAsUser

func NewCmdAsUser(command string) *exec.Cmd

Types

type Cmd

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

func New

func New(cmd *exec.Cmd, opts ...CmdOption) (*Cmd, error)

func (*Cmd) IsRunning

func (i *Cmd) IsRunning() bool

func (*Cmd) Run

func (i *Cmd) Run() error

func (*Cmd) SetStdin

func (i *Cmd) SetStdin(r io.Reader)

func (*Cmd) Stderr

func (i *Cmd) Stderr() io.ReadCloser

func (*Cmd) Stdout

func (i *Cmd) Stdout() io.ReadCloser

func (*Cmd) Stop

func (i *Cmd) Stop(cleanupTimeout time.Duration) error

func (*Cmd) Wait

func (i *Cmd) Wait() error

func (*Cmd) WaitChannel

func (i *Cmd) WaitChannel() <-chan struct{}

type CmdOption

type CmdOption func(*Cmd)

func WithDir

func WithDir(dir string) CmdOption

func WithEnv

func WithEnv(env []string) CmdOption

type StringCommand

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

func NewStringCommandFromArray

func NewStringCommandFromArray(s []string) *StringCommand

func NewStringCommandFromString

func NewStringCommandFromString(s string) *StringCommand

func (*StringCommand) Array

func (c *StringCommand) Array() []string

func (*StringCommand) ArrayOrShell

func (c *StringCommand) ArrayOrShell() []string

func (*StringCommand) ExecCmdAsUser

func (c *StringCommand) ExecCmdAsUser() *exec.Cmd

func (*StringCommand) Flatten

func (c *StringCommand) Flatten() string

func (*StringCommand) IsArray

func (c *StringCommand) IsArray() bool

func (*StringCommand) IsEmpty

func (c *StringCommand) IsEmpty() bool

func (*StringCommand) MarshalJSON

func (c *StringCommand) MarshalJSON() ([]byte, error)

func (*StringCommand) UnmarshalJSON

func (c *StringCommand) UnmarshalJSON(b []byte) error

func (*StringCommand) UnmarshalMapstructure

func (c *StringCommand) UnmarshalMapstructure(o any) error

func (*StringCommand) UnmarshalYAML

func (c *StringCommand) UnmarshalYAML(dec func(any) error) error

Jump to

Keyboard shortcuts

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