beat

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: May 18, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Beat

type Beat struct {
	Name      string
	Version   string
	Config    *BeatConfig
	BT        Beater
	Publisher *publisher.PublisherType
	Events    publisher.Client
}

Basic beat information

func NewBeat

func NewBeat(name string, version string, bt Beater) *Beat

Initiates a new beat object

func Run

func Run(name string, version string, bt Beater) *Beat

Initiates and runs a new beat object

func (*Beat) CommandLineSetup

func (beat *Beat) CommandLineSetup()

Reads and parses the default command line params To set additional cmd line args use the beat.CmdLine type before calling the function

func (*Beat) LoadConfig

func (b *Beat) LoadConfig()

LoadConfig inits the config file and reads the default config information into Beat.Config. It exists the processes in case of errors.

func (*Beat) Run

func (b *Beat) Run()

Run calls the beater Setup and Run methods. In case of errors during the setup phase, it exits the process.

func (*Beat) Stop

func (beat *Beat) Stop()

Stop calls the beater Stop action.

type BeatConfig

type BeatConfig struct {
	Output  map[string]outputs.MothershipConfig
	Logging logp.Logging
	Shipper publisher.ShipperConfig
}

Basic configuration of every beat

type Beater

type Beater interface {
	Config(*Beat) error
	Setup(*Beat) error
	Run(*Beat) error
	Cleanup(*Beat) error
	Stop()
}

Beater interface that every beat must use

type FlagsHandler

type FlagsHandler interface {
	HandleFlags(*Beat)
}

FlagsHandler (optional) Beater extension for handling flags input on startup. The HandleFlags callback will be called after parsing the command line arguments and handling the '--help' or '--version' flags.

Jump to

Keyboard shortcuts

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