pailer

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2017 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const PollInterval = 100 * time.Millisecond

Variables

View Source
var (
	ErrMaxExceeded   = errors.New("max exceeded")
	ErrEndPagination = errors.New("no more items to paginate")
)

Functions

func Monitor

func Monitor(caller operator.Caller, w io.Writer, lines int, pag *FilePaginator) (err error)

func Pailer

func Pailer(data <-chan *agent.Response_ReadFile, cancel chan bool, n int, w io.Writer) error

Pailer reads until n lines

Types

type FilePaginator

type FilePaginator struct {
	Max    uint64 // Maximum offset
	Follow bool   // Begin at the end
	Path   string // Path to file
	// contains filtered or unexported fields
}

FilePaginator paginates requests to the HTTP operator endpoint sending the response as fileData on the data channel. If max is a negative number paginate forever or until a message is received at f.cancel. Otherwise find the length of the file and paginate until we reach that position.

func (*FilePaginator) Close

func (f *FilePaginator) Close()

func (*FilePaginator) Next

func (f *FilePaginator) Next(caller operator.Caller) error

Jump to

Keyboard shortcuts

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