tailer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2018 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package tailer emulates the features of the tail program (reading from continuously updated files).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tailer

type Tailer struct {
	io.ReadCloser
}

A Tailer holds an io.ReadCloser interface. It implements a Read() function which emulates the tailf UNIX program.

func New

func New(path string) (*Tailer, error)

New returns a new Tailer for the given path.

func (*Tailer) Read

func (t *Tailer) Read(b []byte) (int, error)

Read provides a tailf like generator by handling the io.EOF error. It returns the number of bytes read and any error encountered. At end of file, when no more input is available, Read handles the io.EOF error by continuing the reading loop.

Jump to

Keyboard shortcuts

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