Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpOutput ¶
DumpOutput prints the output to the io.Writer in a human readable way
func DumpOutputJSON ¶
DumpOutputJSON prints the json encoded output to the io.Writer
Types ¶
type Interval ¶
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.
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 ¶
StartPulling will call Pull on an interval of freq.