inputs

package
v0.0.0-...-08d4bb0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2017 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrInputNotRegistered is returned when attempting to create an unregistered Input.
	ErrInputNotRegistered = errors.New("Input doesn't exist")
)

Functions

This section is empty.

Types

type FileInput

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

A FileInput will read a file and optionally tail it. Each line is considered a separate event.

func (*FileInput) Close

func (i *FileInput) Close() error

Close the FileInput

func (*FileInput) Start

func (i *FileInput) Start(out chan<- *event.Event) error

Start the FileInput reading/tailing.

type Input

type Input interface {
	// Start creates a go routine for the Input to run in. out is an Event
	// channel where the Input will send generated Events.
	Start(out chan<- *event.Event) error

	// Close allows graceful shutdown of an Input.
	Close() error
}

An Input generates events to be processed.

func New

func New(name string, options map[string]interface{}) (Input, error)

New creates an instance of Input name with options. Options are dependent on the Input.

Jump to

Keyboard shortcuts

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