Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackoffDefault ¶
func BackoffDefault() *backoff.ExponentialBackOff
BackoffDefault is the default Backoff behavior for network call retries.
Previous values from k8s.io/apimachinery/pkg/util/wait.`Backoff`: - Duration: time.Second - Factor: 2 - Jitter: 0.1 - Steps: 45 - Cap: time.Second * 60
Types ¶
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 HTTP ¶
HTTP is a wrapper around the net/http's Request type.
func (*HTTP) Close ¶
Close closes the http request. This is required because otherwise there will be a resource leak. See https://stackoverflow.com/a/33238755/437583
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.