fswatcher

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NotSpecified = iota
	DirectoryNotFound
	FileNotFound

	// The WinFileRemoved Error should never be seen, because it is handled internally in the FileTailer.
	// TODO: Refactor error handling such that this is not part of the public interface.
	WinFileRemoved
)

Variables

This section is empty.

Functions

func NewFile

func NewFile(orig *os.File, newPath string) (*os.File, error)

func NewLineReader

func NewLineReader() *lineReader

Types

type Dir

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

On Linux, we don't need to keep the directory open, but we need to keep an open watch descriptor handle.

func (*Dir) Path

func (d *Dir) Path() string

type Error

type Error interface {
	Cause() error
	Type() ErrorType
	error
}

func NewError

func NewError(errorType ErrorType, cause error, msg string) Error

func NewErrorf

func NewErrorf(errorType ErrorType, cause error, format string, a ...interface{}) Error

type ErrorType

type ErrorType int

type FileTailer

type FileTailer interface {
	Lines() chan *Line
	Errors() chan Error
	Close()
}

func RunFileTailer

func RunFileTailer(globs []glob.Glob, readall bool, failOnMissingFile bool, log logrus.FieldLogger) (FileTailer, error)

func RunPollingFileTailer

func RunPollingFileTailer(globs []glob.Glob, readall bool, failOnMissingFile bool, pollInterval time.Duration, log logrus.FieldLogger) (FileTailer, error)

type Line

type Line struct {
	Line string
	File string
}

Jump to

Keyboard shortcuts

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