filewatcher

package
v0.8.70 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIgnorableNews = fmt.Errorf("ignorable news")
)

Functions

This section is empty.

Types

type FileWatcher

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

FileWatcher watches for new files in a directory, parses them using parseFunc and indexes them using indexer. If PreIndexProcessor is set, it is called before indexing.

func New

func New(fsConfig nwfs.Config, indexer indexer.Indexer, parseFunc ParseFunc, logger ecslogger.ILogger) (FileWatcher, error)

New creates a new Fly instance.

func (*FileWatcher) Run

func (f *FileWatcher) Run()

Run starts the FileWatcher instance.

type IIndexer

type IIndexer interface {
	Index(news *nwelastic.News) error
}

type ParseFunc

type ParseFunc func(newFile nwfs.NewFile) (nwelastic.News, error)

Jump to

Keyboard shortcuts

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