taillion

package
v0.0.0-...-304b2f4 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package taillion implements tailing of lion log files.

Uses https://github.com/hpcloud/tail.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Tail

func Tail(
	filePath string,
	unmarshaller lion.Unmarshaller,
	entryHandler EntryHandler,
	errorHandler ErrorHandler,
	options TailOptions,
) error

Tail tails the given file for entries.

Types

type EntryHandler

type EntryHandler func(*lion.Entry) error

EntryHandler handles a lion.Entry that was read.

type ErrorHandler

type ErrorHandler func(error) bool

ErrorHandler handles an error from tailing/ If it returns true, Tail should return.

type SeekInfo

type SeekInfo struct {
	Offset int64
	Whence int // os.SEEK_*
}

SeekInfo represents arguments to `os.Seek`

type TailOptions

type TailOptions struct {
	Location  *SeekInfo     // Seek to this location before tailing
	ReOpen    bool          // Reopen recreated files (tail -F)
	MustExist bool          // Fail early if the file does not exist
	Poll      bool          // Poll for file changes instead of using inotify
	Pipe      bool          // Is a named pipe (mkfifo)
	Follow    bool          // Continue looking for new lines (tail -f)
	Done      chan struct{} // Stop when this channel closes
}

TailOptions are options to Tail.

Source Files

  • taillion.go

Jump to

Keyboard shortcuts

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