filetailer

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tailer

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

Tailer scans a file for newly appended lines and returns them.

func New

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

New creates a new Tailer object. It's the caller's responsibility to ensure the filename is correct. We don't check the file existence here because we have to tolerate log file rotation.

func (*Tailer) Close

func (t *Tailer) Close()

Close closes the Tailer object and release all resources.

func (*Tailer) Scan

func (t *Tailer) Scan() bool

Scan scans the file for new lines. See bufio.Scanner.Scan() for more details.

func (*Tailer) Text

func (t *Tailer) Text() string

Text returns the most recent line by a call of Scan from the file. See bufio.Scanner.Text() for more details.

Jump to

Keyboard shortcuts

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