tail

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIsDir = errors.New("path is a directory")

Functions

This section is empty.

Types

type Dir

type Dir struct {
	Events chan FileEvent
	// contains filtered or unexported fields
}

Dir observes a directory and will emit events when files are added or removed. When open for the first time this will emit an event for every existing file.

func TailDir

func TailDir(dir string, globs ...string) (*Dir, error)

func (*Dir) Stop

func (d *Dir) Stop() error

type File

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

func NewFile

func NewFile(name string) (*File, error)

func TailFileWithContext

func TailFileWithContext(ctx context.Context, name string) (*File, error)

func (*File) Close

func (f *File) Close() error

func (*File) Read

func (f *File) Read(b []byte) (int, error)

func (*File) Stop

func (f *File) Stop() error

type FileEvent

type FileEvent struct {
	Name string
	Op   FileOp
	Err  error
}

type FileOp

type FileOp int
const (
	FileOpCreated FileOp = iota
	FileOpExisting
	FileOpRemoved
)

func (FileOp) Exists

func (f FileOp) Exists() bool

Jump to

Keyboard shortcuts

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