tailer

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Overview

Package tailer contains machinery for tailing a specific file, or a set of files matching a pattern.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PathWatcher

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

func NewPathWatcher

func NewPathWatcher(
	pattern patternFunc,
	filter filterFunc,
	handlerFactory handlers.LineHandlerFactory,
	stateRecorder StateRecorder,
) *PathWatcher

func (*PathWatcher) Start

func (p *PathWatcher) Start()

func (*PathWatcher) Stop

func (p *PathWatcher) Stop()

type StateRecorder

type StateRecorder interface {
	Record(path string, offset int64) error
	Get(path string) (int64, error)
	Delete(path string) error
}

func NewStateRecorder

func NewStateRecorder(stateFilePath string) (StateRecorder, error)

type StateRecorderImpl

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

func (*StateRecorderImpl) Delete

func (s *StateRecorderImpl) Delete(path string) (err error)

func (*StateRecorderImpl) Get

func (s *StateRecorderImpl) Get(path string) (offset int64, err error)

func (*StateRecorderImpl) Record

func (s *StateRecorderImpl) Record(path string, offset int64) error

type Tailer

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

Tailer tails a single file, passing each line off to the handler.

func NewTailer

func NewTailer(path string, handler handlers.LineHandler, stateRecorder StateRecorder) *Tailer

func (*Tailer) Clear

func (t *Tailer) Clear()

func (*Tailer) Run

func (t *Tailer) Run() error

func (*Tailer) Stop

func (t *Tailer) Stop()

Jump to

Keyboard shortcuts

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