command

package
v0.0.0-...-c26f926 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: MIT Imports: 9 Imported by: 7

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 interface{}) error

func (*StringCommand) UnmarshalYAML

func (c *StringCommand) UnmarshalYAML(dec func(interface{}) error) error

Jump to

Keyboard shortcuts

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