harvester

package
v6.0.0-rc1+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogType   = "log"
	StdinType = "stdin"
	RedisType = "redis"
	UdpType   = "udp"
)

Contains available prospector types

Variables

View Source
var ValidType = map[string]struct{}{
	StdinType: {},
	LogType:   {},
	RedisType: {},
	UdpType:   {},
}

ValidType of valid input types

Functions

func MatchAny

func MatchAny(matchers []match.Matcher, text string) bool

MatchAny checks if the text matches any of the regular expressions

Types

type Forwarder

type Forwarder struct {
	Outlet Outlet
}

Forwarder contains shared options between all harvesters needed to forward events

func NewForwarder

func NewForwarder(outlet Outlet) *Forwarder

NewForwarder creates a new forwarder instances and initialises processors if configured

func (*Forwarder) Send

func (f *Forwarder) Send(data *util.Data) error

Send updates the prospector state and sends the event to the spooler All state updates done by the prospector itself are synchronous to make sure no states are overwritten

type ForwarderConfig

type ForwarderConfig struct {
	Type string `config:"type"`
}

ForwarderConfig contains all config options shared by all harvesters

type Harvester

type Harvester interface {
	ID() uuid.UUID
	Run() error
	Stop()
}

Harvester contains all methods which must be supported by each harvester so the registry can be used by the prospector.

type Outlet

type Outlet interface {
	OnEvent(data *util.Data) bool
}

Outlet interface is used for forwarding events

type Registry

type Registry struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Registry struct manages (start / stop) a list of harvesters

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new registry object

func (*Registry) Len

func (r *Registry) Len() uint64

Len returns the current number of harvesters in the registry

func (*Registry) Start

func (r *Registry) Start(h Harvester)

Start starts the given harvester and add its to the registry

func (*Registry) Stop

func (r *Registry) Stop()

Stop stops all harvesters in the registry

func (*Registry) WaitForCompletion

func (r *Registry) WaitForCompletion()

WaitForCompletion can be used to wait until all harvesters are stopped

type Source

type Source interface {
	io.ReadCloser
	Name() string
	Stat() (os.FileInfo, error)
	Continuable() bool // can we continue processing after EOF?
	HasState() bool    // does this source have a state?
}

Directories

Path Synopsis
Package reader provides interface and struct to read messages and report them to a harvester
Package reader provides interface and struct to read messages and report them to a harvester

Jump to

Keyboard shortcuts

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