fastutil

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpOutput

func DumpOutput(w io.Writer, output testbedi.Output)

DumpOutput prints the output to the io.Writer in a human readable way

func DumpOutputJSON

func DumpOutputJSON(w io.Writer, output testbedi.Output)

DumpOutputJSON prints the json encoded output to the io.Writer

Types

type Interval

type Interval struct {
	bytes.Buffer
	// contains filtered or unexported fields
}

Interval is a bytes.Buffer containing all data that has been written to an IntervalRecorder from the Intervals creation until Stop is called. You should not create this structure directly but instead use the Start method on the IntervalRecorder.

func (*Interval) Stop

func (r *Interval) Stop()

Stop will stop any further data being written to the interval after it returns.

type IntervalRecorder

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

IntervalRecorder is an io.Writer which provides an easy way to record intervals of data written to it.

func NewIntervalRecorder

func NewIntervalRecorder() *IntervalRecorder

NewIntervalRecorder returns a new IntervalRecorder.

func (*IntervalRecorder) Start

func (lw *IntervalRecorder) Start() *Interval

Start creates a new Interval, all data written to the IntervalRecorder after Start returns will be available in the interval. The interval should not be read from until Stop is called. See Stop for more detail

func (*IntervalRecorder) Write

func (lw *IntervalRecorder) Write(p []byte) (int, error)

Write appends the contents of p to the IntervalRecorder. The return value is the length of p; err is always nil. If the internal buffer comes to large, Write will panic with bytes.ErrToLarge. See bytes.Buffer for more info: https://golang.org/pkg/bytes/#Buffer.Write

type LinePuller

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

LinePuller provides an easy way to pull complete lines (ending in \n) from a source to a sink.

func NewLinePuller

func NewLinePuller(source io.Reader, sink io.Writer) *LinePuller

NewLinePuller returns a LinePuller that will read complete lines from the source to the sink when started (see Start) on the provided frequency.

func (*LinePuller) Pull

func (lp *LinePuller) Pull() error

Pull reads in all data from the source and writes each line out to the sink.

func (*LinePuller) StartPulling

func (lp *LinePuller) StartPulling(ctx context.Context, freq time.Duration) error

StartPulling will call Pull on an interval of freq.

type Output

type Output struct {
	Args     []string
	ExitCode int
	Error    error
	Stderr   string
	Stdout   string
}

Output represent the output of a command run

Jump to

Keyboard shortcuts

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