prospector

package
v5.4.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2017 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

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

func NewFactory

func NewFactory(outlet Outlet, registrar *registrar.Registrar, beatDone chan struct{}) *Factory

func (*Factory) Create

func (r *Factory) Create(c *common.Config) (cfgfile.Runner, error)

type Outlet

type Outlet interface {
	OnEvent(event *input.Event) bool
}

type Prospector

type Prospector struct {
	Once bool
	// contains filtered or unexported fields
}

func NewProspector

func NewProspector(cfg *common.Config, outlet Outlet, beatDone chan struct{}) (*Prospector, error)

func (*Prospector) ID

func (p *Prospector) ID() uint64

ID returns prospector identifier

func (*Prospector) LoadStates

func (p *Prospector) LoadStates(states []file.State) error

Init sets up default config for prospector

func (*Prospector) Run

func (p *Prospector) Run()

Starts scanning through all the file paths and fetch the related files. Start a harvester for each file

func (*Prospector) Start

func (p *Prospector) Start()

func (*Prospector) Stop

func (p *Prospector) Stop()

Stop stops the prospector and with it all harvesters

The shutdown order is as follwoing - stop run and scanning - wait until last scan finishes to make sure no new harvesters are added - stop harvesters - wait until all harvester finished - stop communication channel - wait on internal waitgroup to make sure all prospector go routines are stopped - wait until all events are forwarded to the spooler

type ProspectorLog

type ProspectorLog struct {
	Prospector *Prospector
	// contains filtered or unexported fields
}

func NewProspectorLog

func NewProspectorLog(p *Prospector) (*ProspectorLog, error)

func (*ProspectorLog) LoadStates

func (p *ProspectorLog) LoadStates(states []file.State) error

LoadStates loads states into prospector It goes through all states coming from the registry. Only the states which match the glob patterns of the prospector will be loaded and updated. All other states will not be touched.

func (*ProspectorLog) Run

func (p *ProspectorLog) Run()

type ProspectorStdin

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

func NewProspectorStdin

func NewProspectorStdin(p *Prospector) (*ProspectorStdin, error)

NewProspectorStdin creates a new stdin prospector This prospector contains one harvester which is reading from stdin

func (*ProspectorStdin) LoadStates

func (p *ProspectorStdin) LoadStates(states []file.State) error

func (*ProspectorStdin) Run

func (p *ProspectorStdin) Run()

type Prospectorer

type Prospectorer interface {
	LoadStates(states []file.State) error
	Run()
}

Jump to

Keyboard shortcuts

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