ftail

package module
v0.0.0-...-219a2eb Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrWatcherInit = 1 << iota
	ErrWatcherAdd
	ErrWatcherClosed
	ErrWatcherErr
	ErrFileOpen
	ErrFileRead
	ErrFileSeek
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileFollower

type FileFollower struct {
	Name    string
	File    *os.File
	Watcher *fsnotify.Watcher
	// Position int64
	Follow bool // whether to keep running if the file is recreated/truncated/...
}

func NewFileFollower

func NewFileFollower(name string, follow bool) *FileFollower

func (*FileFollower) InitFile

func (ff *FileFollower) InitFile()

func (*FileFollower) InitWatcher

func (ff *FileFollower) InitWatcher()

func (*FileFollower) SeekEnd

func (ff *FileFollower) SeekEnd() int64

func (*FileFollower) TailFile

func (ff *FileFollower) TailFile(c chan<- string)

Jump to

Keyboard shortcuts

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