fwatch

package
v0.0.0-...-b67b93d Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileContentWatcher

type FileContentWatcher interface {
	// Start a routine to watch for file content changes. It will be stopped when context finishes
	Start(ctx context.Context)
	// IsChanged returns true if file content has been changed since last read
	IsChanged() bool
	// ReadAll tries to read all content from file
	ReadAll() ([]byte, error)
}

func NewFileContentWatcher

func NewFileContentWatcher(filePath string, log logging.Logger) (FileContentWatcher, error)

NewFileContentWatcher returns FileContentWatcher, which tracks changes in file Returns error if filePath is a directory. Caller must Close() the watcher once work finished.

Jump to

Keyboard shortcuts

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