Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
Consumer is really only defined for symmetry with "Producer"; nothing actually uses it.
type ExternalRequest ¶
type ExternalRequest struct {
RequestParams interface{}
StreamProducer Producer
}
An ExternalRequest is anything that can create and then consume any stream. The request comes bundled with something that can produce a stream (io.Reader), and something that can read from that stream to populate some arbitrary data structure.
type Fake ¶
type Fake struct {
Bytes []byte
// contains filtered or unexported fields
}
Fake is a predefined stream (set with Bytes).
type Producer ¶
type Producer interface {
// The first two io.Readers are expected to be the stdout and stderr streams
// from the process, respectively.
Produce() (io.Reader, io.Reader, error)
Close() error
}
Producer is an interface for anything that can generate an io.Reader from which we can read from (typically JSON output).
type Subprocess ¶
type Subprocess struct {
CmdInvocation []string
// contains filtered or unexported fields
}
Subprocess can spawn a subprocess and read from it. It can be used to read from an io.Reader that produces JSON, or whatever else.
func (*Subprocess) Close ¶
func (sp *Subprocess) Close() error
Close the subprocess by waiting for it.