import "github.com/tideland/golib/scroller"
Package scroller of the Tideland Go Library helps analyzing a continuously written line by line content, e.g. at the monitoring of log files. Here the Scroller is working in the background and allows to read out of any ReadSeeker (which may be a File) from beginning, end or a given number of lines before the end, filter the output by a filter function and write it into a Writer. If a number of lines and a filter are passed the Scroller tries to find that number of lines matching to the filter.
Error codes of the scroller package.
IsNegativeLinesError returns true, if the error shows the setting of a negative number of lines to start with.
IsNoSourceError returns true, if the error signals that no source has been passed.
IsNoTargetError returns true, if the error signals that no target has been passed.
FilterFunc decides if a line shall be scrolled (func is nil or returns true) or not (func returns false).
Option defines a function setting an option.
BufferSize allows to set the initial size of the buffer used for reading.
func Filter(ff FilterFunc) Option
Filter sets the filter function of the scroller.
Lines sets the number of lines ro scroll initially.
PollTime defines the frequency the source is polled.
type Scroller struct {
// contains filtered or unexported fields
}Scroller scrolls and filters a ReadSeeker line by line and writes the data into a Writer.
NewScroller starts a Scroller for the given source and target. The options can control the number of lines, a filter, the buffer size and the poll time.
Error returns the status and a possible error of the scroller.
Stop tells the scroller to end working.
Wait blocks until the scroller has stopped.
Package scroller imports 7 packages (graph). Updated 2018-08-29. Refresh now. Tools for package owners.