harvester

package
v0.0.0-...-ce7f0e0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2015 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileSource

type FileSource interface {
	LogSource
	Stat() (os.FileInfo, error)
	Continuable() bool // can we continue processing after EOF?
}

type FileStat

type FileStat struct {
	Fileinfo      os.FileInfo /* the file info */
	Return        chan int64  /* the harvester will send an event with its offset when it closes */
	LastIteration uint32      /* int number of the last iterations in which we saw this file */
}

Contains statistic about file when it was last seend by the prospector

func NewFileStat

func NewFileStat(fi os.FileInfo, lastIteration uint32) *FileStat

func (*FileStat) Continue

func (fs *FileStat) Continue(old *FileStat)

func (*FileStat) Finished

func (fs *FileStat) Finished() bool

func (*FileStat) Ignore

func (fs *FileStat) Ignore()

Ignore forgets about the previous harvester results and let it continue on the old file - start a new channel to use with the new harvester.

func (*FileStat) Skip

func (fs *FileStat) Skip(returnOffset int64)

type Harvester

type Harvester struct {
	Path             string /* the file path to harvest */
	ProspectorConfig config.ProspectorConfig
	Config           *config.HarvesterConfig
	Offset           int64
	Stat             *FileStat
	SpoolerChan      chan *input.FileEvent
	// contains filtered or unexported fields
}

func NewHarvester

func NewHarvester(
	prospectorCfg config.ProspectorConfig,
	cfg *config.HarvesterConfig,
	path string,
	stat *FileStat,
	spooler chan *input.FileEvent,
) (*Harvester, error)

func (*Harvester) Harvest

func (h *Harvester) Harvest()

Log harvester reads files line by line and sends events to the defined output

func (*Harvester) Start

func (h *Harvester) Start()

func (*Harvester) Stop

func (h *Harvester) Stop()

type LogSource

type LogSource interface {
	io.ReadCloser
	Name() string
}

type Typer

type Typer interface {
	// contains filtered or unexported methods
}

Interface for the different harvester types

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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