Documentation ¶
Index ¶
- Constants
- func Transform(transform []string, input []byte, out *types.Event) (transformed bool, err error)
- func TransformResult(transform types.TransformConfig, input *types.ChildResult, out *types.Event) (transformed bool, err error)
- type BufferedWriter
- type Config
- type Floop
- type Handler
- type Lifecycle
- type Result
Constants ¶
const VERSION = "0.1.7"
VERSION number
Variables ¶
This section is empty.
Functions ¶
func TransformResult ¶ added in v0.1.3
func TransformResult(transform types.TransformConfig, input *types.ChildResult, out *types.Event) (transformed bool, err error)
TransformResult transforms the input given the transform and writes it to the event data
Types ¶
type BufferedWriter ¶
type BufferedWriter struct {
// contains filtered or unexported fields
}
BufferedWriter is a writer that buffers all the data on top of a callback buffer writer
func NewBufferedWriter ¶
func NewBufferedWriter(cb func([]byte), buffer bool) *BufferedWriter
NewBufferedWriter instantiates a new BufferedWriter. The cb is called each time a wrie ending in a new line is found. If buffer is true a data copy is kept internally which can be used later.
func (*BufferedWriter) Bytes ¶
func (wr *BufferedWriter) Bytes() []byte
Bytes returns all bytes written till now. If the internal buffer is not enabled nil is returned
type Config ¶
type Config struct { Command string Args []string Meta []string // required meta keys Quiet bool ResolverHosts []string `yml:"resolverhost"` ResolverPort int `yml:"resolverport"` Handlers map[types.EventType][]*types.HandlerConfig ReadFromStderr bool `yml:"stderr"` }
Config is the overall config.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a Config with defaults using the echo Lifecycle
func LoadConfig ¶
LoadConfig loads a config from the file given by filename
type Floop ¶
type Floop struct {
// contains filtered or unexported fields
}
Floop is the core interface that manages the process lifecycle and handlers
type Handler ¶
type Handler interface { // raw event and config after interpolation Handle(event *types.Event, conf *types.HandlerConfig) (map[string]interface{}, error) Init(conf *types.HandlerConfig) error CloseConnection() error }
Handler represents the event handler interface.
type Lifecycle ¶
type Lifecycle struct {
// contains filtered or unexported fields
}
Lifecycle implements a Lifecycle that calls multiple lifecycles for an event.
func NewLifecycle ¶
NewLifecycle instantiates an instance of Lifecycle
func (*Lifecycle) Begin ¶
Begin is called right before a process is launched. The context is internally stored and may be updated by subsequent phases from callback responses.
func (*Lifecycle) Canceled ¶ added in v0.1.4
func (lc *Lifecycle) Canceled(result *types.ChildResult)
Canceled is called if the process was interrupted or killed. Data from stderr and stdout are passed in as args
func (*Lifecycle) Close ¶ added in v0.1.3
func (lc *Lifecycle) Close()
Close - close completed and failed handlers so the last event is published
func (*Lifecycle) Completed ¶
func (lc *Lifecycle) Completed(result *types.ChildResult)
Completed is called when a process completes with a zero exit code. Data from stderr and stdout are passed in as args
func (*Lifecycle) Failed ¶
func (lc *Lifecycle) Failed(result *types.ChildResult)
Failed is called if the process exits with a non-zero exit status. Data from stderr and stdout are passed in as args