Documentation
¶
Overview ¶
Package cmd provides lazily resolved external commands for iv decoders that shell out (ffmpeg, ffprobe).
Index ¶
- func Source(ctx context.Context, r io.Reader, ext string) (string, func(), error)
- func TempDir(ctx context.Context) (string, func(), error)
- type Cmd
- func (c *Cmd) Available() bool
- func (c *Cmd) CombinedOutput(ctx context.Context, params ...string) ([]byte, error)
- func (c *Cmd) Name() string
- func (c *Cmd) Path() (string, error)
- func (c *Cmd) Run(ctx context.Context, params ...string) ([]byte, error)
- func (c *Cmd) Stream(ctx context.Context, f func(io.Reader) error, params ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cmd ¶
type Cmd struct {
// contains filtered or unexported fields
}
Cmd is an external command, resolved in $PATH on first use.
func (*Cmd) CombinedOutput ¶
CombinedOutput executes the command, returning its combined output.
func (*Cmd) Run ¶
Run executes the command, returning its standard output. Any error includes the leading portion of standard error.
func (*Cmd) Stream ¶ added in v0.18.0
Stream runs the command, handing its standard output to f as it is written rather than collecting it first, and returns when f does.
The command is stopped once f returns, so a caller that has read as much as it wants leaves nothing behind blocked on a pipe that nobody is reading -- and what the command made of being stopped, a kill or a broken pipe, is not an error to report. A command that failed while f was reading shows up as the short read f reports instead, and its standard error is put with it.